diff --git a/aws-cloudformation-hookdefaultversion/pom.xml b/aws-cloudformation-hookdefaultversion/pom.xml index a869647..e58b35c 100644 --- a/aws-cloudformation-hookdefaultversion/pom.xml +++ b/aws-cloudformation-hookdefaultversion/pom.xml @@ -35,7 +35,7 @@ software.amazon.cloudformation aws-cloudformation-rpdk-java-plugin - [2.0.0, 3.0.0) + [2.0.0, 2.1.0) diff --git a/aws-cloudformation-hooktypeconfig/pom.xml b/aws-cloudformation-hooktypeconfig/pom.xml index abbdb82..218d412 100644 --- a/aws-cloudformation-hooktypeconfig/pom.xml +++ b/aws-cloudformation-hooktypeconfig/pom.xml @@ -35,7 +35,7 @@ software.amazon.cloudformation aws-cloudformation-rpdk-java-plugin - [2.0.0, 3.0.0) + [2.0.0, 2.1.0) diff --git a/aws-cloudformation-hookversion/pom.xml b/aws-cloudformation-hookversion/pom.xml index f4e7108..e47aa9b 100644 --- a/aws-cloudformation-hookversion/pom.xml +++ b/aws-cloudformation-hookversion/pom.xml @@ -35,7 +35,7 @@ software.amazon.cloudformation aws-cloudformation-rpdk-java-plugin - [2.0.0,3.0.0) + [2.0.0,2.1.0) diff --git a/aws-cloudformation-stack/pom.xml b/aws-cloudformation-stack/pom.xml index 09aeea8..c1e9886 100644 --- a/aws-cloudformation-stack/pom.xml +++ b/aws-cloudformation-stack/pom.xml @@ -30,7 +30,7 @@ software.amazon.cloudformation aws-cloudformation-rpdk-java-plugin - [2.0.0,3.0.0) + [2.0.0,2.1.0) diff --git a/aws-cloudformation-stackset/aws-cloudformation-stackset.json b/aws-cloudformation-stackset/aws-cloudformation-stackset.json index f68d925..eb9672a 100644 --- a/aws-cloudformation-stackset/aws-cloudformation-stackset.json +++ b/aws-cloudformation-stackset/aws-cloudformation-stackset.json @@ -76,6 +76,14 @@ "PARALLEL" ] }, + "ConcurrencyMode": { + "description": "Specifies how the concurrency level behaves during the operation execution.", + "type": "string", + "enum": [ + "STRICT_FAILURE_TOLERANCE", + "SOFT_FAILURE_TOLERANCE" + ] + }, "Active": { "description": "When true, StackSets performs non-conflicting operations concurrently and queues conflicting operations. After conflicting operations finish, StackSets starts queued operations in request order.", "type": "boolean" @@ -110,6 +118,9 @@ }, "RegionConcurrencyType": { "$ref": "#/definitions/RegionConcurrencyType" + }, + "ConcurrencyMode": { + "$ref": "#/definitions/ConcurrencyMode" } }, "additionalProperties": false diff --git a/aws-cloudformation-stackset/docs/operationpreferences.md b/aws-cloudformation-stackset/docs/operationpreferences.md index 6f2d2d0..2181354 100644 --- a/aws-cloudformation-stackset/docs/operationpreferences.md +++ b/aws-cloudformation-stackset/docs/operationpreferences.md @@ -15,7 +15,8 @@ To declare this entity in your AWS CloudFormation template, use the following sy "MaxConcurrentCount" : Integer, "MaxConcurrentPercentage" : Integer, "RegionOrder" : [ String, ... ], - "RegionConcurrencyType" : String + "RegionConcurrencyType" : String, + "ConcurrencyMode" : String } @@ -29,6 +30,7 @@ To declare this entity in your AWS CloudFormation template, use the following sy RegionOrder: - String RegionConcurrencyType: String +ConcurrencyMode: String ## Properties @@ -84,3 +86,15 @@ _Type_: String _Allowed Values_: SEQUENTIAL | PARALLEL _Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt) + +#### ConcurrencyMode + +Specifies how the concurrency level behaves during the operation execution. + +_Required_: No + +_Type_: String + +_Allowed Values_: STRICT_FAILURE_TOLERANCE | SOFT_FAILURE_TOLERANCE + +_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt) diff --git a/aws-cloudformation-stackset/pom.xml b/aws-cloudformation-stackset/pom.xml index a4b8c80..509cbaa 100644 --- a/aws-cloudformation-stackset/pom.xml +++ b/aws-cloudformation-stackset/pom.xml @@ -24,7 +24,7 @@ software.amazon.awssdk bom - 2.17.235 + 2.25.51 pom import @@ -49,7 +49,7 @@ software.amazon.awssdk cloudformation - 2.17.235 + 2.25.51 diff --git a/aws-cloudformation-stackset/src/main/java/software/amazon/cloudformation/stackset/translator/PropertyTranslator.java b/aws-cloudformation-stackset/src/main/java/software/amazon/cloudformation/stackset/translator/PropertyTranslator.java index ec969ff..670e347 100644 --- a/aws-cloudformation-stackset/src/main/java/software/amazon/cloudformation/stackset/translator/PropertyTranslator.java +++ b/aws-cloudformation-stackset/src/main/java/software/amazon/cloudformation/stackset/translator/PropertyTranslator.java @@ -118,6 +118,7 @@ static StackSetOperationPreferences translateToSdkOperationPreferences( .failureTolerancePercentage(operationPreferences.getFailureTolerancePercentage()) .regionOrder(operationPreferences.getRegionOrder()) .regionConcurrencyType(operationPreferences.getRegionConcurrencyType()) + .concurrencyMode(operationPreferences.getConcurrencyMode()) .build(); } diff --git a/aws-cloudformation-stackset/src/test/java/software/amazon/cloudformation/stackset/translator/PropertyTranslatorTest.java b/aws-cloudformation-stackset/src/test/java/software/amazon/cloudformation/stackset/translator/PropertyTranslatorTest.java index 9341765..c6f216f 100644 --- a/aws-cloudformation-stackset/src/test/java/software/amazon/cloudformation/stackset/translator/PropertyTranslatorTest.java +++ b/aws-cloudformation-stackset/src/test/java/software/amazon/cloudformation/stackset/translator/PropertyTranslatorTest.java @@ -2,6 +2,7 @@ import java.util.HashSet; import org.junit.jupiter.api.Test; +import software.amazon.awssdk.services.cloudformation.model.ConcurrencyMode; import software.amazon.awssdk.services.cloudformation.model.DeploymentTargets; import software.amazon.awssdk.services.cloudformation.model.RegionConcurrencyType; import software.amazon.awssdk.services.cloudformation.model.StackSetOperationPreferences; @@ -73,6 +74,7 @@ public void test_translateToStackSetOperationPreferences() { assertThat(stackSetOperationPreferences.maxConcurrentPercentage()).isEqualTo(100); assertThat(stackSetOperationPreferences.regionOrder()).isEqualTo(Arrays.asList(TestUtils.US_WEST_1, TestUtils.US_EAST_1)); assertThat(stackSetOperationPreferences.regionConcurrencyType()).isEqualTo(RegionConcurrencyType.PARALLEL); + assertThat(stackSetOperationPreferences.concurrencyMode()).isEqualTo(ConcurrencyMode.STRICT_FAILURE_TOLERANCE); } @Test diff --git a/aws-cloudformation-stackset/src/test/java/software/amazon/cloudformation/stackset/util/AltResourceModelAnalyzerTest.java b/aws-cloudformation-stackset/src/test/java/software/amazon/cloudformation/stackset/util/AltResourceModelAnalyzerTest.java index 371d717..4f927d1 100644 --- a/aws-cloudformation-stackset/src/test/java/software/amazon/cloudformation/stackset/util/AltResourceModelAnalyzerTest.java +++ b/aws-cloudformation-stackset/src/test/java/software/amazon/cloudformation/stackset/util/AltResourceModelAnalyzerTest.java @@ -168,7 +168,7 @@ public void test_ALT_Create_With_OperationPreferences_And_Region_Order() { new HashSet<>(Arrays.asList(region_1, region_2, region_3))) ))); List regionOrder = Arrays.asList(region_3, region_2, region_1); - currentModel.setOperationPreferences(new OperationPreferences(null, null, null, null, regionOrder, null)); + currentModel.setOperationPreferences(new OperationPreferences(null, null, null, null, regionOrder, null, null)); Set desiredDeleteInstances = new LinkedHashSet<>(); Set desiredCreateInstances = new LinkedHashSet<>(Arrays.asList( @@ -199,7 +199,7 @@ public void test_ALT_Create_With_OperationPreferences_And_Region_Order_And_ME() new HashSet<>(Arrays.asList(region_1, region_2, region_3))) ))); List regionOrder = Arrays.asList(region_3, region_2, region_1); - currentModel.setOperationPreferences(new OperationPreferences(null, null, null, null, regionOrder, null)); + currentModel.setOperationPreferences(new OperationPreferences(null, null, null, null, regionOrder, null, null)); currentModel.setManagedExecution(new ManagedExecution(true)); Set desiredDeleteInstances = new LinkedHashSet<>(); @@ -231,7 +231,7 @@ public void test_ALT_Create_With_Less_Number_Of_Regions_In_Region_Order() { new HashSet<>(Arrays.asList(region_1, region_2, region_3))) ))); List regionOrder = Arrays.asList(region_3); - currentModel.setOperationPreferences(new OperationPreferences(null, null, null, null, regionOrder, null)); + currentModel.setOperationPreferences(new OperationPreferences(null, null, null, null, regionOrder, null, null)); Set desiredDeleteInstances = new LinkedHashSet<>(); Set desiredCreateInstances = new LinkedHashSet<>(Arrays.asList( @@ -261,7 +261,7 @@ public void test_ALT_Create_With_InCorrect_Region_Order() { new HashSet<>(Arrays.asList(region_1, region_2))) ))); List regionOrder = Arrays.asList(region_3); - currentModel.setOperationPreferences(new OperationPreferences(null, null, null, null, regionOrder, null)); + currentModel.setOperationPreferences(new OperationPreferences(null, null, null, null, regionOrder, null, null)); Set desiredDeleteInstances = new LinkedHashSet<>(); Set desiredCreateInstances = new LinkedHashSet<>(Arrays.asList( @@ -291,7 +291,7 @@ public void test_ALT_Create_With_Less_Number_Of_Regions() { new HashSet<>(Arrays.asList(region_1, region_2))) ))); List regionOrder = Arrays.asList(region_3, region_2, region_1); - currentModel.setOperationPreferences(new OperationPreferences(null, null, null, null, regionOrder, null)); + currentModel.setOperationPreferences(new OperationPreferences(null, null, null, null, regionOrder, null, null)); Set desiredDeleteInstances = new LinkedHashSet<>(); Set desiredCreateInstances = new LinkedHashSet<>(Arrays.asList( @@ -321,7 +321,7 @@ public void test_ALT_Delete_With_OperationPreferences_And_Region_Order() { new HashSet<>(Arrays.asList(region_1, region_2, region_3))) ))); List regionOrder = Arrays.asList(region_3, region_2, region_1); - previousModel.setOperationPreferences(new OperationPreferences(null, null, null, null, regionOrder, null)); + previousModel.setOperationPreferences(new OperationPreferences(null, null, null, null, regionOrder, null, null)); Set desiredDeleteInstances = new LinkedHashSet<>(Arrays.asList( generateInstancesWithRegions(Arrays.asList(OU_2, OU_3), Arrays.asList(account_1, account_2), INTER, region_3), @@ -376,7 +376,7 @@ public void test_ALT_Create_With_Null_Region_Order_And_Not_Null_OperationPrefere Arrays.asList(OU_2, OU_3), Arrays.asList(account_1, account_2), INTER, new HashSet<>(Arrays.asList(region_1, region_2, region_3))) ))); - currentModel.setOperationPreferences(new OperationPreferences(null, null, null, null, null, null)); + currentModel.setOperationPreferences(new OperationPreferences(null, null, null, null, null, null, null)); Set desiredDeleteInstances = new LinkedHashSet<>(); Set desiredCreateInstances = new LinkedHashSet<>(Arrays.asList( @@ -401,7 +401,7 @@ public void test_ALT_Delete_With_Null_Region_Order_And_Not_Null_OperationPrefere Arrays.asList(OU_2, OU_3), Arrays.asList(account_1, account_2), INTER, new HashSet<>(Arrays.asList(region_1, region_2, region_3))) ))); - previousModel.setOperationPreferences(new OperationPreferences(null, null, null, null, null, null)); + previousModel.setOperationPreferences(new OperationPreferences(null, null, null, null, null, null, null)); Set desiredCreateInstances = new LinkedHashSet<>(); Set desiredDeleteInstances = new LinkedHashSet<>(Arrays.asList( @@ -492,7 +492,7 @@ public void test_ALT_Update_With_Region_Order() { new HashSet<>(Arrays.asList(region_1, region_2, region_4))) ))); List regionOrder = Arrays.asList(region_4, region_3, region_2, region_1); - OperationPreferences operationPreferences = new OperationPreferences(null, null, null, null, regionOrder, null); + OperationPreferences operationPreferences = new OperationPreferences(null, null, null, null, regionOrder, null, null); currentModel.setOperationPreferences(operationPreferences); previousModel.setOperationPreferences(operationPreferences); diff --git a/aws-cloudformation-stackset/src/test/java/software/amazon/cloudformation/stackset/util/TestUtils.java b/aws-cloudformation-stackset/src/test/java/software/amazon/cloudformation/stackset/util/TestUtils.java index 83ed40d..f62cc7b 100644 --- a/aws-cloudformation-stackset/src/test/java/software/amazon/cloudformation/stackset/util/TestUtils.java +++ b/aws-cloudformation-stackset/src/test/java/software/amazon/cloudformation/stackset/util/TestUtils.java @@ -1,6 +1,7 @@ package software.amazon.cloudformation.stackset.util; import com.google.common.collect.ImmutableMap; +import software.amazon.awssdk.services.cloudformation.model.ConcurrencyMode; import software.amazon.awssdk.services.cloudformation.model.CreateStackInstancesResponse; import software.amazon.awssdk.services.cloudformation.model.CreateStackSetResponse; import software.amazon.awssdk.services.cloudformation.model.DeleteStackInstancesResponse; @@ -199,6 +200,7 @@ public class TestUtils { .maxConcurrentPercentage(100) .regionOrder(Arrays.asList(US_WEST_1, US_EAST_1)) .regionConcurrencyType(RegionConcurrencyType.PARALLEL.toString()) + .concurrencyMode(ConcurrencyMode.STRICT_FAILURE_TOLERANCE.toString()) .build(); public final static ManagedExecution MANAGED_EXECUTION_ENABLED_RESOURCE_MODEL = ManagedExecution.builder()