-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
@aws-cdk/aws-stepfunctionsRelated to AWS StepFunctionsRelated to AWS StepFunctionsbugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp1
Description
Describe the bug
When generating a state with cdk, the outputs of a catcher, although syntactically present in aws_cdk, are not generated.
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Version
No response
Expected Behavior
In the template created by synth, have the output field present.
Current Behavior
This is the subset of the yaml template printed out after synth:
StatemachineDEF8448E:
Type: AWS::StepFunctions::StateMachine
Properties:
DefinitionString:
Fn::Join:
- ""
- - '{"StartAt":"Start_job","States":{"Start_job":{"QueryLanguage":"JSONata","End":true,"Catch":[{"ErrorEquals":["States.ALL"],"Next":"boom"}],"Type":"Task","Arguments":{"JobName":"{% $states.input %}","NotificationProperty":null},"Resource":"arn:'
- Ref: AWS::Partition
- :states:::glue:startJobRun"},"boom":{"Type":"Fail","QueryLanguage":"JSONata"}},"QueryLanguage":"JSONPath"}Reproduction Steps
import aws_cdk as core
from aws_cdk import aws_stepfunctions_tasks as tasks
from aws_cdk import aws_stepfunctions as sfn
class StateMachine(core.Stack):
def __init__(self, scope: core.App, id: str, **kwargs) -> None:
super().__init__(scope, id, **kwargs)
states = tasks.GlueStartJobRun.jsonata( # actual type does not matter, this is just to have something to add a catcher to
self,
"Start_job",
glue_job_name="{% $states.input %}",
).add_catch(
sfn.Fail.jsonata(self, "boom"),
errors=["States.ALL"],
outputs="a string", # Not appearing!
)
sfn.StateMachine(
self,
"State_machine",
query_language=sfn.QueryLanguage.JSON_PATH,
definition_body=sfn.ChainDefinitionBody.from_chainable(states),
)
app = core.App()
StateMachine(app, "StateMachineStack")
app.synth()Possible Solution
No response
Additional Information/Context
I tried with different types of outputs, and jsonata vs jsonpath, to no avail.
I wonder as well why the comment field of the catcher is not valid.
CDK CLI Version
2.178.1 (build ae342cb)
Framework Version
No response
Node.js Version
22.9.0
OS
MacOs Sequoi 15.3
Language
Python
Language Version
3.12.8
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-stepfunctionsRelated to AWS StepFunctionsRelated to AWS StepFunctionsbugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp1