- Define instance type and AWS region
values/development-task-hr-eu-west-1.tfvars
File has got region in name, just in case someone would like to deploy that onto multi-regions.
- Create ssh key-pair on AWS in the region, which you choose
- Create AMI user with access to the AWS API, for the purpose of this exercises it was quite wide - AdministratorAccess
terraform init
terraform plan -var-file values/development-task-hr-eu-west-1.tfvars -var="aws_access_key=XXXXXXXX" -var="aws_secret_key=YYYYYYYYYYYYYYYYYYYYY" -out plan.out
terraform apply plan.out
- Access bastion host via ssh
ssh -i ~/.ssh/xapo-interview.pem ec2-user@<BASTION_PUBLIC_IP>
- Check out index.html on both nginx nodes from bastion host
curl -q -s http://<NGINX_1_PRIVATE_IP>
curl -q -s http://<NGINX_2_PRIVATE_IP>
- Use s3 as a backend for terraform.
- Use DynamoDB table for terraform locking.
- Add LoadBalancer in front of nginx.