Terraform modules for creating AWS S3 static website and backend server using AWS ECS fargate.
Name | Version |
---|---|
terraform | >= 0.12 |
Name | Version |
---|---|
aws | n/a |
Name | Source | Version |
---|---|---|
pn-app-cloudfront | ./modules/cloudfront | n/a |
pn-app-route53 | ./modules/route53 | n/a |
pn-app-s3 | ./modules/s3 | n/a |
pn-server-acm | ./modules/acm | n/a |
pn-server-alb | ./modules/alb | n/a |
pn-server-ecs | ./modules/ecs | n/a |
pn-server-security | ./modules/sg | n/a |
pn-server-subnet | ./modules/subnet | n/a |
Name | Type |
---|---|
aws_vpc.pn-server-vpc | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
availability_zone | n/a | list(string) |
[ |
no |
container_count | number of docker containers to run | number |
2 |
no |
container_cpu | ECS container CPU units to provision (1 vCPU = 1024 CPU units) | number |
"512" |
no |
container_memory | ECS container memory | number |
"1024" |
no |
container_port | ECS container port | number |
"5000" |
no |
env_prefix | n/a | string |
"prod" |
no |
fargate_cpu | Fargate instance CPU units to provision (1 vCPU = 1024 CPU units) | string |
"512" |
no |
fargate_memory | Fargate instance memory to provision (in MiB) | string |
"1024" |
no |
frontend_bucket_name | pn app s3 bucket name for frontend static webstie | string |
"prod-pn-app.petnanny.live" |
no |
health_check_path | health ceck path pn server | string |
"/api/petSitters" |
no |
image_tag | pn backend image tag | string |
"latest" |
no |
pn-server-port | port exposed by the docker image to redirect traffic to | number |
5000 |
no |
private_subnet_cidr_blocks | n/a | list(string) |
[ |
no |
public_subnet_cidr_blocks | n/a | list(string) |
[ |
no |
repo_url | ECR pn backend url repo | string |
"312518712322.dkr.ecr.ap-southeast-2.amazonaws.com/pet-nanny-prod" |
no |
root_domain | Pet Nanny root domain | string |
"petnanny.live" |
no |
vpc_cidr_block | n/a | string |
"10.0.0.0/16" |
no |
Name | Description |
---|---|
frontend_record_name | n/a |
website_domain | n/a |
website_endpoint | n/a |
Name | Version |
---|---|
aws | n/a |
Name | Type |
---|---|
aws_s3_bucket.pn-app | resource |
aws_s3_bucket_acl.pn-app-bucket-acl | resource |
aws_s3_bucket_policy.pn-app-bucket-poloicy | resource |
aws_s3_bucket_website_configuration.pn-app | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
env_prefix | environment prefix | any |
n/a | yes |
frontend_bucket_name | bucket name for the static website - website domain name | any |
n/a | yes |
Name | Description |
---|---|
bucket_regional_domain_name | n/a |
website_domain | n/a |
website_endpoint | n/a |
Name | Version |
---|---|
aws | n/a |
Name | Type |
---|---|
aws_cloudfront_distribution.s3_distribution | resource |
aws_acm_certificate.issued_ssl_cert | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
env_prefix | environment prefix | any |
n/a | yes |
frontend_bucket_name | bucket name for the static website - website domain name | any |
n/a | yes |
root_domain | root domain name | any |
n/a | yes |
s3_bucket_regional_domain_name | frontend bucket regional domain name | any |
n/a | yes |
Name | Description |
---|---|
cloudfront_s3_distribution | n/a |
Name | Version |
---|---|
aws | n/a |
Name | Type |
---|---|
aws_route53_record.frontend_record | resource |
aws_route53_zone.zone | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
cloudfront_s3_distribution_domian_name | cloudfront distribution.s3 distribution domain name | any |
n/a | yes |
cloudfront_s3_distribution_hosted_zone_id | cloudfront distribution.s3 distribution hosted zone id | any |
n/a | yes |
frontend_bucket_name | bucket name for the static website - website domain name | any |
n/a | yes |
root_domain | root domain name | any |
n/a | yes |
Name | Description |
---|---|
frontend_record_name | n/a |
Name | Version |
---|---|
aws | n/a |
Name | Type |
---|---|
aws_eip.pn-server-ngw-eip | resource |
aws_internet_gateway.pn-server-igw | resource |
aws_nat_gateway.pn-server-ngw | resource |
aws_route_table.pn-server-private-rtb | resource |
aws_route_table.pn-server-public-rtb | resource |
aws_route_table_association.a-private-rtb-subnet | resource |
aws_route_table_association.a-public-rtb | resource |
aws_subnet.pn-server-private-subnet | resource |
aws_subnet.pn-server-public-subnet | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
availability_zone | n/a | any |
n/a | yes |
env_prefix | n/a | any |
n/a | yes |
private_subnet_cidr_blocks | n/a | any |
n/a | yes |
public_subnet_cidr_blocks | n/a | any |
n/a | yes |
vpc_id | n/a | any |
n/a | yes |
Name | Description |
---|---|
private-subnet | n/a |
public-subnet | n/a |
Name | Version |
---|---|
aws | n/a |
Name | Type |
---|---|
aws_security_group.ecs-cluster-sg | resource |
aws_security_group.pn-server-alb-sg | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
env_prefix | environment prefix | any |
n/a | yes |
vpc_id | vpc id | any |
n/a | yes |
Name | Description |
---|---|
alb-sg | n/a |
ecs-cluster-sg-id | n/a |
Name | Version |
---|---|
aws | n/a |
Name | Type |
---|---|
aws_alb_listener.https-alb | resource |
aws_lb.pn-server-alb | resource |
aws_lb_listener.http-https | resource |
aws_lb_target_group.pn-server-alb-tg | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
alb_sg_id | application load balancer security group id | any |
n/a | yes |
certificate_arn | certificate arn for the root domian wildcard | any |
n/a | yes |
env_prefix | environment prefix | any |
n/a | yes |
health_check_path | backend server health check path | any |
n/a | yes |
public_subnet_id | public subnet id/s | any |
n/a | yes |
vpc_id | vpc id | any |
n/a | yes |
Name | Description |
---|---|
alb | n/a |
alb_listener_https_alb | n/a |
alb_target_group | n/a |
Name | Version |
---|---|
aws | n/a |
Name | Type |
---|---|
aws_alb_listener.https-alb | resource |
aws_lb.pn-server-alb | resource |
aws_lb_listener.http-https | resource |
aws_lb_target_group.pn-server-alb-tg | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
alb_sg_id | application load balancer security group id | any |
n/a | yes |
certificate_arn | certificate arn for the root domian wildcard | any |
n/a | yes |
env_prefix | environment prefix | any |
n/a | yes |
health_check_path | backend server health check path | any |
n/a | yes |
public_subnet_id | public subnet id/s | any |
n/a | yes |
vpc_id | vpc id | any |
n/a | yes |
Name | Description |
---|---|
alb | n/a |
alb_listener_https_alb | n/a |
alb_target_group | n/a |
Name | Version |
---|---|
aws | n/a |
Name | Type |
---|---|
aws_alb_listener.https-alb | resource |
aws_lb.pn-server-alb | resource |
aws_lb_listener.http-https | resource |
aws_lb_target_group.pn-server-alb-tg | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
alb_sg_id | application load balancer security group id | any |
n/a | yes |
certificate_arn | certificate arn for the root domian wildcard | any |
n/a | yes |
env_prefix | environment prefix | any |
n/a | yes |
health_check_path | backend server health check path | any |
n/a | yes |
public_subnet_id | public subnet id/s | any |
n/a | yes |
vpc_id | vpc id | any |
n/a | yes |
Name | Description |
---|---|
alb | n/a |
alb_listener_https_alb | n/a |
alb_target_group | n/a |
โ pn-IaC git:(feature01_update_cloudfront_module) terraform-docs markdown ./modules/ecs |
Name | Version |
---|---|
aws | n/a |
Name | Type |
---|---|
aws_ecs_cluster.pn-server-cluster | resource |
aws_ecs_service.pn-server-service | resource |
aws_ecs_task_definition.pn-server-task-definition | resource |
aws_iam_policy.ecs_task_execution_policy | data source |
aws_iam_role.ecs_task_execution_role | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
alb_target_group_arn | applicaiton load balancer target group arn | any |
n/a | yes |
container_count | container count | any |
n/a | yes |
container_cpu | container cpu | any |
n/a | yes |
container_memory | container memory | any |
n/a | yes |
container_port | container port | any |
n/a | yes |
ecs_cluster_sg_id | ecs cluster security group id | any |
n/a | yes |
ecs_dependends_on_list | dependency list before creating ecs | any |
n/a | yes |
env_prefix | n/a | any |
n/a | yes |
fargate_cpu | n/a | any |
n/a | yes |
fargate_memory | n/a | any |
n/a | yes |
image_tag | image tag for task definition | any |
n/a | yes |
pn-server-port | container port for load balancer | any |
n/a | yes |
private_subnet_id | private subnet id for ecs network | any |
n/a | yes |
repo_url | ecr repo url | any |
n/a | yes |
vpc_id | n/a | any |
n/a | yes |