Terraform Capability for Architect
- Must have terraform installed; v1.7.3+
- AWS Credentials Key & Secret with appropriate permissions.
The following are pre-existing AWS items manually created that are provided as inputs
- Docker Image for Task Definition.
- ACM SSL Certificate ARN. - Eventually will want to have Terraform create this and attach to the Load Balancer DNS.
- Route 53 - Zone ID of appropriate Hosted Zone
- export AWS_ACCESS_KEY_ID=abc123
- export AWS_SECRET_ACCESS_KEY=abc123
- terraform init
- terraform validate
- terraform apply
- terraform destroy (to remove)
During testing it's okay to let the terraform state file reside on the machine (local). However, in production, this might be deleted and it ought be configured to be remote.
https://developer.hashicorp.com/terraform/language/settings/backends/s3
- Will want to parameterize different deployments; eg tags, resource names. That way I can run "terraform apply" for multiple sites; eg staging, test, dev. (Workspaces?)
- May be able to get domain name from the hosted zone.
- Three subnets for networking?
Articles / Repos / Tools that were found useful in creating this terraform repository:
- https://github.com/aws-samples/deploy-python-flask-microservices-to-aws-using-open-source-tools/tree/main
- https://developer.hashicorp.com/terraform/tutorials/aws-get-started
- https://dev.to/kieranjen/ecs-fargate-service-auto-scaling-with-terraform-2ld
- https://dev.to/ajeetraina/implementing-automated-rds-backup-and-restore-strategy-with-terraform-4o3e