Skip to content

Commit

Permalink
fix(vpc-v2): fixing default scope id (#31102)
Browse files Browse the repository at this point in the history
### Issue # (if applicable)

Closes .

### Reason for this change

Fix current default scope ids for IPAM.

### Description of changes

Fix current default scope ids for IPAM..

### Description of how you validated changes

Integration test deployment

### 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)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
shikha372 authored Aug 14, 2024
1 parent a8b072c commit 0007a29
Show file tree
Hide file tree
Showing 20 changed files with 84 additions and 94 deletions.
5 changes: 5 additions & 0 deletions packages/@aws-cdk/aws-ec2-alpha/lib/ipam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,11 @@ class IpamScopeBase implements IIpamScopeBase {
readonly scopeType?: IpamScopeType,
) {
this.scopeType = IpamScopeType.DEFAULT;
if (!props.ipamScopeId) {
throw new Error('ipamScopeId is required');
} else {
this.scopeId = props.ipamScopeId;
}
}

/**
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
"Properties": {
"AddressFamily": "ipv6",
"AwsService": "ec2",
"IpamScopeId": "DefaultPublicScope",
"IpamScopeId": {
"Fn::GetAtt": [
"Ipam50346F82",
"PublicDefaultScopeId"
]
},
"Locale": "eu-west-2",
"PublicIpSource": "amazon"
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/@aws-cdk/aws-ec2-alpha/test/integ.subnet-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import * as vpc_v2 from '../lib/vpc-v2';
import * as ec2 from 'aws-cdk-lib/aws-ec2';
import { AddressFamily, AwsServiceName, IpCidr, Ipam, IpamPoolPublicIpSource, SubnetV2 } from '../lib';
//import { Ipv6Cidr } from '../lib';
import { IntegTest } from '@aws-cdk/integ-tests-alpha';
import * as cdk from 'aws-cdk-lib';
import { SubnetType } from 'aws-cdk-lib/aws-ec2';
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
"Type": "AWS::EC2::IPAMPool",
"Properties": {
"AddressFamily": "ipv4",
"IpamScopeId": "DefaultPrivateScope",
"IpamScopeId": {
"Fn::GetAtt": [
"IpamTestIpam6C9298EF",
"PrivateDefaultScopeId"
]
},
"Locale": "eu-central-1",
"ProvisionedCidrs": [
{
Expand All @@ -28,7 +33,12 @@
"Properties": {
"AddressFamily": "ipv6",
"AwsService": "ec2",
"IpamScopeId": "DefaultPublicScope",
"IpamScopeId": {
"Fn::GetAtt": [
"IpamTestIpam6C9298EF",
"PublicDefaultScopeId"
]
},
"Locale": "eu-central-1",
"PublicIpSource": "amazon"
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ec2-alpha/test/integ.vpc-v2-alpha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ new SubnetV2(stack, 'testsubnet', {
subnetType: SubnetType.PRIVATE_ISOLATED,
});

//validate ipv6
//Validate ipv6 IPAM
new SubnetV2(stack, 'validateIpv6', {
vpc,
ipv4CidrBlock: new IpCidr('10.3.0.0/24'),
Expand Down
Loading

0 comments on commit 0007a29

Please sign in to comment.