-
Go to AWS console and create user with Admin Access and download credentials.
-
In case you are setting up the infrastructure generate ssh key pair that will be used to create EC2 instances on your local computer
shh-keygen
-
If you are managing an existing infrastructure be sure to ask for the private key in case you need to connect to the EC2 instances (needed for terraform apply)
-
use terransible.env to create your .env that will be used by docker and fill the variables with your values
cp terransible.env .env
-
Build container
docker-compose build
-
Run container
docker-compose up -d
-
Connect to container
-
Create a profile to manage AWS
aws configure --profile superhero
-
Check instances to see if we are connected
aws ec2 describe-instances --profile superhero
-
Create Route53 reusable delegation set
aws route53 create-reusable-delegation-set --caller-reference 1224 --profile superhero
-
BONUS: If you want to manually create hosted zones using the delegate dataset use:
aws route53 create-hosted-zone --name marinabits.de --caller-reference 1224 --delegation-set-id /delegationset/NXO03GZWZVOG9 --profile superhero
-
If you have a terraform.tfstate file copy it inside the ./terraform folder. This folder will be shared with the docker container.
-
Configure the corresponding .tfvars file
-
Do a terraform init
cd terraform
terraform init
-
Run following commands to add the ssh key to the agent inside the docker container
eval `ssh-agent -s`
ssh-add your_key_name
-
Finally TERRAFORM
cd terraform
terraform apply