Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/aws/structure_test.go b/aws/structure_test.go
index ab8c416a3..88a3218f8 100644
--- a/aws/structure_test.go
+++ b/aws/structure_test.go
@@ -1644,3 +1644,32 @@ func TestExpandRdsClusterScalingConfiguration_basic(t *testing.T) {
}
}
}
+
+func TestFlattenEcsContainerDefinitions_orderingIsIrrelevant(t *testing.T) {
+ expectedJson := `[{"environment":[{"name":"name1","value":"value1"},{"name":"name2","value":"value2"}],"image":"image","name":"name"}]`
+
+ testA := `[{
+ "name": "name",
+ "image": "image",
+ "environment": [
+ {"name":"name1", "value":"value1"},
+ {"name":"name2", "value":"value2"}
+ ]
+ }]`
+
+ testB := `[{
+ "name": "name",
+ "image": "image",
+ "environment": [
+ {"name":"name2", "value":"value2"},
+ {"name":"name1", "value":"value1"}
+ ]
+ }]`
+
+ for _, test := range []string{testA, testB} {
+ json := resourceAwsEcsTaskDefinition().Schema["container_definitions"].StateFunc(test)
+ if json != expectedJson {
+ t.Errorf("Case %s: Expected: %s, Got: %s", test, expectedJson, json)
+ }
+ }
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment