Create a ECS (fargate) service following Luscii standards
module "lb_service" {
}
module "sc_service" {
}
Name | Version |
---|---|
terraform | >= 1.3 |
aws | >= 4.9 |
Name | Version |
---|---|
aws | 5.99.1 |
Name | Source | Version |
---|---|---|
autoscaling_label | cloudposse/label/null | 0.25.0 |
autoscaling_scheduled_label | cloudposse/label/null | 0.25.0 |
autoscaling_target_tracking_label | cloudposse/label/null | 0.25.0 |
container_definitions | cloudposse/ecs-container-definition/aws | 0.61.2 |
label | cloudposse/label/null | 0.25.0 |
Name | Type |
---|---|
aws_appautoscaling_policy.target | resource |
aws_appautoscaling_scheduled_action.this | resource |
aws_appautoscaling_target.this | resource |
aws_ecs_service.this | resource |
aws_ecs_task_definition.this | resource |
aws_iam_role_policy.execution_pull_cache | resource |
aws_iam_role_policy.task_ecs_exec | resource |
aws_iam_role_policy_attachment.execution_ecr_public | resource |
aws_iam_role_policy_attachment.execution_ecs_task | resource |
aws_iam_role_policy_attachment.task_xray_daemon | resource |
aws_security_group.this | resource |
aws_caller_identity.current | data source |
aws_ecr_pull_through_cache_rule.this | data source |
aws_ecs_cluster.this | data source |
aws_iam_policy_document.execution_pull_cache | data source |
aws_iam_policy_document.task_ecs_exec | data source |
aws_region.current | data source |
aws_secretsmanager_secret.pull_through_cache_credentials | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
add_xray_container | Whether to add the xray daemon container to the task definition | bool |
true |
no |
assign_public_ip | Whether the service needs a public ip | bool |
false |
no |
container_definitions | List of container definitions, accepts the inputs of the module https://github.com/cloudposse/terraform-aws-ecs-container-definition | list(object({ |
n/a | yes |
context | Single object for setting entire context at once. See description of individual variables for details. Leave string and numeric variables as null to use default value.Individual variable settings (non-null) override settings in context object, except for attributes, tags, and additional_tag_map, which are merged. |
any |
{ |
no |
desired_count | Desired number of tasks that need to be running for the service | number |
1 |
no |
ecs_cluster_name | Name of the ECS cluster in which the service is deployed | string |
n/a | yes |
egress_rules | Egress rules for the default security group for the service | list(object({ |
[] |
no |
enable_ecs_execute_command | Enables ECS exec to the service and attaches required IAM policy to task role | bool |
false |
no |
execution_role | IAM Role used as the execution role | object({ |
n/a | yes |
force_new_deployment | Whether to force a new deployment of the service. This can be used to update the service with a new task definition | bool |
false |
no |
high_traffic_service | Whether the service is a high traffic service: >500 requests/second | bool |
false |
no |
ingress_rules | Ingress rules for the default security group for the service | list(object({ |
[] |
no |
load_balancers | List of load balancers to attach to the service | list(object({ |
[] |
no |
name | Name of the ECS service | string |
n/a | yes |
platform_version | Platform version for the ECS service | string |
"LATEST" |
no |
scaling | Scaling configuration for the service. Enables scaling | object({ |
null |
no |
scaling_scheduled | Scheduled scaling policies for the service. Enables Scheduled scaling | map(object({ |
null |
no |
scaling_target | Target tracking scaling policies for the service. Enables Target tracking scaling. Predefined metric type must be one of ECSServiceAverageCPUUtilization, ALBRequestCountPerTarget or ECSServiceAverageMemoryUtilization - https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PredefinedMetricSpecification.html | map(object({ |
null |
no |
security_group_ids | List of additional security groups to attach to the service | list(string) |
[] |
no |
service_connect_configuration | Service discovery configuration for the service | object({ |
null |
no |
subnets | List of Subnet ids in which the Service runs | list(string) |
n/a | yes |
task_cpu | value in cpu units for the task | number |
n/a | yes |
task_memory | value in MiB for the task | number |
n/a | yes |
task_role | IAM Role used as the task role | object({ |
n/a | yes |
vpc_id | ID of the VPC in which the service is deployed | string |
n/a | yes |
xray_container_image | The xray daemon container image | string |
"amazon/aws-xray-daemon:3.x" |
no |
Name | Description |
---|---|
cluster_arn | The ARN of the ECS cluster |
cluster_name | The name of the ECS cluster |
label_context | Context of the label for subsequent use |
scaling_target | The autoscaling target resource - https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appautoscaling_target |
security_group_arn | The ARN of the security group |
security_group_id | The ID of the security group |
service_arn | The ARN of the service |
service_discovery_client_aliases | The service discovery client aliases for the service |
service_discovery_internal_url | Base URL for the service internally |
service_discovery_name | The service discovery name for the service |
service_id | The ID of the service |
service_name | The name of the service |
task_definition_arn | The ARN of the task definition |
task_definition_family | The family of the task definition |
task_definition_id | The ID of the task definition |