tflint-ruleset-aws icon indicating copy to clipboard operation
tflint-ruleset-aws copied to clipboard

ECS services: Cannot specify a launch_type and a capacity_provider_strategy

Open ziggythehamster opened this issue 2 years ago • 0 comments

It would be nice if the ruleset would check that an ECS service is not specifying both a launch_type and a capacity_provider_strategy because evidently this isn't allowed even if the launch type is set to EC2:

InvalidParameterException: Specifying both a launch type and capacity provider strategy is not supported. Remove one and try again.

GOOD:

resource "aws_ecs_service" "this" {
  launch_type = "EC2"

  # snip
}
resource "aws_ecs_service" "this" {

  # snip

  capacity_provider_strategy {
    capacity_provider = var.ecs_capacity_provider_name
    weight            = "10"
  }
}

BAD:

resource "aws_ecs_service" "this" {
  launch_type = "EC2"

  # snip

  capacity_provider_strategy {
    capacity_provider = var.ecs_capacity_provider_name
    weight            = "10"
  }
}

ziggythehamster avatar May 26 '22 02:05 ziggythehamster