Skip to content

Commit 795fbc2

Browse files
committed
re-arrange ip-addresses functions
1 parent f16843c commit 795fbc2

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

packages/aws-cdk-lib/aws-ec2/lib/ip-addresses.ts

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -137,21 +137,6 @@ export interface AllocateCidrRequest {
137137
readonly requestedSubnets: RequestedSubnet[];
138138
}
139139

140-
/**
141-
* Request for subnet IPv6 CIDRs to be allocated for a VPC.
142-
*/
143-
export interface AllocateIpv6CidrRequest {
144-
/**
145-
* List of subnets allocated with IPv4 CIDRs
146-
*/
147-
readonly allocatedSubnets: AllocatedSubnet[];
148-
149-
/**
150-
* The IPv6 CIDRs to be allocated to the subnets
151-
*/
152-
readonly ipv6Cidrs: string[];
153-
}
154-
155140
/**
156141
* Request for IPv6 CIDR block to be split up.
157142
*/
@@ -173,6 +158,21 @@ export interface CreateIpv6CidrBlocksRequest {
173158
readonly sizeMask?: string,
174159
}
175160

161+
/**
162+
* Request for subnet IPv6 CIDRs to be allocated for a VPC.
163+
*/
164+
export interface AllocateIpv6CidrRequest {
165+
/**
166+
* List of subnets allocated with IPv4 CIDRs
167+
*/
168+
readonly allocatedSubnets: AllocatedSubnet[];
169+
170+
/**
171+
* The IPv6 CIDRs to be allocated to the subnets
172+
*/
173+
readonly ipv6Cidrs: string[];
174+
}
175+
176176
/**
177177
* CIDR Allocated Subnets
178178
*/
@@ -437,18 +437,18 @@ export interface IIpv6Addresses {
437437
amazonProvided: boolean,
438438

439439
/**
440-
* Allocates Subnets IPv6 CIDRs. Called by VPC when creating subnets with IPv6 enabled.
440+
* Split IPv6 CIDR block up for subnets.
441441
*
442442
* Note this is specific to the IPv6 CIDR.
443443
*/
444-
allocateSubnetsIpv6Cidr(input: AllocateIpv6CidrRequest): SubnetIpamOptions;
444+
createIpv6CidrBlocks(input: CreateIpv6CidrBlocksRequest): string[];
445445

446446
/**
447-
* Split IPv6 CIDR block up for subnets.
447+
* Allocates Subnets IPv6 CIDRs. Called by VPC when creating subnets with IPv6 enabled.
448448
*
449449
* Note this is specific to the IPv6 CIDR.
450450
*/
451-
createIpv6CidrBlocks(input: CreateIpv6CidrBlocksRequest): string[];
451+
allocateSubnetsIpv6Cidr(input: AllocateIpv6CidrRequest): SubnetIpamOptions;
452452
}
453453

454454
/**
@@ -466,6 +466,19 @@ class AmazonProvided implements IIpv6Addresses {
466466
this.amazonProvided = true;
467467
}
468468

469+
/**
470+
* Split IPv6 CIDR block up for subnets.
471+
*
472+
* Called by VPC when creating subnets with IPv6 enabled.
473+
*
474+
* Note this is specific to the IPv6 CIDR.
475+
*/
476+
createIpv6CidrBlocks(input: CreateIpv6CidrBlocksRequest): string[] {
477+
const sizeMask = input.sizeMask ?? '64'; // 128 - 64
478+
479+
return Fn.cidr(input.ipv6SelectedCidr, input.subnetCount, sizeMask);
480+
}
481+
469482
/**
470483
* Allocates Subnets IPv6 CIDRs. Called by VPC when creating subnets with IPv6 enabled.
471484
*
@@ -489,17 +502,4 @@ class AmazonProvided implements IIpv6Addresses {
489502
allocatedSubnets: allocatedSubnets,
490503
};
491504
}
492-
493-
/**
494-
* Split IPv6 CIDR block up for subnets.
495-
*
496-
* Called by VPC when creating subnets with IPv6 enabled.
497-
*
498-
* Note this is specific to the IPv6 CIDR.
499-
*/
500-
createIpv6CidrBlocks(input: CreateIpv6CidrBlocksRequest): string[] {
501-
const sizeMask = input.sizeMask ?? '64'; // 128 - 64
502-
503-
return Fn.cidr(input.ipv6SelectedCidr, input.subnetCount, sizeMask);
504-
}
505505
}

0 commit comments

Comments
 (0)