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

@aws-cdk/cloudformation-diff: this.ipProtocol.toUpperCase is not a function #28021

Closed
gastonsilva opened this issue Nov 16, 2023 · 2 comments · Fixed by #28023
Closed

@aws-cdk/cloudformation-diff: this.ipProtocol.toUpperCase is not a function #28021

gastonsilva opened this issue Nov 16, 2023 · 2 comments · Fixed by #28023
Labels
@aws-cdk/cloudformation-diff bug This issue is a bug. effort/medium Medium work item – several days of effort p2

Comments

@gastonsilva
Copy link
Contributor

gastonsilva commented Nov 16, 2023

Describe the bug

When running cdk diff over a processed cloudformation template (existing stack), some rule ipProtocol might be -1 (as number) which produces the exception this.ipProtocol.toUpperCase is not a function

Expected Behavior

Display diff normally

Current Behavior

cdk diff throws this.ipProtocol.toUpperCase is not a function

Reproduction Steps

  • Deploy a cloudformation template with a security group and a rule that has a -1 in the ipProtocol
  • Import the same cloudformation template in a stack (with the same name) using cloudformation-include.CfnInclude
  • Run cdk diff

Possible Solution

This:

this.ipProtocol = ruleObject.IpProtocol || '*unknown*';

Should be replaced by this:

this.ipProtocol = ruleObject.IpProtocol?.toString() || '*unknown*';

Additional Information/Context

No response

CDK CLI Version

2.98.0

Framework Version

No response

Node.js Version

18

OS

Ubuntu 22.04.3 LTS

Language

TypeScript

Language Version

No response

Other information

No response

@pahud
Copy link
Contributor

pahud commented Nov 16, 2023

Thank you for your report. We'll review your PR when it's ready.

@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 Nov 16, 2023
@mergify mergify bot closed this as completed in #28023 Nov 21, 2023
mergify bot pushed a commit that referenced this issue Nov 21, 2023
…ction` when `ipProtocol` is a number (#28023)

Fix the describe protocol method when running a diff with a processed existing cloudformation template that has a security group rule with ipprotocol = -1

Closes #28021

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
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.

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

Successfully merging a pull request may close this issue.

2 participants