Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

(step-functions): Dynamic passing of bucket and prefix to result writer of distributed map #32687

Open
2 tasks
Nicolas-SB opened this issue Dec 30, 2024 · 1 comment
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@Nicolas-SB
Copy link

Nicolas-SB commented Dec 30, 2024

Describe the feature

Analogous to #29409, which was solved in #31619, I would like to pass sfn.JsonPaths to sfn.ResultWriter(bucket=[...], prefix=[...]). Currently I have to know the bucket and can not read it dynamically from the input event.

Use Case

I want to define my state machine using CDK and use all features of the Distributed Map

Proposed Solution

Create a Result Writer that can take a string in place of a bucket.

Example cdk code in python:

my_map = sfn.DistributedMap(
    scope=self,
    id="my_id",
    item_reader=sfn.S3JsonItemReader(
        bucket_name_path=sfn.JsonPath.string_at("$.manifest_bucket"),
        key=sfn.JsonPath.string_at("$.input_manifest_key"),
    ),
    result_writer=sfn.ResultWriter(
        bucket_name_path=sfn.JsonPath.string_at("$.manifest_bucket"),
        prefix=sfn.JsonPath.string_at("$.distributed_map_result_prefix"),
    ),
)

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.173.2

Environment details (OS name and version, etc.)

macOS Sequoia 15.2

@Nicolas-SB Nicolas-SB added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Dec 30, 2024
@github-actions github-actions bot added the @aws-cdk/aws-stepfunctions Related to AWS StepFunctions label Dec 30, 2024
@pahud
Copy link
Contributor

pahud commented Dec 30, 2024

Thank you for the feature request. We welcome and appreciate your PR for this.

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Dec 30, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

2 participants