Skip to content
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

aws-stepfuntions: ResultWriter support for bucket and prefix JSONPath #31171

Open
1 of 2 tasks
ReservedDeveloper opened this issue Aug 21, 2024 · 1 comment
Open
1 of 2 tasks
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

@ReservedDeveloper
Copy link

Describe the feature

Currently, the CDK generates the following parameter output for ResultWriter:

"ResultWriter" {
  "Resource": "arn:aws:states:::s3:putObject",
  "Parameters": {
    "Bucket": "my-bucket",
    "Prefix": "my-prefix",
  }
}

However, when browsing the State Machine GUI, there is an option to specify bucket & prefix via JSONPath at runtime, which generates the following

"ResultWriter" {
  "Resource": "arn:aws:states:::s3:putObject",
  "Parameters": {
    "Bucket.$": "$.my_bucket_path",
    "Prefix.$": "$.my_prefix_path",
  }
}

Use Case

Would like to be able to leverage the path varieties for giving a state-driven prefix to make it easier for filtering per-run results

Proposed Solution

I would anticipate this would have a very similar approach to the recently submitted #30836 due to similar constraints around existing bucket and prefix parameters, and similar area of impact.

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.151.0

Environment details (OS name and version, etc.)

Any

@ReservedDeveloper ReservedDeveloper added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 21, 2024
@github-actions github-actions bot added the @aws-cdk/aws-stepfunctions Related to AWS StepFunctions label Aug 21, 2024
@ashishdhingra ashishdhingra self-assigned this Aug 23, 2024
@ashishdhingra ashishdhingra added p2 effort/medium Medium work item – several days of effort investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Aug 23, 2024
@ashishdhingra
Copy link
Contributor

Looking at the state machine GUI for Export location, when option Get bucket name and prefix at runtime from state input for an S3 bucket is selected, has textbox for specifying S3 bucket and prefix with placeholders $.myStateInput.key and $.myStateInput.Prefix respectively:
Screenshot 2024-08-23 at 1 54 48 PM

Specifying these values renders the following JSON in code:

...
      "ResultWriter": {
        "Resource": "arn:aws:states:::s3:putObject",
        "Parameters": {
          "Bucket.$": "$.myStateInput.key",
          "Prefix.$": "$.myStateInput.Prefix"
        }
      }
...

@ReservedDeveloper Feel free to contribute PR which could be reviewed by the team.

@ashishdhingra ashishdhingra removed the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Aug 23, 2024
@ashishdhingra ashishdhingra removed their assignment Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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