ecs-cluster
Provides an ECS cluster, and optionally EC2 container instances.
Example Usage
A Fargate cluster
module "service_name" {
source = "git@github.com:techservicesillinois/terraform-aws-ecs-cluster"
name = "identity"
enable_ec2_container_instances = false
}
Argument Reference
The following arguments are supported:
-
name
- (Required) The name of the Amazon ECS cluster to create. -
enable_ec2_container_instances
- (Optional) Set to false for Fargate only clusters (default true). -
iam_instance_profile
- (Optional) The IAM instance profile to associate with the ECS container instances (default ecsInstanceRole). -
min
- (Optional) The minimum number of ECS container instances (default 1). -
max
- (Optional) The maximum number of ECS container instances (default 10). -
desired
- (Optional) The desired number ECS of container instances (default 3). -
efs_volume_name
- (Optional) EFS volume name. -
associate_public_ip_address
- (Optional) Associate a public ip address with the ECS container instances (default true). -
instance_type
- (Optional) The EC2 instance type to use for the container instances (default t2.micro). -
key_name
- (Optional) Name of an AWS key pair to use for the container instances. -
vpc
- (Optional) The name of the VPC to use. -
subnet_ids
- (Optional) A list of subnet ids to use for the container instances. -
template
- (Optional) Template used to configure underlying EC2 instances. -
tier
- (Optional) Name of subnet tier (e.g., public, private, nat). -
ssh_cidr_blocks
- (Optional) List of CIDR blocks to use for SSH access. -
tags
- (Optional) A mapping of tags to assign to all resources that support tagging. -
ingress_security_group_ids
- (Optional) A list of security group id(s) that can directly communicate with containers. -
ingress_security_groups
- (Optional) A list of security group name(s) that can directly communicate with containers. -
security_group_ids
- (Optional) A list of security group ID(s) associated with the EC2 container instances. -
security_groups
- (Optional) A list of security group name(s) associated with the EC2 container instances.
Attributes Reference
The following attributes are exported:
-
security_group_name
- The name of the default security group for the EC2 container instances. -
security_group_id
- The ARN of the default security group for the EC2 container instances. -
name
- The name that identifies the cluster -
id
- The Amazon Resource Name (ARN) that identifies the cluster