admin管理员组

文章数量:1302936

With this smallest example I could come up with:

from aws_cdk import aws_stepfunctions_tasks as tasks
from aws_cdk import aws_stepfunctions as sfn

states = tasks.GlueStartJobRun.jsonata(  # actual type does not matter, this is just have something to catch errors on
    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),
)

After having deploying with cdk, the catcher of the "Start Job" step does not have any output defined. I can see that even the cloudformation template does not have it. It is not a syntax error, though, and this is documented. Trying with a string or any other data type does not change the issue.

As I am using the latest aws-cdk-lib (2.178.1 at time of writing), I think this is a bug.

I think it should be possible to "manually" override this, with something like add_property_override but I cannot find a way.

How can I have the outputs I define in the the catcher?

With this smallest example I could come up with:

from aws_cdk import aws_stepfunctions_tasks as tasks
from aws_cdk import aws_stepfunctions as sfn

states = tasks.GlueStartJobRun.jsonata(  # actual type does not matter, this is just have something to catch errors on
    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),
)

After having deploying with cdk, the catcher of the "Start Job" step does not have any output defined. I can see that even the cloudformation template does not have it. It is not a syntax error, though, and this is documented. Trying with a string or any other data type does not change the issue.

As I am using the latest aws-cdk-lib (2.178.1 at time of writing), I think this is a bug.

I think it should be possible to "manually" override this, with something like add_property_override but I cannot find a way.

How can I have the outputs I define in the the catcher?

Share Improve this question asked Feb 10 at 15:01 GuillaumeGuillaume 2,9092 gold badges28 silver badges49 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

This was a bug in the cdk, now fixed. It works as expected.

本文标签: python 3xAWS step functioncdk cannot add output to catcherStack Overflow