- Dependencies:
- Setup AWS account, and IAM user, with policies (attach EC2 Full Access) -- TODO: Manage Terraform policies better
- User AWS CLI to configure account
- Install Terraform
- Install Ansible
- Github CLI (or otherwise get Github API token)
- Setup Cloudflare and add a domain as zone (get Cloudflare API token)
- Clone repo (potentially some permissions are required if not public, and potentially you would want to fork it first, and clone your fork)
- If setting up for the first time, generate key pairs (else get existing keys securely):
mkdir -p private/keys/instance private/keys/deployssh-keygen -t ed25519 -C "deankayton@gmail.com" -f private/keys/instance/idssh-keygen -t ed25519 -C "deankayton@gmail.com" -f private/keys/deploy/id
cp terraform.tfvars.tpl terraform.tfvarsand modify what is applicable (mainly Cloudflare and Github token)- Provision Infrastructure (
terraform initandterraform applyfrom root of repo) - Change workspace to 'prod'
terraform workspace new prodandterraform workspace select prodand repeat last step - Staging is the default, so to go back,
terraform workspace select default - It is possible to use Ansible to provision staging and prod simultaneously
dnk8n/dtrack
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|