stepfunctions: support dynamic bucket in Map ItemReader
Describe the feature
Goal is to allow using JsonPath for IItemReader properties when defining a Map.
For now, interface IItemReader defines bucket field as type IBucket.
But from a CFN perspective we only need a bucket name.
Using IBucket blocks users from using JsonPath as dynamic bucket name.
Example:
const distributedMap = new sfn.DistributedMap(this, 'Distributed Map State', {
itemReader: new sfn.S3JsonItemReader({
bucket: JsonPath.stringAt('$.myBucket'),
key: JsonPath.stringAt('$.myKey'),
}),
// ...
});
"ItemReader": {
"Resource": "arn:aws:states:::s3:getObject",
"ReaderConfig": {
"InputType": "JSON"
},
"Parameters": {
"Bucket.$": "$.myBucket",
"Key.$": "$.myKey"
}
}
Use Case
Using the provided construct instead of a CustomState for DistributedMap.
Proposed Solution
Simply using string instead of IBucket (possibly accepting both if necessary ?)
Other Information
No response
Acknowledgements
- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
CDK version used
2.162.1
Environment details (OS name and version, etc.)
macOS 13.5
Hi @gael-ft , thanks for reaching out.
I found a previous similar issue reg the support of Dynamic bucket in Map ItemReader - https://github.com/aws/aws-cdk/issues/29409 and PR seems to be merged 4 days ago -https://github.com/aws/aws-cdk/pull/31619
Please let me know if that works as per your usecase.
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.
Hello @khushail,
Ok thanks for linking, didn't find it ... Looks to be release with in v2.163.
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.