A set of services and tools to help with deployment.
Prereq Buy domain name on aws route53, which will automatically create a hosted zone for you.
Note: First time running this script you will need to manually validate the certificate via your email so the certificates become valid in aws. Then run the script again
All steps will be performed lazily.
- Creates certs using ACM.
- Creates buckets in s3.
- Creates a cloudfront distribution.
- Creates A records in route53.
Add the script as a dev dep.
yarn add kontinuum-push --dev
Now add a npm script to call the push script.
{
"scripts": {
"deploy": "./node_modules/kontinuum-push/build/bin/index.js push --domain foo.example.com --source ./build"
}
}
IMPORTANT First time running, this will take like an hour to propagate, you might see access denied aws errors in the meantime if you try hitting your domain.
Important: Do this in the environment before running the script.
These scripts are just wrappers around aws-cli so first you need the cli. You will need python and pip because awscli is a python package. Also requires jq.
brew install python jq
pip install awscli
Each script will reference the following env vars.
AWS_DEFAULT_REGION
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
List of regions for the env var AWS_DEFAULT_REGION
: Region Default List eg. us-west-2
TL;DR
-
Create New Group, attach the following policies.
- AmazonS3FullAccess
- AmazonRoute53FullAccess
-
Create IAM User, select
programmatic access
for access type. Add user to the group you just created. -
You can download the csv and save it in a safe location. This file contains your
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
.
aws configure
You will be prompted for AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
.