Skip to content

Commit 5f33a26

Browse files
authored
feat(stepfunctions): removal policy for state machines (#24105)
Add the `removalPolicy` prop to `StateMachine`. The execution history can be considered as stateful. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent ee36150 commit 5f33a26

File tree

346 files changed

+3395
-1164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

346 files changed

+3395
-1164
lines changed

packages/@aws-cdk/aws-apigateway/test/integ.stepfunctions-api.js.snapshot/StepFunctionsRestApiDeploymentStack.assets.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"version": "21.0.0",
2+
"version": "30.0.0",
33
"files": {
4-
"06411bc9644c9af466e4101cc159122b7c5422ecbd496553c2a2ef821687361c": {
4+
"de2c198bbb6588ccbe00d0f0794f7217c429e3d7e3c5b4326e3b085b0d697753": {
55
"source": {
66
"path": "StepFunctionsRestApiDeploymentStack.template.json",
77
"packaging": "file"
88
},
99
"destinations": {
1010
"current_account-current_region": {
1111
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12-
"objectKey": "06411bc9644c9af466e4101cc159122b7c5422ecbd496553c2a2ef821687361c.json",
12+
"objectKey": "de2c198bbb6588ccbe00d0f0794f7217c429e3d7e3c5b4326e3b085b0d697753.json",
1313
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
1414
}
1515
}

packages/@aws-cdk/aws-apigateway/test/integ.stepfunctions-api.js.snapshot/StepFunctionsRestApiDeploymentStack.template.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
},
3232
"DependsOn": [
3333
"StateMachineRoleB840431D"
34-
]
34+
],
35+
"UpdateReplacePolicy": "Delete",
36+
"DeletionPolicy": "Delete"
3537
},
3638
"StepFunctionsRestApiC6E3E883": {
3739
"Type": "AWS::ApiGateway::RestApi",
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"21.0.0"}
1+
{"version":"30.0.0"}

packages/@aws-cdk/aws-apigateway/test/integ.stepfunctions-api.js.snapshot/integ.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "21.0.0",
2+
"version": "30.0.0",
33
"testCases": {
44
"step-functions-restapi/DefaultTest": {
55
"stacks": [

packages/@aws-cdk/aws-apigateway/test/integ.stepfunctions-api.js.snapshot/manifest.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "21.0.0",
2+
"version": "30.0.0",
33
"artifacts": {
44
"StepFunctionsRestApiDeploymentStack.assets": {
55
"type": "cdk:asset-manifest",
@@ -17,7 +17,7 @@
1717
"validateOnSynth": false,
1818
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
1919
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
20-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/06411bc9644c9af466e4101cc159122b7c5422ecbd496553c2a2ef821687361c.json",
20+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/de2c198bbb6588ccbe00d0f0794f7217c429e3d7e3c5b4326e3b085b0d697753.json",
2121
"requiresBootstrapStackVersion": 6,
2222
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
2323
"additionalDependencies": [

packages/@aws-cdk/aws-apigateway/test/integ.stepfunctions-api.js.snapshot/stepfunctionsrestapiDefaultTestDeployAssert53C3797F.assets.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "21.0.0",
2+
"version": "30.0.0",
33
"files": {
44
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
55
"source": {

packages/@aws-cdk/aws-apigateway/test/integ.stepfunctions-api.js.snapshot/tree.json

+26-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@
2424
"id": "Role",
2525
"path": "StepFunctionsRestApiDeploymentStack/StateMachine/Role",
2626
"children": {
27+
"ImportRole": {
28+
"id": "ImportRole",
29+
"path": "StepFunctionsRestApiDeploymentStack/StateMachine/Role/ImportRole",
30+
"constructInfo": {
31+
"fqn": "@aws-cdk/core.Resource",
32+
"version": "0.0.0"
33+
}
34+
},
2735
"Resource": {
2836
"id": "Resource",
2937
"path": "StepFunctionsRestApiDeploymentStack/StateMachine/Role/Resource",
@@ -104,6 +112,14 @@
104112
"id": "CloudWatchRole",
105113
"path": "StepFunctionsRestApiDeploymentStack/StepFunctionsRestApi/CloudWatchRole",
106114
"children": {
115+
"ImportCloudWatchRole": {
116+
"id": "ImportCloudWatchRole",
117+
"path": "StepFunctionsRestApiDeploymentStack/StepFunctionsRestApi/CloudWatchRole/ImportCloudWatchRole",
118+
"constructInfo": {
119+
"fqn": "@aws-cdk/core.Resource",
120+
"version": "0.0.0"
121+
}
122+
},
107123
"Resource": {
108124
"id": "Resource",
109125
"path": "StepFunctionsRestApiDeploymentStack/StepFunctionsRestApi/CloudWatchRole/Resource",
@@ -180,6 +196,14 @@
180196
"id": "StartSyncExecutionRole",
181197
"path": "StepFunctionsRestApiDeploymentStack/StepFunctionsRestApi/Default/ANY/StartSyncExecutionRole",
182198
"children": {
199+
"ImportStartSyncExecutionRole": {
200+
"id": "ImportStartSyncExecutionRole",
201+
"path": "StepFunctionsRestApiDeploymentStack/StepFunctionsRestApi/Default/ANY/StartSyncExecutionRole/ImportStartSyncExecutionRole",
202+
"constructInfo": {
203+
"fqn": "@aws-cdk/core.Resource",
204+
"version": "0.0.0"
205+
}
206+
},
183207
"Resource": {
184208
"id": "Resource",
185209
"path": "StepFunctionsRestApiDeploymentStack/StepFunctionsRestApi/Default/ANY/StartSyncExecutionRole/Resource",
@@ -476,7 +500,7 @@
476500
"path": "step-functions-restapi/DefaultTest/Default",
477501
"constructInfo": {
478502
"fqn": "constructs.Construct",
479-
"version": "10.1.140"
503+
"version": "10.1.237"
480504
}
481505
},
482506
"DeployAssert": {
@@ -522,7 +546,7 @@
522546
"path": "Tree",
523547
"constructInfo": {
524548
"fqn": "constructs.Construct",
525-
"version": "10.1.140"
549+
"version": "10.1.237"
526550
}
527551
}
528552
},

packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-stepfunctions.js.snapshot/aws-cdk-codepipeline-stepfunctions.assets.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"version": "21.0.0",
2+
"version": "30.0.0",
33
"files": {
4-
"3d5f0e79e533ad63e029ee86782cdc022e8faa5575d2e96d5a6bc3d7f5734e54": {
4+
"9c2191cf64f5d0c7288c4daeb90518584cb5076983557a2d930df85cbf8b1e4d": {
55
"source": {
66
"path": "aws-cdk-codepipeline-stepfunctions.template.json",
77
"packaging": "file"
88
},
99
"destinations": {
1010
"current_account-current_region": {
1111
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12-
"objectKey": "3d5f0e79e533ad63e029ee86782cdc022e8faa5575d2e96d5a6bc3d7f5734e54.json",
12+
"objectKey": "9c2191cf64f5d0c7288c4daeb90518584cb5076983557a2d930df85cbf8b1e4d.json",
1313
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
1414
}
1515
}

packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-stepfunctions.js.snapshot/aws-cdk-codepipeline-stepfunctions.template.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
},
3131
"DependsOn": [
3232
"SimpleStateMachineRole0CBC135A"
33-
]
33+
],
34+
"UpdateReplacePolicy": "Delete",
35+
"DeletionPolicy": "Delete"
3436
},
3537
"MyPipelineArtifactsBucketEncryptionKey8BF0A7F3": {
3638
"Type": "AWS::KMS::Key",
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"21.0.0"}
1+
{"version":"30.0.0"}

packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-stepfunctions.js.snapshot/integ.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "21.0.0",
2+
"version": "30.0.0",
33
"testCases": {
44
"integ.pipeline-stepfunctions": {
55
"stacks": [

packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-stepfunctions.js.snapshot/manifest.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "21.0.0",
2+
"version": "30.0.0",
33
"artifacts": {
44
"aws-cdk-codepipeline-stepfunctions.assets": {
55
"type": "cdk:asset-manifest",
@@ -17,7 +17,7 @@
1717
"validateOnSynth": false,
1818
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
1919
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
20-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/3d5f0e79e533ad63e029ee86782cdc022e8faa5575d2e96d5a6bc3d7f5734e54.json",
20+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/9c2191cf64f5d0c7288c4daeb90518584cb5076983557a2d930df85cbf8b1e4d.json",
2121
"requiresBootstrapStackVersion": 6,
2222
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
2323
"additionalDependencies": [

packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-stepfunctions.js.snapshot/tree.json

+37-5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@
2424
"id": "Role",
2525
"path": "aws-cdk-codepipeline-stepfunctions/SimpleStateMachine/Role",
2626
"children": {
27+
"ImportRole": {
28+
"id": "ImportRole",
29+
"path": "aws-cdk-codepipeline-stepfunctions/SimpleStateMachine/Role/ImportRole",
30+
"constructInfo": {
31+
"fqn": "@aws-cdk/core.Resource",
32+
"version": "0.0.0"
33+
}
34+
},
2735
"Resource": {
2836
"id": "Resource",
2937
"path": "aws-cdk-codepipeline-stepfunctions/SimpleStateMachine/Role/Resource",
@@ -279,6 +287,14 @@
279287
"id": "Role",
280288
"path": "aws-cdk-codepipeline-stepfunctions/MyPipeline/Role",
281289
"children": {
290+
"ImportRole": {
291+
"id": "ImportRole",
292+
"path": "aws-cdk-codepipeline-stepfunctions/MyPipeline/Role/ImportRole",
293+
"constructInfo": {
294+
"fqn": "@aws-cdk/core.Resource",
295+
"version": "0.0.0"
296+
}
297+
},
282298
"Resource": {
283299
"id": "Resource",
284300
"path": "aws-cdk-codepipeline-stepfunctions/MyPipeline/Role/Resource",
@@ -524,6 +540,14 @@
524540
"id": "CodePipelineActionRole",
525541
"path": "aws-cdk-codepipeline-stepfunctions/MyPipeline/Source/Source/CodePipelineActionRole",
526542
"children": {
543+
"ImportCodePipelineActionRole": {
544+
"id": "ImportCodePipelineActionRole",
545+
"path": "aws-cdk-codepipeline-stepfunctions/MyPipeline/Source/Source/CodePipelineActionRole/ImportCodePipelineActionRole",
546+
"constructInfo": {
547+
"fqn": "@aws-cdk/core.Resource",
548+
"version": "0.0.0"
549+
}
550+
},
527551
"Resource": {
528552
"id": "Resource",
529553
"path": "aws-cdk-codepipeline-stepfunctions/MyPipeline/Source/Source/CodePipelineActionRole/Resource",
@@ -686,13 +710,13 @@
686710
},
687711
"constructInfo": {
688712
"fqn": "constructs.Construct",
689-
"version": "10.1.140"
713+
"version": "10.1.237"
690714
}
691715
}
692716
},
693717
"constructInfo": {
694718
"fqn": "constructs.Construct",
695-
"version": "10.1.140"
719+
"version": "10.1.237"
696720
}
697721
},
698722
"Invoke": {
@@ -707,6 +731,14 @@
707731
"id": "CodePipelineActionRole",
708732
"path": "aws-cdk-codepipeline-stepfunctions/MyPipeline/Invoke/Invoke/CodePipelineActionRole",
709733
"children": {
734+
"ImportCodePipelineActionRole": {
735+
"id": "ImportCodePipelineActionRole",
736+
"path": "aws-cdk-codepipeline-stepfunctions/MyPipeline/Invoke/Invoke/CodePipelineActionRole/ImportCodePipelineActionRole",
737+
"constructInfo": {
738+
"fqn": "@aws-cdk/core.Resource",
739+
"version": "0.0.0"
740+
}
741+
},
710742
"Resource": {
711743
"id": "Resource",
712744
"path": "aws-cdk-codepipeline-stepfunctions/MyPipeline/Invoke/Invoke/CodePipelineActionRole/Resource",
@@ -838,13 +870,13 @@
838870
},
839871
"constructInfo": {
840872
"fqn": "constructs.Construct",
841-
"version": "10.1.140"
873+
"version": "10.1.237"
842874
}
843875
}
844876
},
845877
"constructInfo": {
846878
"fqn": "constructs.Construct",
847-
"version": "10.1.140"
879+
"version": "10.1.237"
848880
}
849881
}
850882
},
@@ -902,7 +934,7 @@
902934
"path": "Tree",
903935
"constructInfo": {
904936
"fqn": "constructs.Construct",
905-
"version": "10.1.140"
937+
"version": "10.1.237"
906938
}
907939
}
908940
},

packages/@aws-cdk/aws-stepfunctions-tasks/test/apigateway/integ.call-http-api.js.snapshot/CallHttpApiInteg.assets.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"version": "21.0.0",
2+
"version": "30.0.0",
33
"files": {
4-
"98e2d07ff30129aa5321a49eb6aaafeef6fb87a7222cd36d85edd66ee13cf8c4": {
4+
"27b3ee7de550afbdc0e7b81a044c44d3a5739fd50df908417bc07f296a47b34b": {
55
"source": {
66
"path": "CallHttpApiInteg.template.json",
77
"packaging": "file"
88
},
99
"destinations": {
1010
"current_account-current_region": {
1111
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12-
"objectKey": "98e2d07ff30129aa5321a49eb6aaafeef6fb87a7222cd36d85edd66ee13cf8c4.json",
12+
"objectKey": "27b3ee7de550afbdc0e7b81a044c44d3a5739fd50df908417bc07f296a47b34b.json",
1313
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
1414
}
1515
}

packages/@aws-cdk/aws-stepfunctions-tasks/test/apigateway/integ.call-http-api.js.snapshot/CallHttpApiInteg.template.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,9 @@
239239
"DependsOn": [
240240
"StateMachineRoleDefaultPolicyDF1E6607",
241241
"StateMachineRoleB840431D"
242-
]
242+
],
243+
"UpdateReplacePolicy": "Delete",
244+
"DeletionPolicy": "Delete"
243245
}
244246
},
245247
"Outputs": {
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"21.0.0"}
1+
{"version":"30.0.0"}

packages/@aws-cdk/aws-stepfunctions-tasks/test/apigateway/integ.call-http-api.js.snapshot/integ.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "21.0.0",
2+
"version": "30.0.0",
33
"testCases": {
44
"integ.call-http-api": {
55
"stacks": [

packages/@aws-cdk/aws-stepfunctions-tasks/test/apigateway/integ.call-http-api.js.snapshot/manifest.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "21.0.0",
2+
"version": "30.0.0",
33
"artifacts": {
44
"CallHttpApiInteg.assets": {
55
"type": "cdk:asset-manifest",
@@ -17,7 +17,7 @@
1717
"validateOnSynth": false,
1818
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
1919
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
20-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/98e2d07ff30129aa5321a49eb6aaafeef6fb87a7222cd36d85edd66ee13cf8c4.json",
20+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/27b3ee7de550afbdc0e7b81a044c44d3a5739fd50df908417bc07f296a47b34b.json",
2121
"requiresBootstrapStackVersion": 6,
2222
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
2323
"additionalDependencies": [

packages/@aws-cdk/aws-stepfunctions-tasks/test/apigateway/integ.call-http-api.js.snapshot/tree.json

+17-1
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,14 @@
187187
"id": "ServiceRole",
188188
"path": "CallHttpApiInteg/HelloHandler/ServiceRole",
189189
"children": {
190+
"ImportServiceRole": {
191+
"id": "ImportServiceRole",
192+
"path": "CallHttpApiInteg/HelloHandler/ServiceRole/ImportServiceRole",
193+
"constructInfo": {
194+
"fqn": "@aws-cdk/core.Resource",
195+
"version": "0.0.0"
196+
}
197+
},
190198
"Resource": {
191199
"id": "Resource",
192200
"path": "CallHttpApiInteg/HelloHandler/ServiceRole/Resource",
@@ -278,6 +286,14 @@
278286
"id": "Role",
279287
"path": "CallHttpApiInteg/StateMachine/Role",
280288
"children": {
289+
"ImportRole": {
290+
"id": "ImportRole",
291+
"path": "CallHttpApiInteg/StateMachine/Role/ImportRole",
292+
"constructInfo": {
293+
"fqn": "@aws-cdk/core.Resource",
294+
"version": "0.0.0"
295+
}
296+
},
281297
"Resource": {
282298
"id": "Resource",
283299
"path": "CallHttpApiInteg/StateMachine/Role/Resource",
@@ -455,7 +471,7 @@
455471
"path": "Tree",
456472
"constructInfo": {
457473
"fqn": "constructs.Construct",
458-
"version": "10.1.140"
474+
"version": "10.1.237"
459475
}
460476
}
461477
},

0 commit comments

Comments
 (0)