ecs-alb-service-task

cloudposse/ecs-alb-service-task/aws

Terraform Module HCL AWS

Terraform module which implements an ECS service which exposes a web service via ALB.

Install
module "ecs-alb-service-task" {
source = "cloudposse/ecs-alb-service-task/aws"
version = "0.78.0"
}
⭐ Source on GitHub 📦 Registry page
README

Terraform module to create an ECS Service for a web app (task), and an ALB target group to route requests. > [!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 test of the complete example using bats and Terratest, see test. ```hcl provider "aws" { region = var.region } module "label" { source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.15.0" namespace = var.namespace name = var.name stage = var.stage delimiter = var.delimiter attribute

Inputs (50)
NameTypeDescriptionDefault
container_definition_jsonstringA string containing a JSON-encoded array of container definitions (`"[{ "name": required
vpc_idstringThe VPC ID where resources are created required
enable_all_egress_ruleboolA flag to enable/disable adding the all ports egress rule to the service securittrue
task_memorynumberThe amount of memory (in MiB) used by the task. If using Fargate launch type `ta512
availability_zone_rebalancingstringECS automatically redistributes tasks within a service across Availability Zones"DISABLED"
efs_volumeslist(object({ host_path = Task EFS volume definitions as list of configuration objects. You can define mul[]
exec_enabledboolSpecifies whether to enable Amazon ECS Exec for the tasks within the servicefalse
ipc_modestringThe IPC resource namespace to be used for the containers in the task. The valid null
environmentstringID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'stnull
label_orderlist(string)The order in which the labels (ID elements) appear in the `id`. Defaults to ["nanull
task_policy_arnslist(string)A list of IAM Policy ARNs to attach to the generated task role. Changes to the l[]
role_tags_enabledboolWhether or not to create tags on ECS rolestrue
contextanySingle object for setting entire context at once. See description of individual { "additional_tag_map": {}, "attribu
deployment_minimum_healthy_percentnumberThe lower limit (as a percentage of `desired_count`) of the number of tasks that100
redeploy_on_applyboolUpdates the service to the latest task definition on each applyfalse
nlb_container_portnumberThe port on the container to allow traffic from the NLB80
service_role_arnstringARN of the IAM role that allows Amazon ECS to make calls to your load balancer onull
ignore_changes_task_definitionboolWhether to ignore changes in container definition and task definition in the ECStrue
propagate_tagsstringSpecifies whether to propagate the tags from the task definition or the service null
additional_tag_mapmap(string)Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not add{}
security_group_descriptionstringThe description to assign to the service security group. Warning: Changing the d"Allow ALL egress from ECS service"
network_modestringThe network mode to use for the task. This is required to be `awsvpc` for `FARGA"awsvpc"
… and 10 more inputs
Outputs (16)
ecs_exec_role_policy_id — The ECS service role policy ID, in the form of `role_name:role_policy_name`
ecs_exec_role_policy_name — ECS service role name
service_arn — ECS Service ARN
task_exec_role_name — ECS Task role name
task_definition_family — ECS task definition family
service_name — ECS Service name
service_role_arn — ECS Service role ARN
task_role_name — ECS Task role name
task_definition_arn — ECS task definition ARN
task_definition_arn_without_revision — ECS task definition ARN without revision
task_exec_role_arn — ECS Task exec role ARN
task_exec_role_id — ECS Task exec role id
task_role_arn — ECS Task role ARN
task_role_id — ECS Task role id
service_security_group_id — Security Group ID of the ECS task
task_definition_revision — ECS task definition revision
Resources (7)
aws_ecs_serviceaws_ecs_task_definitionaws_iam_roleaws_iam_role_policyaws_iam_role_policy_attachmentaws_security_groupaws_security_group_rule
Details
FrameworkTerraform Module
LanguageHCL
Version0.78.0
Cloud AWS
★ Stars161
Forks198
Total downloads4.3M
Inputs50
Outputs16
Resources7
Examples1
LicenseApache-2.0
Namespacecloudposse
Updated