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: flowLogName property in FlowLog construct does not work #26370

Closed
tam0ri opened this issue Jul 14, 2023 · 2 comments · Fixed by #26371
Closed

ec2: flowLogName property in FlowLog construct does not work #26370

tam0ri opened this issue Jul 14, 2023 · 2 comments · Fixed by #26371
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud bug This issue is a bug. effort/medium Medium work item – several days of effort p2

Comments

@tam0ri
Copy link
Contributor

tam0ri commented Jul 14, 2023

Describe the bug

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

This is only assigned to physicalName here.

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

However, we can't define physical name for AWS::EC2::FlowLog resource. The pysical name for VPC Flow Logs is always automatically generated id.

So, currently flowLogName property is meaningless property.

Expected Behavior

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

flowlog-console

So, FlowLog L2 construct should add Name tag like VPC or Instance L2 construct.

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

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

Current Behavior

The value of flowLogName 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.FlowLog(this, 'FlowLog', {
      flowLogName: 'CustomFlowLogName',
      resourceType: ec2.FlowLogResourceType.fromVpc(vpc),
    });

Possible Solution

Adding Name tag with the value of flowLogName property.

Additional Information/Context

No response

CDK CLI Version

v2.87.0

Framework Version

No response

Node.js Version

v18.16.0

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 Jul 14, 2023
@github-actions github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Jul 14, 2023
@pahud
Copy link
Contributor

pahud commented Jul 14, 2023

Thank you for your PR.

@pahud pahud added p2 effort/medium Medium work item – several days of effort effort/small Small work item – less than a day of effort and removed effort/small Small work item – less than a day of effort needs-triage This issue or PR still needs to be triaged. labels Jul 14, 2023
@mergify mergify bot closed this as completed in #26371 Aug 3, 2023
mergify bot pushed a commit that referenced this issue Aug 3, 2023
…26371)

Currently, flowLogName property for FlowLog L2 is never referred in generated CloudFormation template. This PR solves the issue by adding Name tag with the value of flowLogName property.

Closes #26370

----

*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

github-actions bot commented Aug 3, 2023

⚠️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/medium Medium work item – several days of effort p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants