mirror of
https://github.com/floci-io/floci.git
synced 2026-12-03 02:07:58 -05:00
fix(cloudformation): a dropped Properties block replaces a resource with a create-only value (#8438)
A template update that drops a resource's whole Properties block now counts as removing every property in it, so a create-only value that was there means Replacement: True and a replaced resource, as removing that property alone already does. The change set said no replacement, so a provisioner that follows the engine kept the resource under its old name. PropertyChanges reads a dropped block the same way when it has no engine answer. Part of #6606
This commit is contained in:
1 parent
0de78cafb1
commit
9c1e5c1163
4 files changed
+20
-4
No files matched your search
@@ -159,6 +159,11 @@ class CfnReplacementIntegrationTest {
|
||||
namedByCondition(S3_TYPE, "BucketName", "repl-s3-if", "[\"x\", \"x\"]"),
|
||||
namedByCondition(S3_TYPE, "BucketName", "repl-s3-if", "[\"x\", \"y\"]"),
|
||||
"Subject", "True", true, null),
|
||||
new Row("log group whose whole Properties block is dropped",
|
||||
"{\"Resources\": {\"Subject\": {\"Type\": \"AWS::Logs::LogGroup\","
|
||||
+ " \"Properties\": {\"LogGroupName\": \"repl-dropped-properties\"}}}}",
|
||||
"{\"Resources\": {\"Subject\": {\"Type\": \"AWS::Logs::LogGroup\"}}}",
|
||||
"Subject", "True", true, null),
|
||||
new Row("deployed parameter renamed, same value",
|
||||
locationStack(stringParameter("NameA", HOSTED), "", REF_A, "d"),
|
||||
locationStack(stringParameter("NameB", HOSTED), "", REF_B, "e"),
|
||||
|
||||
+2
@@ -20,6 +20,8 @@ class PropertyChangesReplacementTest {
|
||||
assertTrue(between("{\"Name\":\"a.example.\"}", "{\"Name\":\"b.example.\"}").requiresReplacement());
|
||||
assertTrue(between("{\"Name\":\"a.example.\",\"DelegationSetId\":\"N1\"}",
|
||||
"{\"Name\":\"a.example.\"}").requiresReplacement());
|
||||
assertTrue(PropertyChanges.between(TYPE, true, MAPPER.readTree("{\"Name\":\"a.example.\"}"), null)
|
||||
.requiresReplacement());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in new issue
Block a user