HOW TO

  1. Go to AWS console and create user with Admin Access and download credentials.

  2. 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

  3. 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)

  4. use terransible.env to create your .env that will be used by docker and fill the variables with your values

    cp terransible.env .env

  5. Build container

    docker-compose build

  6. Run container

    docker-compose up -d

  7. Connect to container

ONLY AFTER BUILDING (first time)

  1. Create a profile to manage AWS

    aws configure --profile superhero

  2. Check instances to see if we are connected

    aws ec2 describe-instances --profile superhero

  3. Create Route53 reusable delegation set

    aws route53 create-reusable-delegation-set --caller-reference 1224 --profile superhero

  4. 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

  5. If you have a terraform.tfstate file copy it inside the ./terraform folder. This folder will be shared with the docker container.

  6. Configure the corresponding .tfvars file

  7. Do a terraform init

    cd terraform

    terraform init

EVERY TIME YOU "up" your container

  1. Run following commands to add the ssh key to the agent inside the docker container

    eval `ssh-agent -s`

    ssh-add your_key_name

  2. Finally TERRAFORM

    cd terraform

    terraform apply