Skip to content

Commit

Permalink
Move capacity_provider_strategy to the service from the cluster
Browse files Browse the repository at this point in the history
If it is defined on the cluster, it will cause drift and the service
will be recreated each time:
hashicorp/terraform-provider-aws#11351
  • Loading branch information
emileswarts committed Sep 3, 2020
1 parent 5b31de9 commit d5460c2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/dns_dhcp_common/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ resource "aws_ecs_cluster" "server_cluster" {
aws_ecs_capacity_provider.capacity_provider.name
]

default_capacity_provider_strategy {
capacity_provider = aws_ecs_capacity_provider.capacity_provider.name
weight = 1
}

setting {
name = "containerInsights"
value = "enabled"
Expand Down Expand Up @@ -38,6 +33,11 @@ resource "aws_ecs_service" "service" {
task_definition = var.task_definition_arn
desired_count = "2"

capacity_provider_strategy {
capacity_provider = aws_ecs_capacity_provider.capacity_provider.name
weight = 100
}

ordered_placement_strategy {
type = "binpack"
field = "cpu"
Expand Down

0 comments on commit d5460c2

Please sign in to comment.