Skip to content

Conversation

shikha372
Copy link
Contributor

@shikha372 shikha372 commented Apr 9, 2025

Closes #.

Reason for this change

Cannot add multiple NATGW to current VPC construct as it is using the same construct id which cause conflict.

Description of changes

  • Fix the NATGW construct id to be unique using provided subnet.
  • Fix the current domain being set in EIP to be vpc instead of vpcId.
  • Fix the validation for subnet IP ranges as those can be unresolved token values referred in VPC construct using vpc.attr. .

Describe any new or updated permissions being added

NA

Description of how you validated changes

  • Added unit test and integration test for NATGW.
  • Added unit test for EIP

Checklist

BREAKING CHANGE: The logical ID for the NAT Gateway, defined using the addNatGateways method, will be changed, resulting in the NAT Gateway being recreated. Additionally, the domain for the Elastic IP (EIP) will be set to vpc, which will also trigger its recreation in the account.


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

@aws-cdk-automation aws-cdk-automation requested a review from a team April 9, 2025 23:00
@github-actions github-actions bot added the p2 label Apr 9, 2025
@shikha372 shikha372 changed the title feat(eks): pass additional helm chart values to aws-load-balancer-con… fix(ec2-alpha): add multiple NATGW to the VPC using addNatGateway method Apr 9, 2025
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Apr 9, 2025
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

(This review is outdated)

@aws-cdk-automation aws-cdk-automation dismissed their stale review April 10, 2025 23:38

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@shikha372
Copy link
Contributor Author

shikha372 commented Apr 10, 2025

BREAKING CHANGE: The logical ID for the NAT Gateway, defined using the addNatGateways method, will be changed, resulting in the NAT Gateway being recreated. Additionally, the domain for the Elastic IP (EIP) will be set to vpc, which will also trigger its recreation in the account.

Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

(This review is outdated)

@shikha372 shikha372 marked this pull request as ready for review April 14, 2025 16:12
@aws-cdk-automation aws-cdk-automation dismissed their stale review April 14, 2025 16:13

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Apr 14, 2025
@@ -451,7 +451,7 @@ export class NatGateway extends Resource implements IRouteTarget {
if (this.connectivityType === NatConnectivityType.PUBLIC) {
if (!props.allocationId) {
let eip = new CfnEIP(this, 'EIP', {
domain: props.vpc?.vpcId,
domain: 'vpc',
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we making this change?

Copy link
Contributor Author

@shikha372 shikha372 Apr 14, 2025

Choose a reason for hiding this comment

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

The only allowed values for this field is vpc | standard https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-eip.html#cfn-ec2-eip-address`
This was mistakenly added as vpcID initially, confirmed with @Leo10Gama .

Copy link
Contributor

@paulhcsun paulhcsun left a comment

Choose a reason for hiding this comment

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

lgtm

@paulhcsun
Copy link
Contributor

@Mergifyio update

Copy link
Contributor

mergify bot commented Apr 14, 2025

update

✅ Branch has been successfully updated

Copy link
Contributor

mergify bot commented Apr 14, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Copy link

codecov bot commented Apr 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.00%. Comparing base (1ab924c) to head (29f5d11).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #34094   +/-   ##
=======================================
  Coverage   84.00%   84.00%           
=======================================
  Files         121      121           
  Lines        6984     6984           
  Branches     1179     1179           
=======================================
  Hits         5867     5867           
  Misses       1005     1005           
  Partials      112      112           
Flag Coverage Δ
suite.unit 84.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk ∅ <ø> (∅)
packages/aws-cdk-lib/core 84.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 29f5d11
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

mergify bot commented Apr 14, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit ccd8de7 into main Apr 14, 2025
20 checks passed
@mergify mergify bot deleted the shikagg/ec2-alpha-add-multiple-natgw branch April 14, 2025 23:38
Copy link
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
contribution/core This is a PR that came from AWS. p2 pr/needs-maintainer-review This PR needs a review from a Core Team Member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants