ecs-web-app

cloudposse/ecs-web-app/aws

Terraform Module HCL AWS

Terraform module that implements a web app on ECS and supports autoscaling, CI/CD, monitoring, ALB integration, and much more.

Install
module "ecs-web-app" {
source = "cloudposse/ecs-web-app/aws"
version = "2.5.0"
}
plain text: /constructs/tfmod-cloudposse-ecs-web-app-aws/install.txt
⭐ Source on GitHub 📦 Registry page
README

A Terraform module which implements a web app on ECS and supporting AWS resources. > [!TIP] > #### 👽 Use Atmos with Terraform > Cloud Posse uses atmos to easily orchestrate multiple environments using Terraform. > Works with Github Actions, Atlantis, or Spacelift. > > > Watch demo of using Atmos with Terraform > > Example of running atmos to manage infrastructure from our Quick Start tutorial. > Usage For a complete example, see examples/complete. For automated tests of the complete example using bats and Terratest (which test and deploy the example on AWS), see test. Other examples: - without authentication - without authentication - with Google OIDC authentication - with Google OIDC authentication - with Cognito authentication - with Cognito authentication ``` module "default_backend_web

Inputs (50)
NameTypeDescriptionDefault
ecs_cluster_arnstringThe ECS Cluster ARN where ECS Service will be provisioned required
ecr_scan_images_on_pushboolIndicates whether images are scanned after being pushed to the repository (true)false
container_start_timeoutnumberTime duration (in seconds) to wait before giving up on resolving dependencies fo30
alb_ingress_health_check_intervalnumberThe duration in seconds in between health checks15
alb_ingress_health_check_timeoutnumberThe amount of time to wait in seconds before failing a health check request10
ecs_alarms_cpu_utilization_high_alarm_actionslist(string)A list of ARNs (i.e. SNS Topic ARN) to notify on CPU Utilization High Alarm acti[]
ecs_alarms_memory_utilization_low_ok_actionslist(string)A list of ARNs (i.e. SNS Topic ARN) to notify on Memory Utilization Low OK actio[]
ecs_security_group_idslist(string)Additional Security Group IDs to allow into ECS Service if `var.network_mode = "[]
authentication_oidc_user_info_endpointstringOIDC User Info Endpoint""
attributeslist(string)ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`, []
container_imagestringThe default container image to use in container definition"cloudposse/default-backend"
ecr_enable_default_lifecycle_policyboolEnable default lifecycle policy for the ECR repositorytrue
alb_ingress_listener_authenticated_prioritynumberThe priority for the rules with authentication, between 1 and 50000 (1 being hig300
init_containerslist(object({ container_deA list of additional init containers to start. The map contains the container_de[]
container_repo_credentialsmap(string)Container repository credentials; required when using a private repo. This map cnull
alb_ingress_listener_unauthenticated_prioritynumberThe priority for the rules without authentication, between 1 and 50000 (1 being 1000
alb_ingress_authenticated_pathslist(string)Authenticated path pattern to match (a maximum of 1 can be defined)[]
alb_stickiness_cookie_durationnumberThe time period, in seconds, during which requests from a client should be route86400
authentication_cognito_scopestringCognito scope, which should be a space separated string of requested scopes (seenull
ignore_changes_desired_countboolWhether to ignore changes for desired count in the ECS servicefalse
map_container_environmentmap(string)The environment variables to pass to the container. This is a map of string: {kenull
… and 10 more inputs
Outputs (50)
alb_ingress_target_group_arn_suffix — ALB Target Group ARN suffix
ecs_service_role_arn — ECS Service role ARN
codepipeline_id — CodePipeline ID
ecs_alarms_cpu_utilization_high_cloudwatch_metric_alarm_arn — ECS CPU utilization high CloudWatch metric alarm ARN
ecs_alarms_memory_utilization_low_cloudwatch_metric_alarm_arn — ECS Memory utilization low CloudWatch metric alarm ARN
ecr_repository_name — Registry name
ecs_cloudwatch_autoscaling — All outputs from `module.ecs_cloudwatch_autoscaling`
ecr_repository_arn — ARN of ECR repository
codepipeline_webhook_id — The CodePipeline webhook's ID
ecs_alarms_memory_utilization_high_cloudwatch_metric_alarm_id — ECS Memory utilization high CloudWatch metric alarm ID
target_response_time_average_cloudwatch_metric_alarm_arn — ALB Target Group response time average CloudWatch metric alarm ARN
ecr — All outputs from `module.ecr`
ecs_exec_role_policy_name — ECS service role name
ecs_task_role_name — ECS Task role name
ecs_exec_role_policy_id — The ECS service role policy ID, in the form of `role_name:role_policy_name`
alb_ingress_target_group_arn — ALB Target Group ARN
httpcode_target_3xx_count_cloudwatch_metric_alarm_id — ALB Target Group 3xx count CloudWatch metric alarm ID
ecs_service_security_group_id — Security Group ID of the ECS task
httpcode_elb_5xx_count_cloudwatch_metric_alarm_id — ALB 5xx count CloudWatch metric alarm ID
target_response_time_average_cloudwatch_metric_alarm_id — ALB Target Group response time average CloudWatch metric alarm ID
ecr_repository_url — Repository URL
ecs_alb_service_task — All outputs from `module.ecs_alb_service_task`
ecs_task_definition_revision — ECS task definition revision
cloudwatch_log_group — All outputs from `aws_cloudwatch_log_group.app`
ecs_cloudwatch_autoscaling_scale_up_policy_arn — ARN of the scale up policy
httpcode_target_4xx_count_cloudwatch_metric_alarm_arn — ALB Target Group 4xx count CloudWatch metric alarm ARN
httpcode_elb_5xx_count_cloudwatch_metric_alarm_arn — ALB 5xx count CloudWatch metric alarm ARN
ecs_task_exec_role_name — ECS Task role name
codebuild_project_id — CodeBuild project ID
codepipeline_webhook_url — The CodePipeline webhook's URL. POST events to this endpoint to trigger the target
… and 20 more outputs
Resources (1)
aws_cloudwatch_log_group
Details
FrameworkTerraform Module
LanguageHCL
Version2.5.0
Cloud AWS
★ Stars257
Forks151
Total downloads217.1k
Inputs50
Outputs50
Resources1
Examples4
LicenseApache-2.0
Namespacecloudposse
Updated