-
Notifications
You must be signed in to change notification settings - Fork 4.2k
fix(stepfunctions): JsonPath.listAt does not accept strings starting with $[
#22472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
fbcc3ff
fix(aws-stepfunctions): JsonPath.listAt accept strings starting with $[
marciocadev ccc7fc1
chore: adding stringset integration test
marciocadev 2e2bb35
Merge branch 'aws:main' into stringset
marciocadev 1fe8d7a
chore: update error message
marciocadev f7838a8
chore: renaming integration test to ListAtAfterParallel
marciocadev d4de762
Merge branch 'main' into stringset
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
packages/@aws-cdk/aws-stepfunctions-tasks/test/dynamodb/integ.stringset-after-parallel.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import * as ddb from '@aws-cdk/aws-dynamodb'; | ||
import * as sfn from '@aws-cdk/aws-stepfunctions'; | ||
import * as cdk from '@aws-cdk/core'; | ||
import * as integ from '@aws-cdk/integ-tests'; | ||
import * as tasks from '../../lib'; | ||
|
||
const app = new cdk.App(); | ||
const stack = new cdk.Stack(app, 'stringset-after-parallel'); | ||
|
||
const table = new ddb.Table(stack, 'Table', { | ||
partitionKey: { name: 'pk', type: ddb.AttributeType.STRING }, | ||
removalPolicy: cdk.RemovalPolicy.DESTROY, | ||
}); | ||
|
||
const passPK = new sfn.Pass(stack, 'passPK', { | ||
parameters: { 'pk.$': '$.pk' }, | ||
}); | ||
const passStringSet = new sfn.Pass(stack, 'PassStringSet', { | ||
parameters: { 'stringset.$': '$.stringset' }, | ||
}); | ||
|
||
const parallel = new sfn.Parallel(stack, 'Parallel', { | ||
resultPath: '$', | ||
}); | ||
parallel.branch(passPK) | ||
.branch(passStringSet); | ||
|
||
const putItem = new tasks.DynamoPutItem(stack, 'PutItem', { | ||
table: table, | ||
item: { | ||
pk: tasks.DynamoAttributeValue.fromString('$[0].pk'), | ||
stringset: tasks.DynamoAttributeValue.fromStringSet(sfn.JsonPath.listAt('$[1].stringset')), | ||
}, | ||
}); | ||
|
||
const definition = sfn.Chain.start(parallel).next(putItem); | ||
|
||
new sfn.StateMachine(stack, 'StateMachine', { | ||
definition: definition, | ||
}); | ||
|
||
new integ.IntegTest(app, 'StringSetAfterParallel', { | ||
testCases: [stack], | ||
}); | ||
|
||
app.synth(); |
19 changes: 19 additions & 0 deletions
19
...parallel.integ.snapshot/StringSetAfterParallelDefaultTestDeployAssert649ABBB9.assets.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"version": "21.0.0", | ||
"files": { | ||
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { | ||
"source": { | ||
"path": "StringSetAfterParallelDefaultTestDeployAssert649ABBB9.template.json", | ||
"packaging": "file" | ||
}, | ||
"destinations": { | ||
"current_account-current_region": { | ||
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", | ||
"objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", | ||
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" | ||
} | ||
} | ||
} | ||
}, | ||
"dockerImages": {} | ||
} |
36 changes: 36 additions & 0 deletions
36
...rallel.integ.snapshot/StringSetAfterParallelDefaultTestDeployAssert649ABBB9.template.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"Parameters": { | ||
"BootstrapVersion": { | ||
"Type": "AWS::SSM::Parameter::Value<String>", | ||
"Default": "/cdk-bootstrap/hnb659fds/version", | ||
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" | ||
} | ||
}, | ||
"Rules": { | ||
"CheckBootstrapVersion": { | ||
"Assertions": [ | ||
{ | ||
"Assert": { | ||
"Fn::Not": [ | ||
{ | ||
"Fn::Contains": [ | ||
[ | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5" | ||
], | ||
{ | ||
"Ref": "BootstrapVersion" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." | ||
} | ||
] | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...cdk/aws-stepfunctions-tasks/test/dynamodb/stringset-after-parallel.integ.snapshot/cdk.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"version":"21.0.0"} |
12 changes: 12 additions & 0 deletions
12
.../aws-stepfunctions-tasks/test/dynamodb/stringset-after-parallel.integ.snapshot/integ.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"version": "21.0.0", | ||
"testCases": { | ||
"StringSetAfterParallel/DefaultTest": { | ||
"stacks": [ | ||
"stringset-after-parallel" | ||
], | ||
"assertionStack": "StringSetAfterParallel/DefaultTest/DeployAssert", | ||
"assertionStackName": "StringSetAfterParallelDefaultTestDeployAssert649ABBB9" | ||
} | ||
} | ||
} |
135 changes: 135 additions & 0 deletions
135
...s-stepfunctions-tasks/test/dynamodb/stringset-after-parallel.integ.snapshot/manifest.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
{ | ||
"version": "21.0.0", | ||
"artifacts": { | ||
"Tree": { | ||
"type": "cdk:tree", | ||
"properties": { | ||
"file": "tree.json" | ||
} | ||
}, | ||
"stringset-after-parallel.assets": { | ||
"type": "cdk:asset-manifest", | ||
"properties": { | ||
"file": "stringset-after-parallel.assets.json", | ||
"requiresBootstrapStackVersion": 6, | ||
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" | ||
} | ||
}, | ||
"stringset-after-parallel": { | ||
"type": "aws:cloudformation:stack", | ||
"environment": "aws://unknown-account/unknown-region", | ||
"properties": { | ||
"templateFile": "stringset-after-parallel.template.json", | ||
"validateOnSynth": false, | ||
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", | ||
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", | ||
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/30011aca79761d24d65d6f3f8af03bf4a54f58ac4a5fdbadcb2d1fb0fa225066.json", | ||
"requiresBootstrapStackVersion": 6, | ||
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", | ||
"additionalDependencies": [ | ||
"stringset-after-parallel.assets" | ||
], | ||
"lookupRole": { | ||
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", | ||
"requiresBootstrapStackVersion": 8, | ||
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" | ||
} | ||
}, | ||
"dependencies": [ | ||
"stringset-after-parallel.assets" | ||
], | ||
"metadata": { | ||
"/stringset-after-parallel/Table/Resource": [ | ||
{ | ||
"type": "aws:cdk:logicalId", | ||
"data": "TableCD117FA1" | ||
} | ||
], | ||
"/stringset-after-parallel/StateMachine/Role/Resource": [ | ||
{ | ||
"type": "aws:cdk:logicalId", | ||
"data": "StateMachineRoleB840431D" | ||
} | ||
], | ||
"/stringset-after-parallel/StateMachine/Role/DefaultPolicy/Resource": [ | ||
{ | ||
"type": "aws:cdk:logicalId", | ||
"data": "StateMachineRoleDefaultPolicyDF1E6607" | ||
} | ||
], | ||
"/stringset-after-parallel/StateMachine/Resource": [ | ||
{ | ||
"type": "aws:cdk:logicalId", | ||
"data": "StateMachine2E01A3A5" | ||
} | ||
], | ||
"/stringset-after-parallel/Service-principalMap": [ | ||
{ | ||
"type": "aws:cdk:logicalId", | ||
"data": "ServiceprincipalMap" | ||
} | ||
], | ||
"/stringset-after-parallel/BootstrapVersion": [ | ||
{ | ||
"type": "aws:cdk:logicalId", | ||
"data": "BootstrapVersion" | ||
} | ||
], | ||
"/stringset-after-parallel/CheckBootstrapVersion": [ | ||
{ | ||
"type": "aws:cdk:logicalId", | ||
"data": "CheckBootstrapVersion" | ||
} | ||
] | ||
}, | ||
"displayName": "stringset-after-parallel" | ||
}, | ||
"StringSetAfterParallelDefaultTestDeployAssert649ABBB9.assets": { | ||
"type": "cdk:asset-manifest", | ||
"properties": { | ||
"file": "StringSetAfterParallelDefaultTestDeployAssert649ABBB9.assets.json", | ||
"requiresBootstrapStackVersion": 6, | ||
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" | ||
} | ||
}, | ||
"StringSetAfterParallelDefaultTestDeployAssert649ABBB9": { | ||
"type": "aws:cloudformation:stack", | ||
"environment": "aws://unknown-account/unknown-region", | ||
"properties": { | ||
"templateFile": "StringSetAfterParallelDefaultTestDeployAssert649ABBB9.template.json", | ||
"validateOnSynth": false, | ||
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", | ||
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", | ||
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", | ||
"requiresBootstrapStackVersion": 6, | ||
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", | ||
"additionalDependencies": [ | ||
"StringSetAfterParallelDefaultTestDeployAssert649ABBB9.assets" | ||
], | ||
"lookupRole": { | ||
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", | ||
"requiresBootstrapStackVersion": 8, | ||
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" | ||
} | ||
}, | ||
"dependencies": [ | ||
"StringSetAfterParallelDefaultTestDeployAssert649ABBB9.assets" | ||
], | ||
"metadata": { | ||
"/StringSetAfterParallel/DefaultTest/DeployAssert/BootstrapVersion": [ | ||
{ | ||
"type": "aws:cdk:logicalId", | ||
"data": "BootstrapVersion" | ||
} | ||
], | ||
"/StringSetAfterParallel/DefaultTest/DeployAssert/CheckBootstrapVersion": [ | ||
{ | ||
"type": "aws:cdk:logicalId", | ||
"data": "CheckBootstrapVersion" | ||
} | ||
] | ||
}, | ||
"displayName": "StringSetAfterParallel/DefaultTest/DeployAssert" | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...est/dynamodb/stringset-after-parallel.integ.snapshot/stringset-after-parallel.assets.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"version": "21.0.0", | ||
"files": { | ||
"30011aca79761d24d65d6f3f8af03bf4a54f58ac4a5fdbadcb2d1fb0fa225066": { | ||
"source": { | ||
"path": "stringset-after-parallel.template.json", | ||
"packaging": "file" | ||
}, | ||
"destinations": { | ||
"current_account-current_region": { | ||
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", | ||
"objectKey": "30011aca79761d24d65d6f3f8af03bf4a54f58ac4a5fdbadcb2d1fb0fa225066.json", | ||
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" | ||
} | ||
} | ||
} | ||
}, | ||
"dockerImages": {} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.