Skip to content

avidhara/terraform-aws-ecs

Repository files navigation

Terraform Module for ECS Cluster

Requirements

Name Version
terraform >= 1.3.2
aws >= 5.40

Providers

Name Version
aws >= 5.40

Modules

No modules.

Resources

Name Type
aws_ecs_cluster.this resource
aws_ecs_cluster_capacity_providers.example resource
aws_iam_policy.task_exec resource
aws_iam_role.task_exec resource
aws_iam_role_policy_attachment.task_exec resource
aws_iam_role_policy_attachment.task_exec_managed resource
aws_iam_policy_document.task_exec data source
aws_iam_policy_document.task_exec_assume data source

Inputs

Name Description Type Default Required
capacity_providers (Optional) Set of names of one or more capacity providers to associate with the cluster. Valid values also include FARGATE and FARGATE_SPOT. list(string)
[
"FARGATE"
]
no
configuration (Optional) The details of the execute command configuration. Detailed below.
- execute_command_configuration - (Optional) The details of the execute command configuration. Detailed below.
- kms_key_id - (Optional) The KMS key that the Amazon ECS container agent uses to encrypt the data between the local agent and the Amazon ECS service. If the key is not specified, the data is encrypted using the Amazon ECS-Managed encryption key. If a key is specified, the other settings in the execute_command_configuration block are required.
- logging - (Optional) The log configuration for the execute command configuration. Detailed below.
- log_configuration - (Optional) The log configuration for the execute command configuration. Detailed below.
- cloud_watch_encryption_enabled - (Optional) Whether or not to enable encryption on the CloudWatch logs. Default is false.
- cloud_watch_log_group_name - (Optional) The name of the CloudWatch log group to send logs to.
- s3_bucket_name - (Optional) The name of the S3 bucket to send logs to.
- s3_bucket_encryption_enabled - (Optional) Whether or not to enable encryption on the S3 bucket. Default is false.
- s3_key_prefix - (Optional) The prefix to use when storing logs in the S3 bucket.
list(object({
execute_command_configuration = object({
kms_key_id = optional(string)
logging = optional(string)
log_configuration = optional(object({
cloud_watch_encryption_enabled = optional(bool)
cloud_watch_log_group_name = optional(string)
s3_bucket_name = optional(string)
s3_bucket_encryption_enabled = optional(bool)
s3_key_prefix = optional(string)
}))
})
}))
[] no
create (Optional) Whether to create the ECS cluster (if set to false, it will only create a service and task definition) bool true no
default_capacity_provider_strategy (Optional) The default capacity provider strategy for the cluster. The default capacity provider strategy is used when services or tasks are run without a specified launch type or capacity provider strategy. Detailed below.
- base - (Optional) The base value designates how many tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined.
- weight - (Optional) The weight value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider. The weight value is taken into consideration after the base value, if defined, is satisfied.
- capacity_provider - (Required) The short name of the capacity provider.
list(object({
base = optional(number)
weight = optional(number)
capacity_provider = string
}))
[] no
name (Required) Name of the cluster (up to 255 letters, numbers, hyphens, and underscores) string n/a yes
service_connect_defaults (Required) The ARN of the aws_service_discovery_http_namespace that's used when you create a service and don't specify a Service Connect configuration."
- namespace - (Required) The ARN of the aws_service_discovery_http_namespace that's used when you create a service and don't specify a Service Connect configuration.
list(object({
namespace = string
}))
[] no
setting (Optional) The settings to use when creating the cluster. Detailed below.
- name - (Required) The name of the setting.
- value - (Required) The value of the setting.
list(object({
name = string
value = string
}))
[
{
"name": "containerInsights",
"value": "enabled"
}
]
no
tags (Optional) Key-value mapping of resource tags map(string) {} no

Outputs

Name Description
arn ARN that identifies the cluster
id ARN that identifies the cluster

About

Terraform Module for AWS ECS Cluster

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages