question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Supported `null` properties are removed from CloudFormation template

See original GitHub issue

Discussed in https://github.com/serverless/serverless/discussions/10649

<div type='discussions-op-text'>

Originally posted by jack-c-tang February 7, 2022 Hi,

Based on the second note of the resource configuration document, the properties with null assignment are stripped before upload, because CloudFormation doesn’t allow them.

But CloudFormation template supports to include some transforms and macros that take those properties and transform to resources CFN allows. For example, AWS::Serverless is a transform CFN supports. The ResultPath specified in Definition property of AWS::Serverless::StateMachine resources accepts null value with certain purpose. Stripping them make the step functions not work as expected.

Should the strip function bypass resources that will be transformed? Or is there a better suggestion or workaround for this usage? Thanks.

Related PR: https://github.com/serverless/serverless/pull/10304 Related issue: https://github.com/serverless/serverless/issues/10279</div>

Example of a valid template, that hosts null values:

AWSTemplateFormatVersion: 2010-09-09
Description: Serverless transform resource with null assigned property
Transform: AWS::Serverless-2016-10-31
Resources:
  NullResultPathStateMachine:
    Type: AWS::Serverless::StateMachine
    Properties:
      Type: STANDARD
      Name: nullResultPathStateMachine
      Policies: arn:aws:iam::aws:policy/AWSStepFunctionsReadOnlyAccess
      Definition:
        StartAt: State1
        States:
          State1:
            Type: Pass
            Parameters:
              parameter: 'sample'
            ResultPath: null
            End: true

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:18 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
shheo042commented, Sep 14, 2022

Suffering same problem. ResultPath: null is stripped and the next state cannot receive input. Fix in https://github.com/serverless/serverless/pull/8975 might be stripping the supported null value. Is there any (temporary) workaround for this? I have to manually set ResultPath: null in AWS console currently.

2reactions
edmundcongcommented, Aug 2, 2022

any update on this? or possible workaround? the stripping of null means we can’t use ResultPath: null which is making our step function output exceed the 256k limit imposed by AWS

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting CloudFormation - AWS Documentation
When you create or update an AWS CloudFormation stack, your stack can fail due to invalid input parameters, unsupported resource property names, or...
Read more >
10 Solutions to Common CloudFormation Errors
8. Missing Required Properties. You've scoured the CloudFormation Template Reference Documentation and built your JSON or YAML file based on ...
Read more >
Removing Errors on CloudFormation Stack Creation
The CloudFormation template below uses a condition and a custom resource in order to not create anything. The custom resource NullResource will ...
Read more >
amazon.aws.cloudformation module – Create or delete an ...
Parameters can be found in the AWS documentation ... If a stacks fails to form, rollback will remove the stack. Choices: false ←...
Read more >
How to define a property that can be string or null in ...
This depends on the OpenAPI version. OpenAPI 3.1. Your example is valid in OpenAPI 3.1, which is fully compatible with JSON Schema 2020-12....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found