Deploy a container using AWS ECS with an ALB in front of it
run terraform apply --var-file=my.tfvars
vpc_id = "vpc-abc123"
alb_subnets = ["subnet-abc124", "subnet-abc123", "subnet-abc125"]
ecs_subnets = ["subnet-abc124", "subnet-abc123", "subnet-abc125"]
region = "us-west-2"
desired_count = 1
env = "test"
image = "nginx/nginx:latest"
container_port = 80
name = "tf-ecr"
# ECR settings
#use_ecr = true
#ecr_region = "us-west-2"
#ecr_repo_name = "my-ecr-repo"
#ecr_tag = "latest"
# ALB configs
allow_cloudflare = false
https_redirect_enabled = false
Name | Version |
---|---|
aws | ~> 4.62.0 |
http | ~> 3.2.0 |
No providers.
Name | Source | Version |
---|---|---|
alb | ./alb | n/a |
ecs | ./ecs | n/a |
iam | ./iam | n/a |
No resources.
Name | Description | Type | Default | Required |
---|---|---|---|---|
alb_subnets | subnet ids the ALB should live in | list(string) |
n/a | yes |
allow_cloudflare | is cloudflare being used? | bool |
false |
no |
certificate_arn | ARN for the SSL certificate used by the ALB | string |
"" |
no |
container_port | port the container receives traffic from | number |
n/a | yes |
cpu | CPU units per container instance | string |
"256" |
no |
desired_count | Number of instances of the task definition to place and keep running | string |
"" |
no |
ecr_region | region for ECR repo | string |
"" |
no |
ecr_repo_name | name of the ECR repo used | string |
"" |
no |
ecr_tag | desired image tag from ECR repo | string |
"" |
no |
ecs_subnets | subnets used by the ECS service | list(string) |
n/a | yes |
env | what environment are these resources being deployed to? | string |
"staging" |
no |
https_redirect_enabled | is the https redirect enabled? | bool |
false |
no |
image | docker image | string |
"" |
no |
inbound_ips | list of allowed inbound IP addresses | list(string) |
[ |
no |
max_cpu_threshold | n/a | string |
85 |
no |
memory | MB of memory per container instance | string |
"512" |
no |
name | a unique prefix for resource names | string |
"" |
no |
region | aws region the resources will be created in | string |
n/a | yes |
use_ecr | whether to use ECR | bool |
"false" |
no |
vpc_id | vpc_id that all the things will live in | string |
n/a | yes |
Name | Description |
---|---|
dns | n/a |