-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ec2-alpha): adding imports for SubnetV2 and VpcV2(WIP) (#31765)
### Issue # (if applicable) Tracking #30762. ### Reason for this change Allow users to define imports for a VPC or subnet defined outside current stack definition. ### Description of changes - Added new methods under VpcV2 and Subnet `VpcV2.fromVpcV2Attributes()` and `SubnetV2.fromSubnetV2Attributes()` - Added new L2 for VPCCidrBlock to allow import of secondary addresses. `VPCCidrBlock` - Added new integration test and unit test file to check import related functionality. - Updated Readme. - Fixed an earlier issue with subnet range check, fixed to include IPAM defined IPv4 address as well ### Description of how you validated changes Deployed and tested for below scenarios in account: 1. Import a VPC with primary IPv4 2. Import a subnet with primary IPv4 3. Import a VPC with multiple secondary IPv4 4. Import a VPC with Amazon provided IPV6 5. Import a VPC with Ipam provided IPv6/IPv4 7. Import subnet individually using fromSubnetV2attributes 8. Imported different type of multiple subnets 9. Add gateways/endpoint to imported vpc ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) BREAKING CHANGE: The new `VpcCidrBlock` L2 construct replaces `CfnVPCCidrBlock`. This change alters the logical ID of `AWS::EC2::VPCCidrBlock` resources in CloudFormation templates. Existing deployments will see errors like `CIDR range conflicts with x.xx.xx.xx/xx with association ID vpc-cidr-assoc-ABCD`. To resolve this, you must recreate your existing stacks to use the new module. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Showing
72 changed files
with
3,023 additions
and
700 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
{ | ||
"exclude": [ | ||
"from-method:@aws-cdk/aws-ec2-alpha.VpcV2", | ||
"attribute-tag:@aws-cdk/aws-ec2-alpha.RouteTable.routeTableId", | ||
"from-method:@aws-cdk/aws-ec2-alpha.SubnetV2", | ||
"from-method:@aws-cdk/aws-ec2-alpha.Route" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.