module "ecs" {
source = "github.com/ministryofjustice/modernisation-platform-terraform-ecs/ecs"
subnet_set_name = local.subnet_set_name
vpc_id = local.vpc_id
app_name = local.application_name
container_instance_type = local.app_data.accounts[local.environment].container_instance_type
environment = local.environment
ami_image_id = local.app_data.accounts[local.environment].ami_image_id
instance_type = local.app_data.accounts[local.environment].instance_type
user_data = base64encode(data.template_file.launch-template.rendered)
key_name = local.app_data.accounts[local.environment].key_name
task_definition = data.template_file.task_definition.rendered
ec2_desired_capacity = local.app_data.accounts[local.environment].ec2_desired_capacity
ec2_max_size = local.app_data.accounts[local.environment].ec2_max_size
ec2_min_size = local.app_data.accounts[local.environment].ec2_min_size
container_cpu = local.app_data.accounts[local.environment].container_cpu
container_memory = local.app_data.accounts[local.environment].container_memory
task_definition_volume = local.app_data.accounts[local.environment].task_definition_volume
network_mode = local.app_data.accounts[local.environment].network_mode
server_port = local.app_data.accounts[local.environment].server_port
app_count = local.app_data.accounts[local.environment].app_count
public_cidrs = [data.aws_subnet.public_az_a.cidr_block, data.aws_subnet.public_az_b.cidr_block, data.aws_subnet.public_az_c.cidr_block]
tags_common = local.tags
depends_on = [aws_ecr_repository.ecr_repo, aws_lb_listener.listener]
}
Name | Version |
---|---|
terraform | >= 1.0.1 |
aws | ~> 4.0 |
Name | Version |
---|---|
aws | ~> 4.0 |
No modules.
Name | Description | Type | Default | Required |
---|---|---|---|---|
ami_image_id | EC2 AMI image to run in the ECS cluster | string |
n/a | yes |
app_count | Number of docker containers to run | string |
n/a | yes |
app_name | Name of the application | string |
n/a | yes |
appscaling_max_capacity | Maximum capacity of the application scaling target | number |
3 |
no |
appscaling_min_capacity | Minimum capacity of the application scaling target | number |
1 |
no |
container_cpu | Container instance CPU units to provision (1 vCPU = 1024 CPU units) | string |
n/a | yes |
container_instance_type | Container OS being used (windows or linux) | string |
n/a | yes |
container_memory | Container instance memory to provision (in MiB) | string |
n/a | yes |
ec2_desired_capacity | Number of EC2s in the cluster | string |
n/a | yes |
ec2_egress_rules | Security group egress rules for the cluster EC2s | map(object({ |
n/a | yes |
ec2_ingress_rules | Security group ingress rules for the cluster EC2s | map(object({ |
n/a | yes |
ec2_max_size | Max Number of EC2s in the cluster | string |
n/a | yes |
ec2_min_size | Min Number of EC2s in the cluster | string |
n/a | yes |
instance_type | EC2 instance type to run in the ECS cluster | string |
n/a | yes |
key_name | Key to access EC2s in ECS cluster | string |
n/a | yes |
lb_tg_name | Load balancer target group name used by ECS service | string |
n/a | yes |
network_mode | The network mode used for the containers in the task. If OS used is Windows network_mode must equal none. | string |
n/a | yes |
server_port | The port the containers will be listening on | string |
n/a | yes |
subnet_set_name | The name of the subnet set associated with the account | string |
n/a | yes |
tags_common | Common tags to be used by all resources | map(string) |
n/a | yes |
task_definition | Task definition to be used by the ECS service | string |
n/a | yes |
task_definition_volume | Name of the volume referenced in the sourceVolume parameter of container definition in the mountPoints section | string |
n/a | yes |
user_data | The configuration used when creating EC2s used for the ECS cluster | string |
n/a | yes |
vpc_id | The ID of the VPC used to create resources | string |
n/a | yes |
Name | Description |
---|---|
app_scale_down_policy_arn | ARN for app autoscaling - scaling policy down |
app_scale_up_policy_arn | ARN for app autoscaling - scaling policy up |
cluster_ec2_security_group_id | Security group id of EC2s used for ECS cluster |
current_task_definition | Displays task definition information and version being used |
ec2_autoscaling_group | Autoscaling group information |
ecs_service | Displays task definition information and version being used |
ecs_task_execution_policy | Displays task definition policy details |
ecs_task_execution_role | Displays task definition role details |
If you're looking to raise an issue with this module, please create a new issue in the Modernisation Platform repository.