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

ec2: networkAclName property in NetworkAcl construct does not work #26897

Closed
tam0ri opened this issue Aug 26, 2023 · 2 comments · Fixed by #26898
Closed

ec2: networkAclName property in NetworkAcl construct does not work #26897

tam0ri opened this issue Aug 26, 2023 · 2 comments · Fixed by #26898
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

Comments

@tam0ri
Copy link
Contributor

tam0ri commented Aug 26, 2023

Describe the bug

NetworkAcl L2 construct has networkAclName property.
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.NetworkAcl.html

This is only assigned to physicalName here.

super(scope, id, {
physicalName: props.networkAclName,
});

However, we can't define physical name for AWS::EC2::NetworkAcl resource. The physical name for Network ACL is always automatically generated id.

So, currently networkAclName property is meaningless property. This issue is similar to #26370.

Expected Behavior

In VPC console, a tag value for Name key is shown in Name column as below.
vpc-console-acl-name

So, NetworkAcl L2 construct should add Name tag like Vpc or FlowLog L2 construct.

Tags.of(this).add(NAME_TAG, props.vpcName || this.node.path);

Tags.of(this).add(NAME_TAG, props.flowLogName || this.node.path);

Current Behavior

The value of networkAclName property is never referred in generated CloudFormation template.

Reproduction Steps

We can reproduce it with the following snippet.

    const vpc = ec2.Vpc.fromLookup(this, 'Vpc', {
      isDefault: true,
    });

    new ec2.NetworkAcl(stack, 'MyNetworkAcl', {
      vpc: vpc,
      networkAclName: 'CustomNetworkAclName',
  });

Possible Solution

Adding Name tag with the value of networkAclName property.

Additional Information/Context

No response

CDK CLI Version

v2.93.0

Framework Version

No response

Node.js Version

v18.17.1

OS

Amazon Linux 2

Language

Typescript

Language Version

No response

Other information

No response

@tam0ri tam0ri added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 26, 2023
@github-actions github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Aug 26, 2023
@peterwoodworth
Copy link
Contributor

Thanks for the report and PR, makes sense

@peterwoodworth peterwoodworth added p2 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels Aug 28, 2023
@mergify mergify bot closed this as completed in #26898 Aug 29, 2023
mergify bot pushed a commit that referenced this issue Aug 29, 2023
Currently, networkAclName property for NetworkAcl L2 is never referred in generated CloudFormation template. This PR solves the issue by adding Name tag with the value of networkAclName property. This fix is similar to #26371

Closes #26897

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
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/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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants