Module library

ECS

Terraform module to create AWS ECS resources

Version
Submodules
clustercontainer-definitionexpress-serviceservice

Inputs

40 / 60
capacity_providersoptionalmap(object({ auto_scaling_group_provider = optional(object({ auto_scaling_group_…

Map of capacity provider definitions to create for the cluster

Defaultnull
cloudwatch_log_group_classoptionalstring

Specified the log class of the log group. Possible values are: `STANDARD` or `INFREQUENT_ACCESS`

Defaultnull
cloudwatch_log_group_kms_key_idoptionalstring

If a KMS Key ARN is set, this key will be used to encrypt the corresponding log group. Please be sure that the KMS Key has an appropriate key policy (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html)

Defaultnull
cloudwatch_log_group_nameoptionalstring

Custom name of CloudWatch Log Group for ECS cluster

Defaultnull
cloudwatch_log_group_retention_in_daysoptionalnumber

Number of days to retain log events

Default90
cloudwatch_log_group_tagsoptionalmap(string)

A map of additional tags to add to the log group created

Default{}
cluster_capacity_providersoptionallist(string)

List of capacity provider names to associate with the ECS cluster. Note: any capacity providers created by this module will be automatically added

Default[]
cluster_configurationoptionalobject({ execute_command_configuration = optional(object({ kms_key_id = optional…

The execute command configuration for the cluster

Default{…}
cluster_nameoptionalstring

Name of the cluster (up to 255 letters, numbers, hyphens, and underscores)

Default""
cluster_service_connect_defaultsoptionalobject({ namespace = string })

Configures a default Service Connect namespace

Defaultnull
cluster_settingoptionallist(object({ name = string value = string }))

List of configuration block(s) with cluster settings. For example, this can be used to enable CloudWatch Container Insights for a cluster

Default[…]
cluster_tagsoptionalmap(string)

A map of additional tags to add to the cluster

Default{}
createoptionalbool

Determines whether resources will be created (affects all resources)

Defaulttrue
create_cloudwatch_log_groupoptionalbool

Determines whether a log group is created by this module for the cluster logs. If not, AWS will automatically create one if logging is enabled

Defaulttrue
create_infrastructure_iam_roleoptionalbool

Determines whether the ECS infrastructure IAM role should be created

Defaulttrue
create_node_iam_instance_profileoptionalbool

Determines whether an IAM instance profile is created or to use an existing IAM instance profile

Defaulttrue
create_security_groupoptionalbool

Determines if a security group is created

Defaulttrue
create_task_exec_iam_roleoptionalbool

Determines whether the ECS task definition IAM role should be created

Defaultfalse
create_task_exec_policyoptionalbool

Determines whether the ECS task definition IAM policy should be created. This includes permissions included in AmazonECSTaskExecutionRolePolicy as well as access to secrets and SSM parameters

Defaulttrue
default_capacity_provider_strategyoptionalmap(object({ base = optional(number) name = optional(string) # Will fall back to…

Map of default capacity provider strategy definitions to use for the cluster

Defaultnull
disable_v7_default_name_descriptionoptionalbool

[DEPRECATED - will be removed in v8.0] Determines whether to disable the default postfix added to resource names and descriptions added in v7.0

Defaultfalse
infrastructure_iam_role_descriptionoptionalstring

Description of the role

Defaultnull
infrastructure_iam_role_nameoptionalstring

Name to use on IAM role created

Defaultnull
infrastructure_iam_role_override_policy_documentsoptionallist(string)

List of IAM policy documents that are merged together into the exported document. In merging, statements with non-blank `sid`s will override statements with the same `sid`

Default[]
infrastructure_iam_role_pathoptionalstring

IAM role path

Defaultnull
infrastructure_iam_role_permissions_boundaryoptionalstring

ARN of the policy that is used to set the permissions boundary for the IAM role

Defaultnull
infrastructure_iam_role_source_policy_documentsoptionallist(string)

List of IAM policy documents that are merged together into the exported document. Statements must have unique `sid`s

Default[]
infrastructure_iam_role_statementsoptionalmap(object({ sid = optional(string) actions = optional(list(string)) not_actions…

A map of IAM policy [statements](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document#statement) for custom permission usage

Defaultnull
infrastructure_iam_role_tagsoptionalmap(string)

A map of additional tags to add to the IAM role created

Default{}
infrastructure_iam_role_use_name_prefixoptionalbool

Determines whether the IAM role name (`iam_role_name`) is used as a prefix

Defaulttrue
node_iam_role_additional_policiesoptionalmap(string)

Additional policies to be added to the IAM role

Default{}
node_iam_role_descriptionoptionalstring

Description of the role

DefaultECS Managed Instances node IAM role
node_iam_role_nameoptionalstring

Name to use on IAM role/instance profile created

Defaultnull
node_iam_role_override_policy_documentsoptionallist(string)

List of IAM policy documents that are merged together into the exported document. In merging, statements with non-blank `sid`s will override statements with the same `sid`

Default[]
node_iam_role_pathoptionalstring

IAM role/instance profile path

Defaultnull
node_iam_role_permissions_boundaryoptionalstring

ARN of the policy that is used to set the permissions boundary for the IAM role

Defaultnull
node_iam_role_source_policy_documentsoptionallist(string)

List of IAM policy documents that are merged together into the exported document. Statements must have unique `sid`s

Default[]
node_iam_role_statementsoptionalmap(object({ sid = optional(string) actions = optional(list(string)) not_actions…

A map of IAM policy [statements](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document#statement) for custom permission usage

Defaultnull
node_iam_role_tagsoptionalmap(string)

A map of additional tags to add to the IAM role/instance profile created

Default{}
node_iam_role_use_name_prefixoptionalbool

Determines whether the IAM role/instance profile name (`node_iam_role_name`) is used as a prefix

Defaulttrue

All 60 are optional — the module deploys with none of them set. Showing 40, so the site stays a static download — the remaining 20 are in the source.

Outputs

20
capacity_providers

Map of autoscaling capacity providers created and their attributes

cloudwatch_log_group_arn

ARN of CloudWatch log group created

cloudwatch_log_group_name

Name of CloudWatch log group created

cluster_arn

ARN that identifies the cluster

cluster_capacity_providers

Map of cluster capacity providers attributes

cluster_id

ID that identifies the cluster

cluster_name

Name that identifies the cluster

infrastructure_iam_role_arn

The Amazon Resource Name (ARN) specifying the IAM role

infrastructure_iam_role_name

IAM role name

infrastructure_iam_role_unique_id

Stable and unique string identifying the IAM role

node_iam_instance_profile_arn

ARN assigned by AWS to the instance profile

node_iam_instance_profile_id

Instance profile's ID

node_iam_instance_profile_unique

Stable and unique string identifying the IAM instance profile

node_iam_role_arn

The Amazon Resource Name (ARN) specifying the IAM role

node_iam_role_name

IAM role name

node_iam_role_unique_id

Stable and unique string identifying the IAM role

services

Map of services created and their attributes

task_exec_iam_role_arn

Task execution IAM role ARN

task_exec_iam_role_name

Task execution IAM role name

task_exec_iam_role_unique_id

Stable and unique string identifying the task execution IAM role

What the agent wires into the next module. An edge on the architecture diagram is one of these consumed by something else.