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

null values are not allowed in templates when ResultPath=JsonPath.DISCARD #29164

Closed
ck-on-github opened this issue Feb 19, 2024 · 3 comments
Closed
Labels
@aws-cdk/aws-cloudformation Related to AWS CloudFormation bug This issue is a bug. effort/medium Medium work item – several days of effort p2

Comments

@ck-on-github
Copy link

Describe the bug

I am using the Python CDK to generate a CloudFormation template in json format.

cdk deploy of the json CloudFormation template generated using the code snippet:

StepFunctionsStartExecution(
    ...
    result_path=JsonPath.DISCARD
    ...
)

fails with

[/Resources/CfTemplate747CB3D5/Type/DefinitionString/Fn::Join/1/33] 'null' values are not allowed in templates

on aws-cdk-lib=2.70.0

Expected Behavior

Before aws-cdk-lib=2.70.0, the ResultPath in the json template looks like:

\"ResultPath\": null,

and CDK deploy succeeds.

Current Behavior

After aws-cdk-lib=2.70.0, the ResultPath in the json template looks like:

\"ResultPath\": \"",
       null, 
 "\",

and CDK deploy fails with 'null' values are not allowed in templates.

Reproduction Steps

CDK version 2.70.0 or higher.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.70.0

Framework Version

No response

Node.js Version

18.18.2

OS

Linux

Language

Python

Language Version

3.8.17

Other information

No response

@ck-on-github ck-on-github added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 19, 2024
@github-actions github-actions bot added the @aws-cdk/aws-cloudformation Related to AWS CloudFormation label Feb 19, 2024
@pahud
Copy link
Contributor

pahud commented Feb 20, 2024

Can you share a minimal full sample of your code that we can run in our environment? It's probably related to #28661 but we need more details about it.

@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 Feb 20, 2024
@ck-on-github
Copy link
Author

this was due to converting the StateGraph instance to json with json.dumps instead of using Stack.to_json_string.

Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
@aws-cdk/aws-cloudformation Related to AWS CloudFormation bug This issue is a bug. effort/medium Medium work item – several days of effort p2
Projects
None yet
Development

No branches or pull requests

2 participants