Cloudformation

The infrastructure is deployed with Cloudformation to ease user access to the deployment process. Everything can be rewritten in terraform but will require more technical knowledge.

Requirements

A domain is required, but any base domain will work.

The ACM certificate is required in us-east-1 because of the use of Cloudfront. It needs to be a wildcard for the base domain.

Pre Installation

First clone the repository.

mkdir -p heron
cd heron
git clone git@github.com:Heron-Mobi/Cloudformation.git
cd Cloudformation

You will have to load some required base parameters.

mkdir -p parameters

Create a file in the parameters directory called

base.json

The contents will look like this

(values below are not real, replace with your value)

cat parameters/base.json
[
	{
      		"ParameterKey":"CertARN",
      		"ParameterValue":"arn:aws:acm:us-east-1:123456789012:certificate/a123b456-c789-0123-de45-6f7890g12345"
	},
	{
      		"ParameterKey":"DomainName",
      		"ParameterValue":"yourdomain.com"
	},
	{
      		"ParameterKey":"HostedZone",
      		"ParameterValue":"Z1234567890A1B2C3DE45"
	}
]

Create a file in the parameters directory called

03email.json

The contents will look like this

(values below are not real, replace with your value)

cat parameters/03email.json

[
	{
      		"ParameterKey":"SourceEmail",
      		"ParameterValue":"info@yourdomain.com"
	}
]

To change the Region you will deploy to, edit the Makefile.

Installation

Bootstrap

First we will deploy a bucket to put Lambda function code.

make createbootstrap

Lambdas

All lambda code can be built and pushed into the boostrap bucket

make buildlambdas

Base Stack

The base stack creates:

  • Cognito identity pools
  • Cognito user pools
  • S3 bucket for published videos
  • S3 bucket for user configuration
  • user role
  • Cloudfront distribution for watching videos
make createbase

Video player assets

Next we will upload some required static assets for the video player.

make uploadplayerassets

API Gateway

The API Gateway will be deployed with the required Lambdas for the user dashboard.

make createapigateway

Signal

Deploys an SQS queue and a lambda listener that will trigger signals the user has configured.

make createsignal

Signalers

Deploys SQS queues and lambda listeners that will run the signal, currently email and Twitter.

make createsignalers

This will create an email address in SES for sending emails. Please check that email address inbox and confirm SES can use that email to send emails.

Dashboard

Deploys an S3 bucket and Cloudfront distribution for the dashboard.

make createdashboard

Deploy the Dashboard

Exit current directory

cd ..

Move on to deploying the Dashboard.