Skip to content
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

fix(code): make CfnResource#_toCloudFormation null-safe #3121

Merged
merged 7 commits into from
Jul 1, 2019

Conversation

RomainMuller
Copy link
Contributor

The CfnResource#_toCloudFormation method creates a PostResolveToken
with a post-processor that was not ready to handle the absence of
Properties on the resolved value. It is however possible that
Properties are missing when an object is created with the default
configuration (e.g: by new sqs.CfnQueue(this, 'Queue');).

This change makes the post-processor function correctly handle
undefined in this case.

Related #3093


Please read the contribution guidelines and follow the pull-request checklist.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

The `CfnResource#_toCloudFormation` method creates a `PostResolveToken`
with a post-processor that was not ready to handle the absence of
`Properties` on the resolved value. It is however possible that
`Properties` are missing when an object is created with the default
configuration (e.g: by `new sqs.CfnQueue(this, 'Queue');`).

This change makes the post-processor function correctly handle
`undefined` in this case.

Related #3093
@RomainMuller RomainMuller requested a review from a team as a code owner June 28, 2019 09:17
@ghost ghost requested a review from rix0rrr June 28, 2019 09:18
Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yey!

Test?

@eladb
Copy link
Contributor

eladb commented Jul 1, 2019

@RomainMuller what's up with this?

@RomainMuller RomainMuller merged commit 71cb421 into master Jul 1, 2019
@RomainMuller RomainMuller deleted the rmuller/fix-cfnresource-tocloudformation branch July 1, 2019 13:31
RomainMuller added a commit that referenced this pull request Jul 1, 2019
The `CfnResource#_toCloudFormation` method creates a `PostResolveToken`
with a post-processor that was not ready to handle the absence of
`Properties` on the resolved value. It is however possible that
`Properties` are missing when an object is created with the default
configuration (e.g: by `new sqs.CfnQueue(this, 'Queue');`).

This change makes the post-processor function correctly handle
`undefined` in this case.

Related #3093
@NGL321 NGL321 added the contribution/core This is a PR that came from AWS. label Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants