Skip to content

Commit

Permalink
fix(vpc): fixing default scope id
Browse files Browse the repository at this point in the history
  • Loading branch information
shikha372 committed Aug 14, 2024
1 parent 94b68d7 commit 8b007d2
Show file tree
Hide file tree
Showing 18 changed files with 83 additions and 92 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.

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.

16 changes: 12 additions & 4 deletions packages/@aws-cdk/aws-ec2-alpha/test/ipam.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ describe('IPAM Test', () => {
'AWS::EC2::IPAMPool',
{
AddressFamily: 'ipv6',
IpamScopeId: 'DefaultPublicScope',
IpamScopeId: {
"Fn::GetAtt": [ "Ipam50346F82", "PublicDefaultScopeId" ]
},
Locale: 'us-west-2',
},
); //End Template
Expand All @@ -69,7 +71,9 @@ describe('IPAM Test', () => {
'AWS::EC2::IPAMPool',
{
AddressFamily: 'ipv4',
IpamScopeId: 'DefaultPrivateScope',
IpamScopeId: {
"Fn::GetAtt": [ "Ipam50346F82", "PrivateDefaultScopeId" ]
},
Locale: 'us-west-2',
},
); //End Template
Expand Down Expand Up @@ -97,7 +101,9 @@ describe('IPAM Test', () => {
Type: 'AWS::EC2::IPAMPool',
Properties: {
AddressFamily: 'ipv6',
IpamScopeId: 'DefaultPublicScope',
IpamScopeId: {
"Fn::GetAtt": [ "TestIpamDBF92BA8", "PublicDefaultScopeId" ]
},
Locale: 'us-west-2',
},
},
Expand Down Expand Up @@ -129,7 +135,9 @@ describe('IPAM Test', () => {
Type: 'AWS::EC2::IPAMPool',
Properties: {
AddressFamily: 'ipv6',
IpamScopeId: 'DefaultPublicScope',
IpamScopeId: {
"Fn::GetAtt": [ "TestIpamDBF92BA8", "PublicDefaultScopeId" ]
},
Locale: 'us-west-2',
},
},
Expand Down
Loading

0 comments on commit 8b007d2

Please sign in to comment.