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

cdk synth : prints undefined for portless protocols #27874

Open
john-aws opened this issue Nov 7, 2023 · 1 comment
Open

cdk synth : prints undefined for portless protocols #27874

john-aws opened this issue Nov 7, 2023 · 1 comment
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud bug This issue is a bug. effort/small Small work item – less than a day of effort p2 package/tools Related to AWS CDK Tools or CLI

Comments

@john-aws
Copy link

john-aws commented Nov 7, 2023

Describe the bug

cdk synth prints a table of resources. For security groups, this table comprises:

  • Group
  • Dir(ection)
  • Protocol
  • Peer

The protocol printed for GRE is 47 undefined. At a guess, it is printing the protocol name followed by the uninitialized port number. Because GRE, as with numerous other protocols, has no concepts of ports, it would be better to simply print 47 or ideally some variant of GRE (47).

Expected Behavior

Expected security group with inbound protocol 47 (GRE) printout:

┌───┬─────────────────────────────────┬─────┬──────────────┬──────────────────────┐
│   │ Group                           │ Dir │ Protocol     │ Peer                 │
├───┼─────────────────────────────────┼─────┼──────────────┼──────────────────────┤
│ + │ ${sg1.GroupId}                  │ In  │ All ICMP     │ Everyone (IPv4)      │
│ + │ ${sg1.GroupId}                  │ In  │ TCP 22       │ Everyone (IPv4)      │
│ + │ ${sg1.GroupId}                  │ In  │ GRE 47       │ ${sg2.GroupId}       │
├───┼─────────────────────────────────┼─────┼──────────────┼──────────────────────┤

Current Behavior

Example of security group with inbound protocol 47 (GRE) allowed:

┌───┬─────────────────────────────────┬─────┬──────────────┬──────────────────────┐
│   │ Group                           │ Dir │ Protocol     │ Peer                 │
├───┼─────────────────────────────────┼─────┼──────────────┼──────────────────────┤
│ + │ ${sg1.GroupId}                  │ In  │ All ICMP     │ Everyone (IPv4)      │
│ + │ ${sg1.GroupId}                  │ In  │ TCP 22       │ Everyone (IPv4)      │
│ + │ ${sg1.GroupId}                  │ In  │ 47 undefined │ ${sg2.GroupId}       │
├───┼─────────────────────────────────┼─────┼──────────────┼──────────────────────┤

Reproduction Steps

Pre-create an ec2.VPC and ec2.SecurityGroup and associate the following ingress rule with the latter:

    const gre_ingress= new ec2.CfnSecurityGroupIngress(this, "gre01", {
      ipProtocol: "47",
      description: "Allow inbound GRE",
      cidrIp: "192.168.1.0/24",
      groupId: "yyy",
    });

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.104.0

Framework Version

No response

Node.js Version

v18.17.1

OS

Max OS X Sonoma

Language

TypeScript

Language Version

No response

Other information

No response

@john-aws john-aws added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 7, 2023
@github-actions github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Nov 7, 2023
@john-aws john-aws changed the title deploy : prints undefined for portless protocols cdk synth : prints undefined for portless protocols Nov 7, 2023
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Nov 7, 2023
@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Nov 7, 2023
@khushail
Copy link
Contributor

khushail commented Nov 7, 2023

thanks @john-aws for reporting this.

@khushail khushail added p2 effort/small Small work item – less than a day of effort and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud bug This issue is a bug. effort/small Small work item – less than a day of effort p2 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

No branches or pull requests

2 participants