-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
stepfunctions: easy access to fields in execution context object #25415
Comments
Thanks for the request, we'll probably need contributor support for this feature to be realized |
I can help with this if no one is already working on this Just for clarification: Considering the example JSON for context object {
"Execution": {
"Id": "arn:aws:states:us-east-1:123456789012:execution:stateMachineName:executionName",
"Input": {
"key": "value"
},
"Name": "executionName",
"RoleArn": "arn:aws:iam::123456789012:role...",
"StartTime": "2019-03-26T20:14:13.192Z"
},
"State": {
"EnteredTime": "2019-03-26T20:14:13.192Z",
"Name": "Test",
"RetryCount": 3
},
"StateMachine": {
"Id": "arn:aws:states:us-east-1:123456789012:stateMachine:stateMachineName",
"Name": "name"
},
"Task": {
"Token": "h7XRiCdLtd/83p1E0dMccoxlzFhglsdkzpK9mBVKZsp7d9yrT1W"
}
} Assuming that we have to implement functions for the below fields. Let me know if there needs to be any additions/deletions to the below list.
Need clarification for the questions highlighted above regarding the types the functions should return. Cheers, |
This PR adds additional getters to allow easy access to context object fields. We currently have getters allowing easy access to the entire context object and the context object task token field. This adds getters for the following additional context object fields: - Execution id - Execution input - Execution name - Execution role arn - Execution start time - State entered time - State name - State retry count - State machine id - State machine name Closes #25415 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the feature
Add functions for accessing fields like
name
orid
from the execution context object. We already have a function for accessing the Task Token:aws-cdk/packages/aws-cdk-lib/aws-stepfunctions/lib/fields.ts
Line 75 in 96bb8ce
Use Case
For accessing the task token, we can do something like this:
However, when it comes to accessing something like the name of the Execution, we have to do something like this:
Proposed Solution
Add functions for getting all of the remaining fields from the context object.
Other Information
No response
Acknowledgements
CDK version used
2.72.0
Environment details (OS name and version, etc.)
macOS 12.6.5
The text was updated successfully, but these errors were encountered: