Skip to content

cn-terraform/terraform-aws-ecs-cluster

Repository files navigation

AWS ECS Cluster Terraform Module

This Terraform module creates an AWS ECS cluster.

Usage

Check valid versions on:

Install pre commit hooks.

Pleas run this command right after cloning the repository.

    pre-commit install

For that you may need to install the folowwing tools:

In order to run all checks at any point run the following command:

    pre-commit run --all-files

Requirements

Name Version
terraform >= 0.13
aws >= 4

Providers

Name Version
aws 5.15.0

Modules

No modules.

Resources

Name Type
aws_ecs_cluster.cluster resource

Inputs

Name Description Type Default Required
configuration (Optional) The execute command configuration for the cluster.
object({
# The details of the execute command configuration.
execute_command_configuration = object({
# The AWS Key Management Service key ID to encrypt the data between the local client and the container.
kms_key_id = optional(string)
# The log configuration for the results of the execute command actions Required when logging is OVERRIDE.
log_configuration = object({
# Whether or not to enable encryption on the CloudWatch logs. If not specified, encryption will be disabled.
cloud_watch_encryption_enabled = optional(bool)
# The name of the CloudWatch log group to send logs to.
cloud_watch_log_group_name = optional(string)
# The name of the S3 bucket to send logs to.
s3_bucket_name = optional(string)
# Whether or not to enable encryption on the logs sent to S3. If not specified, encryption will be disabled.
s3_bucket_encryption_enabled = optional(bool)
# An optional folder in the S3 bucket to place logs in.
s3_key_prefix = optional(string)
})
# The log setting to use for redirecting logs for your execute command results. Valid values are NONE, DEFAULT, and OVERRIDE.
logging = optional(string)
})
})
null no
containerInsights (Optional) Enables container insights if true bool false no
name (Required) Name of the cluster (up to 255 letters, numbers, hyphens, and underscores). any n/a yes
service_connect_defaults (Optional) Configures a default Service Connect namespace.
object({
# 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 = string
})
null no
tags Resource tags map(string) {} no

Outputs

Name Description
aws_ecs_cluster_cluster_arn The Amazon Resource Name (ARN) that identifies the cluster
aws_ecs_cluster_cluster_id The Amazon ID that identifies the cluster
aws_ecs_cluster_cluster_name The name of the cluster