Skip to content

Commit b226a8c

Browse files
authored
feat(stepfunctions): support Map ItemSelector (#28771)
Adds support for Map's [ItemSelector](https://docs.aws.amazon.com/step-functions/latest/dg/input-output-itemselector.html) field and deprecates [parameters](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-asl-use-map-state-inline.html#map-state-inline-deprecated-fields). With the release of Distributed Maps, AWS StepFunctions has released a few new fields, and deprecated two old ones for Map states. One of them was `Iterator` which was replaced with `ItemProcessor`, the other one is `Parameters` (replaced by `ItemSelector`). A similar PR was made to deprecate `Iterator` (#27913). While they are deprecated, these fields are still supported (PR reflects that) `ItemProcessor` and `ItemSelector` are both fields that are supported in `DISTRIBUTED` and `INLINE` mode, hence why they were added to the existing Map construct Closes #23265 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent ea34c89 commit b226a8c

File tree

13 files changed

+34895
-5
lines changed

13 files changed

+34895
-5
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-itemselector.js.snapshot/asset.4984c845346313a408899c8ff361d3b7b97953a9d4202e47694ef2a101f4b5c3.bundle/index.js

+33,996
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-itemselector.js.snapshot/cdk-stepfunctions-map-itemselector-stack.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"Resources": {
3+
"StateMachineRoleB840431D": {
4+
"Type": "AWS::IAM::Role",
5+
"Properties": {
6+
"AssumeRolePolicyDocument": {
7+
"Statement": [
8+
{
9+
"Action": "sts:AssumeRole",
10+
"Effect": "Allow",
11+
"Principal": {
12+
"Service": "states.amazonaws.com"
13+
}
14+
}
15+
],
16+
"Version": "2012-10-17"
17+
}
18+
}
19+
},
20+
"StateMachine2E01A3A5": {
21+
"Type": "AWS::StepFunctions::StateMachine",
22+
"Properties": {
23+
"DefinitionString": "{\"StartAt\":\"My-Map-State\",\"States\":{\"My-Map-State\":{\"Type\":\"Map\",\"End\":true,\"ItemsPath\":\"$.inputForMap\",\"ItemSelector\":{\"foo\":\"foo\",\"bar.$\":\"$.bar\"},\"ItemProcessor\":{\"ProcessorConfig\":{\"Mode\":\"INLINE\"},\"StartAt\":\"Pass State\",\"States\":{\"Pass State\":{\"Type\":\"Pass\",\"End\":true}}},\"MaxConcurrency\":1}},\"TimeoutSeconds\":30}",
24+
"RoleArn": {
25+
"Fn::GetAtt": [
26+
"StateMachineRoleB840431D",
27+
"Arn"
28+
]
29+
}
30+
},
31+
"DependsOn": [
32+
"StateMachineRoleB840431D"
33+
],
34+
"UpdateReplacePolicy": "Delete",
35+
"DeletionPolicy": "Delete"
36+
}
37+
},
38+
"Outputs": {
39+
"ExportsOutputRefStateMachine2E01A3A5BA46F753": {
40+
"Value": {
41+
"Ref": "StateMachine2E01A3A5"
42+
},
43+
"Export": {
44+
"Name": "cdk-stepfunctions-map-itemselector-stack:ExportsOutputRefStateMachine2E01A3A5BA46F753"
45+
}
46+
}
47+
},
48+
"Parameters": {
49+
"BootstrapVersion": {
50+
"Type": "AWS::SSM::Parameter::Value<String>",
51+
"Default": "/cdk-bootstrap/hnb659fds/version",
52+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
53+
}
54+
},
55+
"Rules": {
56+
"CheckBootstrapVersion": {
57+
"Assertions": [
58+
{
59+
"Assert": {
60+
"Fn::Not": [
61+
{
62+
"Fn::Contains": [
63+
[
64+
"1",
65+
"2",
66+
"3",
67+
"4",
68+
"5"
69+
],
70+
{
71+
"Ref": "BootstrapVersion"
72+
}
73+
]
74+
}
75+
]
76+
},
77+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
78+
}
79+
]
80+
}
81+
}
82+
}

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-itemselector.js.snapshot/cdk.out

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-itemselector.js.snapshot/cdkstepfunctionsmapitemselectorintegDefaultTestDeployAssertB0D765C3.assets.json

+32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-itemselector.js.snapshot/cdkstepfunctionsmapitemselectorintegDefaultTestDeployAssertB0D765C3.template.json

+141
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-itemselector.js.snapshot/integ.json

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)