Skip to content

Commit

Permalink
provider/aws: Fix issue with ECS Placement Strat. and type casing
Browse files Browse the repository at this point in the history
The API asks you to send lower case values, but returns uppercase ones.
Here we lowercase the returned API values.

There is no migration here because the field in question is nested in a
set, so the hash will change regardless. Anyone using this feature now
has it broken anyway.
  • Loading branch information
catsby committed Jan 31, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 2313281 commit 7e9bfda
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion builtin/providers/aws/resource_aws_ecs_service.go
Original file line number Diff line number Diff line change
@@ -357,7 +357,7 @@ func flattenPlacementStrategy(pss []*ecs.PlacementStrategy) []map[string]interfa
for _, ps := range pss {
c := make(map[string]interface{})
c["type"] = *ps.Type
c["field"] = *ps.Field
c["field"] = strings.ToLower(*ps.Field)
results = append(results, c)
}
return results
2 changes: 1 addition & 1 deletion builtin/providers/aws/resource_aws_ecs_service_test.go
Original file line number Diff line number Diff line change
@@ -445,7 +445,7 @@ resource "aws_ecs_service" "mongo" {
desired_count = 1
placement_strategy {
type = "binpack"
field = "MEMORY"
field = "memory"
}
}
`

0 comments on commit 7e9bfda

Please sign in to comment.