|
| 1 | +# Terraform Module to Setup Atlantis in ECS with Self-Managed EC2 Instances and VPC Creation |
| 2 | + |
| 3 | +This Terraform module automates the deployment of the Atlantis server on an ECS cluster with self-managed EC2 instances, along with VPC creation. It includes the configuration of an Application Load Balancer (ALB) for traffic routing. The module simplifies the process of setting up and managing Atlantis, enabling automated Terraform pull request workflows. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- Domain with acm certificate attached |
| 8 | +- Application secrets stored in AWS SSM Parameter Store with the following names and descriptions: |
| 9 | + |
| 10 | + - `/atlantis/ATLANTIS_GH_USER`: The GitHub username used by Atlantis. Obtain this from your GitHub account settings. |
| 11 | + - `/atlantis/ATLANTIS_GH_TOKEN`: A GitHub personal access token with repo and admin:repo_hook permissions. Generate this from GitHub Developer settings. |
| 12 | + - `/atlantis/ATLANTIS_GH_WEBHOOK_SECRET`: The secret used to validate GitHub webhooks. Create a random secret string for this. |
| 13 | + - `/atlantis/AWS_ACCESS_KEY_ID`: The AWS Access Key ID for an IAM user with necessary permissions. Obtain this from AWS IAM user security credentials. |
| 14 | + - `/atlantis/AWS_SECRET_ACCESS_KEY`: The AWS Secret Access Key for the same IAM user. Obtain this from AWS IAM user security credentials. |
| 15 | + |
| 16 | + |
| 17 | +## Example tfvars configuration |
| 18 | + |
| 19 | +``` |
| 20 | +availability_zones = ["ap-south-1a", "ap-south-1b] |
| 21 | +public_subnet_ids = ["subnet-0123456789", "subnet-1234567890"] |
| 22 | +system_name = "atlantis" |
| 23 | +private_subnet_ids = ["subnet-9876543210", "subnet-6543217890"] |
| 24 | +vpc_id = "vpc-1234567890" |
| 25 | +ecs_cluster_name = "atlantis" |
| 26 | +ecs_service_name = "atlantis" |
| 27 | +ecs_task_definition_family = "atlantis" |
| 28 | +ecs_launch_type_cpu = 256 |
| 29 | +ecs_launch_type_memory = 512 |
| 30 | +ecs_container_definations_name = "atlantis" |
| 31 | +vpc_cidr_block = "10.0.0.0/16" |
| 32 | +base_domain = "base_domain.io" |
| 33 | +sub_domain = "testatlantis" |
| 34 | +launch_template_key_name = "test-atlantis" |
| 35 | +``` |
0 commit comments