ecs-app

hazelops/ecs-app/aws

Terraform Module HCL AWS

Terraform module to create and manage AWS ECS application.

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

Terraform AWS ECS App Module ![e2e tests](https://github.com/hazelops/terraform-aws-ecs-app/actions/workflows/run.e2e-tests.yml) Create and manage AWS ECS application in a clean abstracted way. > [!WARNING] > This module requires AWS provider version 6.x or higher. This module is actively maintained and is covered by multiple end-to-end tests to prevent regressions. Features _This module is feature-rich, with sane defaults. Some of the features are:_ - Web application (ALB + ACM + R53) - Worker application to Fargate and Worker application to EC2 (no ALB) - TCP application (no ALB) - Environment variables (SSM parameters) - ECR repo Management - Standardized naming convention for all resources - Deployment via Terraform & via external tool (ecs-deploy or ize) - Datadog integration - Autosc

Inputs (50)
NameTypeDescriptionDefault
ecs_cluster_namestringName of the ECS cluster where the service will be deployed. Required required
namestringApplication name. Used as the primary identifier for all created resources (e.g. required
vpc_idstringID of the VPC where ECS resources will be created. Required required
envstringEnvironment name (dev, prod) required
docker_registrystringECR or any other docker registry"docker.io"
proxy_docker_image_namestringNginx proxy docker image name"nginx"
max_sizenumberMaximum number of running ECS tasks1
efs_access_pointsanyEFS access points - map of access point definitions. See terraform-aws-modules/e{}
ssm_secret_pathstringAWS SSM root path to environment secrets of an app like /dev/app1null
alb_health_check_timeoutnumberThe amount of time, in seconds, during which no response means a failed health c6
ecr_force_deleteboolIf true, the ECR repository will be deleted even if it contains images on destrofalse
image_idstringEC2 AMI idnull
sns_service_subscription_endpoint_protocolstringSNS subscription protocol. See valid protocols here: https://registry.terraform."email"
ecs_network_modestringCorresponds to networkMode in an ECS task definition. Supported values are none,"awsvpc"
https_enabledboolWhether enable https or not (still needs tls_cert_arn)true
http_portnumberPort that is used for HTTP protocol80
alb_access_logs_s3prefixstringS3 prefix for ALB access logs""
app_typestringECS application type. Valid values: web (with ALB), worker (without ALB)."web"
ssm_global_secret_pathstringAWS SSM root path to global environment secrets like /dev/globalnull
assign_public_ipboolECS service network configuration - assign public IPfalse
datadog_jmx_enabledboolEnables / Disables jmx monitor via the datadog agentfalse
ecs_service_namestringThe ECS service name""
app_secretslist(any)List of SSM ParameterStore secret parameters - by default, /$var.env/$var.name/*[]
docker_container_portnumberPort exposed by the Docker container. Default is 30003000
… and 10 more inputs
Outputs (12)
cloudwatch_log_group
cloudwatch_event_rule_id — ID of the Cloudwatch event rule for ECS Scheduled Task
alb_dns_zone — Zone ID of the ALB DNS record (if ALB is created)
alb_arn — ARN of the ALB (if ALB is created)
public_ip — Public IP of the EC2 instance (if EC2 is used)
ec2_dns_name — Public DNS name of the EC2 instance (if EC2 is used)
r53_lb_dns_name — DNS name of the record that is attached to the ALB (if app type is web or tcp-ap)
this_task_definition_arn
alb_dns_name — Name of the ALB DNS record (if ALB is created)
efs_mount_target — DNS name of the EFS mount target (if EFS is created)
eips — List of EIPs associated with the EC2 instances (if EC2 is used)
this_target_group_arn
Resources (3)
aws_eipaws_iam_role_policyaws_route53_record
Details
FrameworkTerraform Module
LanguageHCL
Version3.1.0
Cloud AWS
★ Stars3
Forks2
Total downloads17.1k
Inputs50
Outputs12
Resources3
Examples8
Submodules2
LicenseApache-2.0
Namespacehazelops
Updated