From 50f0b32d18cf4bb2560c3f1c539f962b1bec860e Mon Sep 17 00:00:00 2001 From: Yathi <511386+yuth@users.noreply.github.com> Date: Tue, 8 Mar 2022 17:14:29 -0800 Subject: [PATCH 1/5] refactor: update enum types to remove duplicate member values CDK has some enums which use the same value for different enum members. This is done to support friendly names for EC2 instance and Subnet type. Having same value for differnt members causes the typescript compiler to ignore the members with same value and causes JSII not to generate the enum members in other languages. To fix this [JSII will throw an error](https://github.com/aws/jsii/pull/3412) when enum members have the same value. Updating CDK code to ensure the build pass when this change lands in JSII re #https://github.com/aws/jsii/pull/3412 --- .../aws-apigatewayv2/lib/http/vpc-link.ts | 2 +- .../@aws-cdk/aws-ec2/lib/instance-types.ts | 305 +++++++++++++----- .../@aws-cdk/aws-ec2/lib/machine-image.ts | 19 +- packages/@aws-cdk/aws-ec2/lib/port.ts | 16 +- packages/@aws-cdk/aws-ec2/lib/util.ts | 8 +- packages/@aws-cdk/aws-ec2/lib/vpc.ts | 16 +- .../@aws-cdk/aws-ec2/lib/windows-versions.ts | 26 +- .../@aws-cdk/aws-ec2/test/instance.test.ts | 21 +- .../@aws-cdk/aws-ec2/test/userdata.test.ts | 2 +- .../lib/base/scheduled-task-base.ts | 2 +- .../@aws-cdk/aws-eks-legacy/lib/cluster.ts | 2 +- packages/@aws-cdk/aws-eks/lib/cluster.ts | 4 +- .../@aws-cdk/aws-eks/lib/fargate-profile.ts | 2 +- .../lib/load-balancer.ts | 2 +- .../@aws-cdk/aws-elasticsearch/lib/domain.ts | 2 +- .../aws-events-targets/lib/ecs-task.ts | 2 +- packages/@aws-cdk/aws-neptune/lib/cluster.ts | 2 +- .../@aws-cdk/aws-neptune/lib/subnet-group.ts | 2 +- .../aws-opensearchservice/lib/domain.ts | 2 +- packages/@aws-cdk/aws-redshift/lib/cluster.ts | 2 +- .../@aws-cdk/aws-redshift/lib/subnet-group.ts | 2 +- .../lib/ecs/run-task.ts | 2 +- packages/aws-cdk-lib/package.json | 4 +- packages/aws-cdk/does-not-exist.json | 1 + .../pkglint/test/temp5Tmm1x/README.md | 31 ++ 25 files changed, 353 insertions(+), 126 deletions(-) create mode 100644 packages/aws-cdk/does-not-exist.json create mode 100644 tools/@aws-cdk/pkglint/test/temp5Tmm1x/README.md diff --git a/packages/@aws-cdk/aws-apigatewayv2/lib/http/vpc-link.ts b/packages/@aws-cdk/aws-apigatewayv2/lib/http/vpc-link.ts index 27a98085e334e..c9a13e08d31ea 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/lib/http/vpc-link.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/lib/http/vpc-link.ts @@ -99,7 +99,7 @@ export class VpcLink extends Resource implements IVpcLink { this.vpcLinkId = cfnResource.ref; - const { subnets } = props.vpc.selectSubnets(props.subnets ?? { subnetType: ec2.SubnetType.PRIVATE }); + const { subnets } = props.vpc.selectSubnets(props.subnets ?? { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT }); this.addSubnets(...subnets); if (props.securityGroups) { diff --git a/packages/@aws-cdk/aws-ec2/lib/instance-types.ts b/packages/@aws-cdk/aws-ec2/lib/instance-types.ts index 323af5d58a690..a1a8526872705 100644 --- a/packages/@aws-cdk/aws-ec2/lib/instance-types.ts +++ b/packages/@aws-cdk/aws-ec2/lib/instance-types.ts @@ -11,7 +11,7 @@ export enum InstanceClass { /** * Standard instances, 3rd generation */ - STANDARD3 = 'm3', + STANDARD3 = 'standard3', /** * Standard instances, 3rd generation @@ -21,7 +21,7 @@ export enum InstanceClass { /** * Standard instances, 4th generation */ - STANDARD4 = 'm4', + STANDARD4 = 'standard4', /** * Standard instances, 4th generation @@ -31,7 +31,7 @@ export enum InstanceClass { /** * Standard instances, 5th generation */ - STANDARD5 = 'm5', + STANDARD5 = 'standard5', /** * Standard instances, 5th generation @@ -41,7 +41,7 @@ export enum InstanceClass { /** * Standard instances with local NVME drive, 5th generation */ - STANDARD5_NVME_DRIVE = 'm5d', + STANDARD5_NVME_DRIVE = 'standard5-nvme-drive', /** * Standard instances with local NVME drive, 5th generation @@ -51,7 +51,7 @@ export enum InstanceClass { /** * Standard instances based on AMD EPYC, 5th generation */ - STANDARD5_AMD = 'm5a', + STANDARD5_AMD = 'standard5-amd', /** * Standard instances based on AMD EPYC, 5th generation @@ -61,7 +61,7 @@ export enum InstanceClass { /** * Standard instances based on AMD EPYC with local NVME drive, 5th generation */ - STANDARD5_AMD_NVME_DRIVE = 'm5ad', + STANDARD5_AMD_NVME_DRIVE = 'standard5-amd-nvme-drive', /** * Standard instances based on AMD EPYC with local NVME drive, 5th generation @@ -71,7 +71,7 @@ export enum InstanceClass { /** * Standard instances for high performance computing, 5th generation */ - STANDARD5_HIGH_PERFORMANCE = 'm5n', + STANDARD5_HIGH_PERFORMANCE = 'standard5-high-performance', /** * Standard instances for high performance computing, 5th generation @@ -81,7 +81,7 @@ export enum InstanceClass { /** * Standard instances with local NVME drive for high performance computing, 5th generation */ - STANDARD5_NVME_DRIVE_HIGH_PERFORMANCE = 'm5dn', + STANDARD5_NVME_DRIVE_HIGH_PERFORMANCE = 'standard5-nvme-drive-high-performance', /** * Standard instances with local NVME drive for high performance computing, 5th generation @@ -91,7 +91,7 @@ export enum InstanceClass { /** * Standard instances with high memory and compute capacity based on Intel Xeon Scalable (Cascade Lake) processors, 5nd generation */ - STANDARD5_HIGH_COMPUTE = 'm5zn', + STANDARD5_HIGH_COMPUTE = 'standard5-high-compute', /** * Standard instances with high memory and compute capacity based on Intel Xeon Scalable (Cascade Lake) processors, 5nd generation @@ -101,7 +101,7 @@ export enum InstanceClass { /** * Memory optimized instances, 3rd generation */ - MEMORY3 = 'r3', + MEMORY3 = 'memory3', /** * Memory optimized instances, 3rd generation @@ -111,7 +111,7 @@ export enum InstanceClass { /** * Memory optimized instances, 4th generation */ - MEMORY4 = 'r4', + MEMORY4 = 'memory4', /** * Memory optimized instances, 4th generation @@ -121,7 +121,7 @@ export enum InstanceClass { /** * Memory optimized instances, 5th generation */ - MEMORY5 = 'r5', + MEMORY5 = 'memory5', /** * Memory optimized instances, 5th generation @@ -131,7 +131,7 @@ export enum InstanceClass { /** * Memory optimized instances, 6th generation with Intel Xeon Scalable processors (3rd generation processors code named Ice Lake) */ - MEMORY6_INTEL = 'r6i', + MEMORY6_INTEL = 'memory6-intel', /** * Memory optimized instances, 6th generation with Intel Xeon Scalable processors (3rd generation processors code named Ice Lake) @@ -141,7 +141,7 @@ export enum InstanceClass { /** * Memory optimized instances for high performance computing, 5th generation */ - MEMORY5_HIGH_PERFORMANCE = 'r5n', + MEMORY5_HIGH_PERFORMANCE = 'memory5-high-performance', /** * Memory optimized instances for high performance computing, 5th generation @@ -151,7 +151,7 @@ export enum InstanceClass { /** * Memory optimized instances with local NVME drive, 5th generation */ - MEMORY5_NVME_DRIVE = 'r5d', + MEMORY5_NVME_DRIVE = 'memory5-nvme-drive', /** * Memory optimized instances with local NVME drive, 5th generation @@ -161,7 +161,7 @@ export enum InstanceClass { /** * Memory optimized instances with local NVME drive for high performance computing, 5th generation */ - MEMORY5_NVME_DRIVE_HIGH_PERFORMANCE = 'r5dn', + MEMORY5_NVME_DRIVE_HIGH_PERFORMANCE = 'memory5-nvme-drive-high-performance', /** * Memory optimized instances with local NVME drive for high performance computing, 5th generation @@ -171,7 +171,7 @@ export enum InstanceClass { /** * Memory optimized instances based on AMD EPYC, 5th generation */ - MEMORY5_AMD = 'r5a', + MEMORY5_AMD = 'memory5-amd', /** * Memory optimized instances based on AMD EPYC, 5th generation @@ -181,12 +181,12 @@ export enum InstanceClass { /** * Memory optimized instances based on AMD EPYC with local NVME drive, 5th generation */ - MEMORY5_AMD_NVME_DRIVE = 'r5ad', + MEMORY5_AMD_NVME_DRIVE = 'memory5-amd-nvme-drive', /** * High memory instances (6TB) based on Intel Xeon Platinum 8176M (Skylake) processors, 1st generation */ - HIGH_MEMORY_6TB_1 = 'u-6tb1', + HIGH_MEMORY_6TB_1 = 'high-memory-6tb-1', /** * High memory instances (6TB) based on Intel Xeon Platinum 8176M (Skylake) processors, 1st generation @@ -196,7 +196,7 @@ export enum InstanceClass { /** * High memory instances (9TB) based on Intel Xeon Platinum 8176M (Skylake) processors, 1st generation */ - HIGH_MEMORY_9TB_1 = 'u-9tb1', + HIGH_MEMORY_9TB_1 = 'high-memory-9tb-1', /** * High memory instances (9TB) based on Intel Xeon Platinum 8176M (Skylake) processors, 1st generation @@ -206,7 +206,7 @@ export enum InstanceClass { /** * High memory instances (12TB) based on Intel Xeon Platinum 8176M (Skylake) processors, 1st generation */ - HIGH_MEMORY_12TB_1 = 'u-12tb1', + HIGH_MEMORY_12TB_1 = 'high-memory-12tb-1', /** * High memory instances (12TB) based on Intel Xeon Platinum 8176M (Skylake) processors, 1st generation @@ -216,7 +216,7 @@ export enum InstanceClass { /** * High memory instances (18TB) based on Intel Xeon Scalable (Cascade Lake) processors, 1st generation */ - HIGH_MEMORY_18TB_1 = 'u-18tb1', + HIGH_MEMORY_18TB_1 = 'high-memory-18tb-1', /** * High memory instances (18TB) based on Intel Xeon Scalable (Cascade Lake) processors, 1st generation @@ -226,7 +226,7 @@ export enum InstanceClass { /** * High memory instances (24TB) based on Intel Xeon Scalable (Cascade Lake) processors, 1st generation */ - HIGH_MEMORY_24TB_1 = 'u-24tb1', + HIGH_MEMORY_24TB_1 = 'high-memory-24tb-1', /** * High memory instances (24TB) based on Intel Xeon Scalable (Cascade Lake) processors, 1st generation @@ -241,7 +241,7 @@ export enum InstanceClass { /** * Memory optimized instances that are also EBS-optimized, 5th generation */ - MEMORY5_EBS_OPTIMIZED = 'r5b', + MEMORY5_EBS_OPTIMIZED = 'memory5-ebs-optimized', /** * Memory optimized instances that are also EBS-optimized, 5th generation @@ -251,7 +251,7 @@ export enum InstanceClass { /** * Memory optimized instances, 6th generation with Graviton2 processors */ - MEMORY6_GRAVITON = 'r6g', + MEMORY6_GRAVITON = 'memory6-graviton', /** * Memory optimized instances, 6th generation with Graviton2 processors @@ -261,7 +261,7 @@ export enum InstanceClass { /** * Memory optimized instances, 6th generation with Graviton2 processors and local NVME drive */ - MEMORY6_GRAVITON2_NVME_DRIVE = 'r6gd', + MEMORY6_GRAVITON2_NVME_DRIVE = 'memory6-graviton2-nvme-drive', /** * Memory optimized instances, 6th generation with Graviton2 processors and local NVME drive @@ -271,7 +271,7 @@ export enum InstanceClass { /** * Compute optimized instances, 3rd generation */ - COMPUTE3 = 'c3', + COMPUTE3 = 'compute3', /** * Compute optimized instances, 3rd generation @@ -281,7 +281,7 @@ export enum InstanceClass { /** * Compute optimized instances, 4th generation */ - COMPUTE4 = 'c4', + COMPUTE4 = 'compute4', /** * Compute optimized instances, 4th generation @@ -291,7 +291,7 @@ export enum InstanceClass { /** * Compute optimized instances, 5th generation */ - COMPUTE5 = 'c5', + COMPUTE5 = 'compute5', /** * Compute optimized instances, 5th generation @@ -301,7 +301,7 @@ export enum InstanceClass { /** * Compute optimized instances with local NVME drive, 5th generation */ - COMPUTE5_NVME_DRIVE = 'c5d', + COMPUTE5_NVME_DRIVE = 'compute5-nvme-drive', /** * Compute optimized instances with local NVME drive, 5th generation @@ -311,7 +311,7 @@ export enum InstanceClass { /** * Compute optimized instances based on AMD EPYC, 5th generation */ - COMPUTE5_AMD = 'c5a', + COMPUTE5_AMD = 'compute5-amd', /** * Compute optimized instances based on AMD EPYC, 5th generation @@ -321,7 +321,7 @@ export enum InstanceClass { /** * Compute optimized instances with local NVME drive based on AMD EPYC, 5th generation */ - COMPUTE5_AMD_NVME_DRIVE = 'c5ad', + COMPUTE5_AMD_NVME_DRIVE = 'compute5-amd-nvme-drive', /** * Compute optimized instances with local NVME drive based on AMD EPYC, 5th generation @@ -331,7 +331,7 @@ export enum InstanceClass { /** * Compute optimized instances for high performance computing, 5th generation */ - COMPUTE5_HIGH_PERFORMANCE = 'c5n', + COMPUTE5_HIGH_PERFORMANCE = 'compute5-high-performance', /** * Compute optimized instances for high performance computing, 5th generation @@ -341,7 +341,7 @@ export enum InstanceClass { /** * Compute optimized instances, 6th generation */ - COMPUTE6_INTEL = 'c6i', + COMPUTE6_INTEL = 'compute6-intel', /** * Compute optimized instances, 6th generation @@ -351,7 +351,7 @@ export enum InstanceClass { /** * Compute optimized instances based on AMD EPYC (codename Milan), 6th generation */ - COMPUTE6_AMD = 'c6a', + COMPUTE6_AMD = 'compute6-amd', /** * Compute optimized instances based on AMD EPYC (codename Milan), 6th generation @@ -361,7 +361,7 @@ export enum InstanceClass { /** * Compute optimized instances for high performance computing, 6th generation with Graviton2 processors */ - COMPUTE6_GRAVITON2 = 'c6g', + COMPUTE6_GRAVITON2 = 'compute6-graviton2', /** * Compute optimized instances for high performance computing, 6th generation with Graviton2 processors @@ -372,7 +372,7 @@ export enum InstanceClass { * Compute optimized instances for high performance computing, 6th generation with Graviton2 processors * and local NVME drive */ - COMPUTE6_GRAVITON2_NVME_DRIVE = 'c6gd', + COMPUTE6_GRAVITON2_NVME_DRIVE = 'compute6-graviton2-nvme-drive', /** * Compute optimized instances for high performance computing, 6th generation with Graviton2 processors @@ -384,7 +384,14 @@ export enum InstanceClass { * Compute optimized instances for high performance computing, 6th generation with Graviton2 processors * and high network bandwidth capabilities */ - COMPUTE6_GRAVITON2_HIGH_NETWORK_BANDWITH = 'c6gn', + COMPUTE6_GRAVITON2_HIGH_NETWORK_BANDWITH = 'compute6-graviton2-high-network-banwidth', + + + /** + * Compute optimized instances for high performance computing, 6th generation with Graviton2 processors + * and high network bandwidth capabilities + */ + COMPUTE6_GRAVITON2_HIGH_NETWORK_BANDWIDTH = 'compute6-graviton2-high-network-bandwidth', /** * Compute optimized instances for high performance computing, 6th generation with Graviton2 processors @@ -395,7 +402,7 @@ export enum InstanceClass { /** * Storage-optimized instances, 2nd generation */ - STORAGE2 = 'd2', + STORAGE2 = 'storage2', /** * Storage-optimized instances, 2nd generation @@ -405,7 +412,7 @@ export enum InstanceClass { /** * Storage-optimized instances, 3rd generation */ - STORAGE3 = 'd3', + STORAGE3 = 'storage3', /** * Storage-optimized instances, 3rd generation @@ -415,7 +422,7 @@ export enum InstanceClass { /** * Storage-optimized instances, 3rd generation */ - STORAGE3_ENHANCED_NETWORK = 'd3en', + STORAGE3_ENHANCED_NETWORK = 'storage3-enhanced-network', /** * Storage-optimized instances, 3rd generation @@ -425,7 +432,7 @@ export enum InstanceClass { /** * Storage/compute balanced instances, 1st generation */ - STORAGE_COMPUTE_1 = 'h1', + STORAGE_COMPUTE_1 = 'storage-compute-1', /** * Storage/compute balanced instances, 1st generation @@ -435,7 +442,7 @@ export enum InstanceClass { /** * I/O-optimized instances, 3rd generation */ - IO3 = 'i3', + IO3 = 'io3', /** * I/O-optimized instances, 3rd generation @@ -445,7 +452,7 @@ export enum InstanceClass { /** * I/O-optimized instances with local NVME drive, 3rd generation */ - IO3_DENSE_NVME_DRIVE = 'i3en', + IO3_DENSE_NVME_DRIVE = 'io3-dense-nvme-drive', /** * I/O-optimized instances with local NVME drive, 3rd generation @@ -455,7 +462,7 @@ export enum InstanceClass { /** * Storage optimized instances powered by Graviton2 processor, 4th generation */ - STORAGE4_GRAVITON_NETWORK_OPTIMIZED = 'im4gn', + STORAGE4_GRAVITON_NETWORK_OPTIMIZED = 'storage4-graviton-network-optimized', /** * Storage optimized instances powered by Graviton2 processor, 4th generation @@ -465,7 +472,7 @@ export enum InstanceClass { /** * Storage optimized instances powered by Graviton2 processor, 4th generation */ - STORAGE4_GRAVITON_NETWORK_STORAGE_OPTIMIZED = 'is4gen', + STORAGE4_GRAVITON_NETWORK_STORAGE_OPTIMIZED = 'storage4-graviton-network-storage-optimized', /** * Storage optimized instances powered by Graviton2 processor, 4th generation @@ -475,7 +482,7 @@ export enum InstanceClass { /** * Burstable instances, 2nd generation */ - BURSTABLE2 = 't2', + BURSTABLE2 = 'burstable2', /** * Burstable instances, 2nd generation @@ -485,7 +492,7 @@ export enum InstanceClass { /** * Burstable instances, 3rd generation */ - BURSTABLE3 = 't3', + BURSTABLE3 = 'burstable3', /** * Burstable instances, 3rd generation @@ -495,7 +502,7 @@ export enum InstanceClass { /** * Burstable instances based on AMD EPYC, 3rd generation */ - BURSTABLE3_AMD = 't3a', + BURSTABLE3_AMD = 'burstable3-amd', /** * Burstable instances based on AMD EPYC, 3rd generation @@ -505,7 +512,7 @@ export enum InstanceClass { /** * Burstable instances, 4th generation with Graviton2 processors */ - BURSTABLE4_GRAVITON = 't4g', + BURSTABLE4_GRAVITON = 'burstable4-graviton', /** * Burstable instances, 4th generation with Graviton2 processors @@ -515,7 +522,7 @@ export enum InstanceClass { /** * Memory-intensive instances, 1st generation */ - MEMORY_INTENSIVE_1 = 'x1', + MEMORY_INTENSIVE_1 = 'memory-intensive-1', /** * Memory-intensive instances, 1st generation @@ -525,7 +532,7 @@ export enum InstanceClass { /** * Memory-intensive instances, extended, 1st generation */ - MEMORY_INTENSIVE_1_EXTENDED = 'x1e', + MEMORY_INTENSIVE_1_EXTENDED = 'memory-intensive-1-extended', /** * Memory-intensive instances, 1st generation @@ -537,7 +544,7 @@ export enum InstanceClass { * * This instance type can be used only in RDS. It is not supported in EC2. */ - MEMORY_INTENSIVE_2_GRAVITON2 = 'x2g', + MEMORY_INTENSIVE_2_GRAVITON2 = 'memory-intensive-2-graviton2', /** * Memory-intensive instances, 2nd generation with Graviton2 processors @@ -549,7 +556,7 @@ export enum InstanceClass { /** * Memory-intensive instances, 2nd generation with Graviton2 processors and local NVME drive */ - MEMORY_INTENSIVE_2_GRAVITON2_NVME_DRIVE = 'x2gd', + MEMORY_INTENSIVE_2_GRAVITON2_NVME_DRIVE = 'memory-intensive-2-graviton2-nvme-drive', /** * Memory-intensive instances, 2nd generation with Graviton2 processors and local NVME drive @@ -559,7 +566,7 @@ export enum InstanceClass { /** * Instances with customizable hardware acceleration, 1st generation */ - FPGA1 = 'f1', + FPGA1 = 'fpga1', /** * Instances with customizable hardware acceleration, 1st generation @@ -569,7 +576,7 @@ export enum InstanceClass { /** * Graphics-optimized instances, 3rd generation */ - GRAPHICS3 = 'g3', + GRAPHICS3 = 'graphics3', /** * Graphics-optimized instances, 3rd generation @@ -579,7 +586,7 @@ export enum InstanceClass { /** * Graphics-optimized instances with NVME drive for high performance computing, 4th generation */ - GRAPHICS4_NVME_DRIVE_HIGH_PERFORMANCE = 'g4dn', + GRAPHICS4_NVME_DRIVE_HIGH_PERFORMANCE = 'graphics4-nvme-drive-high-performance', /** * Graphics-optimized instances with NVME drive for high performance computing, 4th generation @@ -589,7 +596,7 @@ export enum InstanceClass { /** * Graphics-optimized instances based on AMD EPYC And Radeon Pro GPU (NAVI) with local NVME drive, 4th generation */ - GRAPHICS4_AMD_NVME_DRIVE = 'g4ad', + GRAPHICS4_AMD_NVME_DRIVE = 'graphics4-amd-nvme-drive', /** * Graphics-optimized instances based on AMD EPYC And Radeon Pro GPU (NAVI) with local NVME drive, 4th generation @@ -599,7 +606,7 @@ export enum InstanceClass { /** * Graphics-optimized instances, 5th generation */ - GRAPHICS5 = 'g5', + GRAPHICS5 = 'graphics5', /** * Graphics-optimized instances, 5th generation @@ -609,7 +616,7 @@ export enum InstanceClass { /** * Graphics-optimized instances powered by AWS Graviton2 Processors and NVIDIA T4G Tensor Core GPUs, 5th generation */ - GRAPHICS5_GRAVITON2 = 'g5g', + GRAPHICS5_GRAVITON2 = 'graphics5-graviton2', /** * Graphics-optimized instances powered by AWS Graviton2 Processors and NVIDIA T4G Tensor Core GPUs, 5th generation @@ -619,7 +626,7 @@ export enum InstanceClass { /** * Parallel-processing optimized instances, 2nd generation */ - PARALLEL2 = 'p2', + PARALLEL2 = 'parallel2', /** * Parallel-processing optimized instances, 2nd generation @@ -629,7 +636,7 @@ export enum InstanceClass { /** * Parallel-processing optimized instances, 3nd generation */ - PARALLEL3 = 'p3', + PARALLEL3 = 'parallel3', /** * Parallel-processing optimized instances, 3rd generation @@ -639,7 +646,7 @@ export enum InstanceClass { /** * Parallel-processing optimized instances, 4th generation */ - PARALLEL4 = 'p4d', + PARALLEL4 = 'parallel4', /** * Parallel-processing optimized instances, 4th generation @@ -649,7 +656,7 @@ export enum InstanceClass { /** * Arm processor based instances, 1st generation */ - ARM1 = 'a1', + ARM1 = 'arm1', /** * Arm processor based instances, 1st generation @@ -659,7 +666,7 @@ export enum InstanceClass { /** * Arm processor based instances, 2nd generation */ - STANDARD6_GRAVITON = 'm6g', + STANDARD6_GRAVITON = 'standard6-graviton', /** * Arm processor based instances, 2nd generation @@ -669,7 +676,7 @@ export enum InstanceClass { /** * Standard instances based on Intel (Ice Lake), 6th generation. */ - STANDARD6_INTEL = 'm6i', + STANDARD6_INTEL = 'standard6-intel', /** * Standard instances based on Intel (Ice Lake), 6th generation. @@ -679,7 +686,7 @@ export enum InstanceClass { /** * Standard instances based on 3rd Gen AMD EPYC processors, 6th generation. */ - STANDARD6_AMD = 'm6a', + STANDARD6_AMD = 'standard6-amd', /** * Standard instances based on 3rd Gen AMD EPYC processors, 6th generation. @@ -689,7 +696,7 @@ export enum InstanceClass { /** * Standard instances, 6th generation with Graviton2 processors and local NVME drive */ - STANDARD6_GRAVITON2_NVME_DRIVE = 'm6gd', + STANDARD6_GRAVITON2_NVME_DRIVE = 'standard6-graviton2-nvme-drive', /** * Standard instances, 6th generation with Graviton2 processors and local NVME drive @@ -699,7 +706,7 @@ export enum InstanceClass { /** * High memory and compute capacity instances, 1st generation */ - HIGH_COMPUTE_MEMORY1 = 'z1d', + HIGH_COMPUTE_MEMORY1 = 'high-compute-memory1', /** * High memory and compute capacity instances, 1st generation @@ -709,7 +716,7 @@ export enum InstanceClass { /** * Inferentia Chips based instances for machine learning inference applications, 1st generation */ - INFERENCE1 = 'inf1', + INFERENCE1 = 'inference1', /** * Inferentia Chips based instances for machine learning inference applications, 1st generation @@ -719,7 +726,7 @@ export enum InstanceClass { /** * Macintosh instances built on Apple Mac mini computers, 1st generation with Intel procesors */ - MACINTOSH1_INTEL = 'mac1', + MACINTOSH1_INTEL = 'macintosh1-intel', /** * Macintosh instances built on Apple Mac mini computers, 1st generation with Intel procesors @@ -729,7 +736,7 @@ export enum InstanceClass { /** * Multi-stream video transcoding instances for resolutions up to 4K UHD, 1st generation */ - VIDEO_TRANSCODING1 = 'vt1', + VIDEO_TRANSCODING1 = 'video-transcoding1', /** * Multi-stream video transcoding instances for resolutions up to 4K UHD, 1st generation @@ -739,7 +746,7 @@ export enum InstanceClass { /** * High performance computing based on AMD EPYC, 6th generation */ - HIGH_PERFORMANCE_COMPUTING6_AMD = 'hpc6a', + HIGH_PERFORMANCE_COMPUTING6_AMD = 'high-performance-computing6-amd', /** * High performance computing based on AMD EPYC, 6th generation @@ -893,7 +900,157 @@ export class InstanceType { * classes are available in all regions. */ public static of(instanceClass: InstanceClass, instanceSize: InstanceSize) { - return new InstanceType(`${instanceClass}.${instanceSize}`); + // JSII does not allow enum types to have same value. So to support the enum, the enum with same value has to be mapped later. + const instanceClassMap: Record = { + [InstanceClass.STANDARD3]: 'm3', + [InstanceClass.M3]: 'm3', + [InstanceClass.STANDARD4]: 'm4', + [InstanceClass.M4]: 'm4', + [InstanceClass.STANDARD5]: 'm5', + [InstanceClass.M5]: 'm5', + [InstanceClass.STANDARD5_NVME_DRIVE]: 'm5d', + [InstanceClass.M5D]: 'm5d', + [InstanceClass.STANDARD5_AMD]: 'm5a', + [InstanceClass.M5A]: 'm5a', + [InstanceClass.STANDARD5_AMD_NVME_DRIVE]: 'm5ad', + [InstanceClass.M5AD]: 'm5ad', + [InstanceClass.STANDARD5_HIGH_PERFORMANCE]: 'm5n', + [InstanceClass.M5N]: 'm5n', + [InstanceClass.STANDARD5_NVME_DRIVE_HIGH_PERFORMANCE]: 'm5dn', + [InstanceClass.M5DN]: 'm5dn', + [InstanceClass.STANDARD5_HIGH_COMPUTE]: 'm5zn', + [InstanceClass.M5ZN]: 'm5zn', + [InstanceClass.MEMORY3]: 'r3', + [InstanceClass.R3]: 'r3', + [InstanceClass.MEMORY4]: 'r4', + [InstanceClass.R4]: 'r4', + [InstanceClass.MEMORY5]: 'r5', + [InstanceClass.R5]: 'r5', + [InstanceClass.MEMORY6_INTEL]: 'r6i', + [InstanceClass.R6I]: 'r6i', + [InstanceClass.MEMORY5_HIGH_PERFORMANCE]: 'r5n', + [InstanceClass.R5N]: 'r5n', + [InstanceClass.MEMORY5_NVME_DRIVE]: 'r5d', + [InstanceClass.R5D]: 'r5d', + [InstanceClass.MEMORY5_NVME_DRIVE_HIGH_PERFORMANCE]: 'r5dn', + [InstanceClass.R5DN]: 'r5dn', + [InstanceClass.MEMORY5_AMD]: 'r5a', + [InstanceClass.R5A]: 'r5a', + [InstanceClass.MEMORY5_AMD_NVME_DRIVE]: 'r5ad', + [InstanceClass.R5AD]: 'r5ad', + [InstanceClass.HIGH_MEMORY_6TB_1]: 'u-6tb1', + [InstanceClass.U_6TB1]: 'u-6tb1', + [InstanceClass.HIGH_MEMORY_9TB_1]: 'u-9tb1', + [InstanceClass.U_9TB1]: 'u-9tb1', + [InstanceClass.HIGH_MEMORY_12TB_1]: 'u-12tb1', + [InstanceClass.U_12TB1]: 'u-12tb1', + [InstanceClass.HIGH_MEMORY_18TB_1]: 'u-18tb1', + [InstanceClass.U_18TB1]: 'u-18tb1', + [InstanceClass.HIGH_MEMORY_24TB_1]: 'u-24tb1', + [InstanceClass.U_24TB1]: 'u-24tb1', + [InstanceClass.MEMORY5_EBS_OPTIMIZED]: 'r5b', + [InstanceClass.R5B]: 'r5b', + [InstanceClass.MEMORY6_GRAVITON]: 'r6g', + [InstanceClass.R6G]: 'r6g', + [InstanceClass.MEMORY6_GRAVITON2_NVME_DRIVE]: 'r6gd', + [InstanceClass.R6GD]: 'r6gd', + [InstanceClass.COMPUTE3]: 'c3', + [InstanceClass.C3]: 'c3', + [InstanceClass.COMPUTE4]: 'c4', + [InstanceClass.C4]: 'c4', + [InstanceClass.COMPUTE5]: 'c5', + [InstanceClass.C5]: 'c5', + [InstanceClass.COMPUTE5_NVME_DRIVE]: 'c5d', + [InstanceClass.C5D]: 'c5d', + [InstanceClass.COMPUTE5_AMD]: 'c5a', + [InstanceClass.C5A]: 'c5a', + [InstanceClass.COMPUTE5_AMD_NVME_DRIVE]: 'c5ad', + [InstanceClass.C5AD]: 'c5ad', + [InstanceClass.COMPUTE5_HIGH_PERFORMANCE]: 'c5n', + [InstanceClass.C5N]: 'c5n', + [InstanceClass.COMPUTE6_INTEL]: 'c6i', + [InstanceClass.C6I]: 'c6i', + [InstanceClass.COMPUTE6_AMD]: 'c6a', + [InstanceClass.C6A]: 'c6a', + [InstanceClass.COMPUTE6_GRAVITON2]: 'c6g', + [InstanceClass.C6G]: 'c6g', + [InstanceClass.COMPUTE6_GRAVITON2_NVME_DRIVE]: 'c6gd', + [InstanceClass.C6GD]: 'c6gd', + [InstanceClass.COMPUTE6_GRAVITON2_HIGH_NETWORK_BANDWIDTH]: 'c6gdb', + [InstanceClass.COMPUTE6_GRAVITON2_HIGH_NETWORK_BANDWITH]: 'c6gdb', + [InstanceClass.C6GN]: 'c6gn', + [InstanceClass.STORAGE2]: 'd2', + [InstanceClass.D2]: 'd2', + [InstanceClass.STORAGE3]: 'd3', + [InstanceClass.D3]: 'd3', + [InstanceClass.STORAGE3_ENHANCED_NETWORK]: 'd3en', + [InstanceClass.D3EN]: 'd3en', + [InstanceClass.STORAGE_COMPUTE_1]: 'h1', + [InstanceClass.H1]: 'h1', + [InstanceClass.IO3]: 'i3', + [InstanceClass.I3]: 'i3', + [InstanceClass.IO3_DENSE_NVME_DRIVE]: 'i3en', + [InstanceClass.I3EN]: 'i3en', + [InstanceClass.STORAGE4_GRAVITON_NETWORK_OPTIMIZED]: 'im4gn', + [InstanceClass.IM4GN]: 'im4gn', + [InstanceClass.STORAGE4_GRAVITON_NETWORK_STORAGE_OPTIMIZED]: 'is4gen', + [InstanceClass.IS4GEN]: 'is4gen', + [InstanceClass.BURSTABLE2]: 't2', + [InstanceClass.T2]: 't2', + [InstanceClass.BURSTABLE3]: 't3', + [InstanceClass.T3]: 't3', + [InstanceClass.BURSTABLE3_AMD]: 't3a', + [InstanceClass.T3A]: 't3a', + [InstanceClass.BURSTABLE4_GRAVITON]: 't4g', + [InstanceClass.T4G]: 't4g', + [InstanceClass.MEMORY_INTENSIVE_1]: 'x1', + [InstanceClass.X1]: 'x1', + [InstanceClass.MEMORY_INTENSIVE_1_EXTENDED]: 'x1e', + [InstanceClass.X1E]: 'x1e', + [InstanceClass.MEMORY_INTENSIVE_2_GRAVITON2]: 'x2g', + [InstanceClass.X2G]: 'x2g', + [InstanceClass.MEMORY_INTENSIVE_2_GRAVITON2_NVME_DRIVE]: 'x2gd', + [InstanceClass.X2GD]: 'x2gd', + [InstanceClass.FPGA1]: 'f1', + [InstanceClass.F1]: 'f1', + [InstanceClass.GRAPHICS3]: 'g3', + [InstanceClass.G3]: 'g3', + [InstanceClass.GRAPHICS4_NVME_DRIVE_HIGH_PERFORMANCE]: 'g4dn', + [InstanceClass.G4DN]: 'g4dn', + [InstanceClass.GRAPHICS4_AMD_NVME_DRIVE]: 'g4ad', + [InstanceClass.G4AD]: 'g4ad', + [InstanceClass.GRAPHICS5]: 'g5', + [InstanceClass.G5]: 'g5', + [InstanceClass.GRAPHICS5_GRAVITON2]: 'g5g', + [InstanceClass.G5G]: 'g5g', + [InstanceClass.PARALLEL2]: 'p2', + [InstanceClass.P2]: 'p2', + [InstanceClass.PARALLEL3]: 'p3', + [InstanceClass.P3]: 'p3', + [InstanceClass.PARALLEL4]: 'p4d', + [InstanceClass.P4D]: 'p4d', + [InstanceClass.ARM1]: 'a1', + [InstanceClass.A1]: 'a1', + [InstanceClass.STANDARD6_GRAVITON]: 'm6g', + [InstanceClass.M6G]: 'm6g', + [InstanceClass.STANDARD6_INTEL]: 'm6i', + [InstanceClass.M6I]: 'm6i', + [InstanceClass.STANDARD6_AMD]: 'm6a', + [InstanceClass.M6A]: 'm6a', + [InstanceClass.STANDARD6_GRAVITON2_NVME_DRIVE]: 'm6gd', + [InstanceClass.M6GD]: 'm6gd', + [InstanceClass.HIGH_COMPUTE_MEMORY1]: 'z1d', + [InstanceClass.Z1D]: 'z1d', + [InstanceClass.INFERENCE1]: 'inf1', + [InstanceClass.INF1]: 'inf1', + [InstanceClass.MACINTOSH1_INTEL]: 'mac1', + [InstanceClass.MAC1]: 'mac1', + [InstanceClass.VIDEO_TRANSCODING1]: 'vt1', + [InstanceClass.VT1]: 'vt1', + [InstanceClass.HIGH_PERFORMANCE_COMPUTING6_AMD]: 'hpc6a', + [InstanceClass.HPC6A]: 'hpc6a', + }; + return new InstanceType(`${instanceClassMap[instanceClass] ?? instanceClass}.${instanceSize}`); } constructor(private readonly instanceTypeIdentifier: string) { diff --git a/packages/@aws-cdk/aws-ec2/lib/machine-image.ts b/packages/@aws-cdk/aws-ec2/lib/machine-image.ts index 789d17c5167bd..43fc3273837e2 100644 --- a/packages/@aws-cdk/aws-ec2/lib/machine-image.ts +++ b/packages/@aws-cdk/aws-ec2/lib/machine-image.ts @@ -271,8 +271,25 @@ export interface WindowsImageProps { * https://aws.amazon.com/blogs/mt/query-for-the-latest-windows-ami-using-systems-manager-parameter-store/ */ export class WindowsImage extends GenericSSMParameterImage { + private static DEPRECATED_VERSION_NAME_MAP: Partial> = { + [WindowsVersion.WINDOWS_SERVER_2016_GERMAL_FULL_BASE]: WindowsVersion.WINDOWS_SERVER_2016_GERMAN_FULL_BASE, + [WindowsVersion.WINDOWS_SERVER_2012_R2_SP1_PORTUGESE_BRAZIL_64BIT_CORE]: WindowsVersion.WINDOWS_SERVER_2012_R2_SP1_PORTUGUESE_BRAZIL_64BIT_CORE, + [WindowsVersion.WINDOWS_SERVER_2016_PORTUGESE_PORTUGAL_FULL_BASE]: WindowsVersion.WINDOWS_SERVER_2016_PORTUGUESE_PORTUGAL_FULL_BASE, + [WindowsVersion.WINDOWS_SERVER_2012_R2_RTM_PORTUGESE_BRAZIL_64BIT_BASE]: WindowsVersion.WINDOWS_SERVER_2012_R2_RTM_PORTUGUESE_BRAZIL_64BIT_BASE, + [WindowsVersion.WINDOWS_SERVER_2012_R2_RTM_PORTUGESE_PORTUGAL_64BIT_BASE]: + WindowsVersion.WINDOWS_SERVER_2012_R2_RTM_PORTUGUESE_PORTUGAL_64BIT_BASE, + [WindowsVersion.WINDOWS_SERVER_2016_PORTUGESE_BRAZIL_FULL_BASE]: WindowsVersion.WINDOWS_SERVER_2016_PORTUGUESE_BRAZIL_FULL_BASE, + [WindowsVersion.WINDOWS_SERVER_2012_SP2_PORTUGESE_BRAZIL_64BIT_BASE]: WindowsVersion.WINDOWS_SERVER_2012_SP2_PORTUGUESE_BRAZIL_64BIT_BASE, + [WindowsVersion.WINDOWS_SERVER_2012_RTM_PORTUGESE_BRAZIL_64BIT_BASE]: WindowsVersion.WINDOWS_SERVER_2012_RTM_PORTUGUESE_BRAZIL_64BIT_BASE, + [WindowsVersion.WINDOWS_SERVER_2008_R2_SP1_PORTUGESE_BRAZIL_64BIT_BASE]: WindowsVersion.WINDOWS_SERVER_2008_R2_SP1_PORTUGUESE_BRAZIL_64BIT_BASE, + [WindowsVersion.WINDOWS_SERVER_2008_SP2_PORTUGESE_BRAZIL_32BIT_BASE]: WindowsVersion.WINDOWS_SERVER_2008_SP2_PORTUGUESE_BRAZIL_32BIT_BASE, + [WindowsVersion.WINDOWS_SERVER_2012_RTM_PORTUGESE_PORTUGAL_64BIT_BASE]: WindowsVersion.WINDOWS_SERVER_2012_RTM_PORTUGUESE_PORTUGAL_64BIT_BASE, + [WindowsVersion.WINDOWS_SERVER_2019_PORTUGESE_BRAZIL_FULL_BASE]: WindowsVersion.WINDOWS_SERVER_2019_PORTUGUESE_BRAZIL_FULL_BASE, + [WindowsVersion.WINDOWS_SERVER_2019_PORTUGESE_PORTUGAL_FULL_BASE]: WindowsVersion.WINDOWS_SERVER_2019_PORTUGUESE_PORTUGAL_FULL_BASE, + } constructor(version: WindowsVersion, props: WindowsImageProps = {}) { - super('/aws/service/ami-windows-latest/' + version, OperatingSystemType.WINDOWS, props.userData); + const nonDeprecatedVersionName = WindowsImage.DEPRECATED_VERSION_NAME_MAP[version] ?? version; + super('/aws/service/ami-windows-latest/' + nonDeprecatedVersionName, OperatingSystemType.WINDOWS, props.userData); } } diff --git a/packages/@aws-cdk/aws-ec2/lib/port.ts b/packages/@aws-cdk/aws-ec2/lib/port.ts index 8436f3455cda1..2317879988f3a 100644 --- a/packages/@aws-cdk/aws-ec2/lib/port.ts +++ b/packages/@aws-cdk/aws-ec2/lib/port.ts @@ -90,7 +90,7 @@ export enum Protocol { SECURE_VMTP = '82', VINES = '83', TTP = '84', - IPTM = '84', + IPTM = '84_', NSFNET_IGP = '85', DGP = '86', TCF = '87', @@ -154,6 +154,7 @@ export enum Protocol { EXPERIMENT_2 = '254', RESERVED = '255', } + /** * Properties to create a port range */ @@ -243,7 +244,9 @@ export class Port { protocol: Protocol.UDP, fromPort: startPort, toPort: endPort, - stringRepresentation: `UDP ${renderPort(startPort)}-${renderPort(endPort)}`, + stringRepresentation: `UDP ${renderPort(startPort)}-${renderPort( + endPort, + )}`, }); } @@ -344,15 +347,20 @@ export class Port { public readonly canInlineRule: boolean; constructor(private readonly props: PortProps) { - this.canInlineRule = !Token.isUnresolved(props.fromPort) && !Token.isUnresolved(props.toPort); + this.canInlineRule = + !Token.isUnresolved(props.fromPort) && !Token.isUnresolved(props.toPort); } /** * Produce the ingress/egress rule JSON for the given connection */ public toRuleJson(): any { + // JSII does not allow enum types to have same value. So to support the enum, the enum with same value has to be mapped later. + const PROTOCOL_MAP: Partial> = { + [Protocol.IPTM]: '84', + }; return { - ipProtocol: this.props.protocol, + ipProtocol: PROTOCOL_MAP[this.props.protocol] ?? this.props.protocol, fromPort: this.props.fromPort, toPort: this.props.toPort, }; diff --git a/packages/@aws-cdk/aws-ec2/lib/util.ts b/packages/@aws-cdk/aws-ec2/lib/util.ts index 31814d5cc45e5..9a1c572f02afe 100644 --- a/packages/@aws-cdk/aws-ec2/lib/util.ts +++ b/packages/@aws-cdk/aws-ec2/lib/util.ts @@ -16,8 +16,12 @@ export function slugify(x: string): string { export function defaultSubnetName(type: SubnetType) { switch (type) { case SubnetType.PUBLIC: return 'Public'; - case SubnetType.PRIVATE_WITH_NAT: return 'Private'; - case SubnetType.PRIVATE_ISOLATED: return 'Isolated'; + case SubnetType.PRIVATE_WITH_NAT: + case SubnetType.PRIVATE: + return 'Private'; + case SubnetType.PRIVATE_ISOLATED: + case SubnetType.ISOLATED: + return 'Isolated'; } } diff --git a/packages/@aws-cdk/aws-ec2/lib/vpc.ts b/packages/@aws-cdk/aws-ec2/lib/vpc.ts index 741a6ceba4f07..aae0cd2ec4cbe 100644 --- a/packages/@aws-cdk/aws-ec2/lib/vpc.ts +++ b/packages/@aws-cdk/aws-ec2/lib/vpc.ts @@ -177,7 +177,7 @@ export enum SubnetType { * * @deprecated use `SubnetType.PRIVATE_ISOLATED` */ - ISOLATED = 'Isolated', + ISOLATED = 'Deprecated_Isolated', /** * Isolated Subnets do not route traffic to the Internet (in this VPC), @@ -209,7 +209,7 @@ export enum SubnetType { * * @deprecated use `PRIVATE_WITH_NAT` */ - PRIVATE = 'Private', + PRIVATE = 'Deprecated_Private', /** * Subnet that routes to the internet (via a NAT gateway), but not vice versa. @@ -590,7 +590,9 @@ abstract class VpcBase extends Resource implements IVpc { private selectSubnetObjectsByType(subnetType: SubnetType) { const allSubnets = { [SubnetType.PRIVATE_ISOLATED]: this.isolatedSubnets, + [SubnetType.ISOLATED]: this.isolatedSubnets, [SubnetType.PRIVATE_WITH_NAT]: this.privateSubnets, + [SubnetType.PRIVATE]: this.privateSubnets, [SubnetType.PUBLIC]: this.publicSubnets, }; @@ -1507,11 +1509,13 @@ export class Vpc extends VpcBase { subnet = publicSubnet; break; case SubnetType.PRIVATE_WITH_NAT: + case SubnetType.PRIVATE: const privateSubnet = new PrivateSubnet(this, name, subnetProps); this.privateSubnets.push(privateSubnet); subnet = privateSubnet; break; case SubnetType.PRIVATE_ISOLATED: + case SubnetType.ISOLATED: const isolatedSubnet = new PrivateSubnet(this, name, subnetProps); this.isolatedSubnets.push(isolatedSubnet); subnet = isolatedSubnet; @@ -1534,8 +1538,12 @@ const SUBNETNAME_TAG = 'aws-cdk:subnet-name'; function subnetTypeTagValue(type: SubnetType) { switch (type) { case SubnetType.PUBLIC: return 'Public'; - case SubnetType.PRIVATE_WITH_NAT: return 'Private'; - case SubnetType.PRIVATE_ISOLATED: return 'Isolated'; + case SubnetType.PRIVATE_WITH_NAT: + case SubnetType.PRIVATE: + return 'Private'; + case SubnetType.PRIVATE_ISOLATED: + case SubnetType.ISOLATED: + return 'Isolated'; } } diff --git a/packages/@aws-cdk/aws-ec2/lib/windows-versions.ts b/packages/@aws-cdk/aws-ec2/lib/windows-versions.ts index 2d5a60c5f9c22..d5bd2dd39c526 100644 --- a/packages/@aws-cdk/aws-ec2/lib/windows-versions.ts +++ b/packages/@aws-cdk/aws-ec2/lib/windows-versions.ts @@ -12,13 +12,13 @@ export enum WindowsVersion { WINDOWS_SERVER_2016_ENGLISH_CORE_CONTAINERS = 'Windows_Server-2016-English-Core-Containers', WINDOWS_SERVER_2016_ENGLISH_CORE_SQL_2016_SP1_WEB = 'Windows_Server-2016-English-Core-SQL_2016_SP1_Web', /** @deprecated - use WINDOWS_SERVER_2016_GERMAN_FULL_BASE */ - WINDOWS_SERVER_2016_GERMAL_FULL_BASE = 'Windows_Server-2016-German-Full-Base', + WINDOWS_SERVER_2016_GERMAL_FULL_BASE = 'Windows_Server-2016-Germal-Full-Base', WINDOWS_SERVER_2016_GERMAN_FULL_BASE = 'Windows_Server-2016-German-Full-Base', WINDOWS_SERVER_2003_R2_SP2_LANGUAGE_PACKS_32BIT_BASE = 'Windows_Server-2003-R2_SP2-Language_Packs-32Bit-Base', WINDOWS_SERVER_2008_R2_SP1_ENGLISH_64BIT_SQL_2008_R2_SP3_WEB = 'Windows_Server-2008-R2_SP1-English-64Bit-SQL_2008_R2_SP3_Web', WINDOWS_SERVER_2008_R2_SP1_ENGLISH_64BIT_SQL_2012_SP4_EXPRESS = 'Windows_Server-2008-R2_SP1-English-64Bit-SQL_2012_SP4_Express', /** @deprecated - use WINDOWS_SERVER_2012_R2_SP1_PORTUGUESE_BRAZIL_64BIT_CORE*/ - WINDOWS_SERVER_2012_R2_SP1_PORTUGESE_BRAZIL_64BIT_CORE = 'Windows_Server-2008-R2_SP1-Portuguese_Brazil-64Bit-Core', + WINDOWS_SERVER_2012_R2_SP1_PORTUGESE_BRAZIL_64BIT_CORE = 'Windows_Server-2008-R2_SP1-Portugese_Brazil-64Bit-Core', WINDOWS_SERVER_2012_R2_SP1_PORTUGUESE_BRAZIL_64BIT_CORE = 'Windows_Server-2008-R2_SP1-Portuguese_Brazil-64Bit-Core', WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_SQL_2016_SP2_STANDARD = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP2_Standard', WINDOWS_SERVER_2012_RTM_ENGLISH_64BIT_SQL_2014_SP2_EXPRESS = 'Windows_Server-2012-RTM-English-64Bit-SQL_2014_SP2_Express', @@ -33,7 +33,7 @@ export enum WindowsVersion { WINDOWS_SERVER_2016_KOREAN_FULL_BASE = 'Windows_Server-2016-Korean-Full-Base', WINDOWS_SERVER_2016_KOREAN_FULL_SQL_2016_SP2_STANDARD = 'Windows_Server-2016-Korean-Full-SQL_2016_SP2_Standard', /** @deprecated - use WINDOWS_SERVER_2016_PORTUGUESE_PORTUGAL_FULL_BASE */ - WINDOWS_SERVER_2016_PORTUGESE_PORTUGAL_FULL_BASE = 'Windows_Server-2016-Portuguese_Portugal-Full-Base', + WINDOWS_SERVER_2016_PORTUGESE_PORTUGAL_FULL_BASE = 'Windows_Server-2016-Portugese_Portugal-Full-Base', WINDOWS_SERVER_2016_PORTUGUESE_PORTUGAL_FULL_BASE = 'Windows_Server-2016-Portuguese_Portugal-Full-Base', WINDOWS_SERVER_2019_ENGLISH_FULL_SQL_2017_WEB = 'Windows_Server-2019-English-Full-SQL_2017_Web', WINDOWS_SERVER_2019_FRENCH_FULL_BASE = 'Windows_Server-2019-French-Full-Base', @@ -97,10 +97,10 @@ export enum WindowsVersion { WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_SQL_2014_SP3_WEB = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2014_SP3_Web', WINDOWS_SERVER_2012_R2_RTM_JAPANESE_64BIT_SQL_2016_SP1_WEB = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP1_Web', /** @deprecated - use WINDOWS_SERVER_2012_R2_RTM_PORTUGUESE_BRAZIL_64BIT_BASE */ - WINDOWS_SERVER_2012_R2_RTM_PORTUGESE_BRAZIL_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Portuguese_Brazil-64Bit-Base', + WINDOWS_SERVER_2012_R2_RTM_PORTUGESE_BRAZIL_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Portugese_Brazil-64Bit-Base', WINDOWS_SERVER_2012_R2_RTM_PORTUGUESE_BRAZIL_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Portuguese_Brazil-64Bit-Base', /** @deprecated - use WINDOWS_SERVER_2012_R2_RTM_PORTUGUESE_PORTUGAL_64BIT_BASE*/ - WINDOWS_SERVER_2012_R2_RTM_PORTUGESE_PORTUGAL_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Portuguese_Portugal-64Bit-Base', + WINDOWS_SERVER_2012_R2_RTM_PORTUGESE_PORTUGAL_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Portugese_Portugal-64Bit-Base', WINDOWS_SERVER_2012_R2_RTM_PORTUGUESE_PORTUGAL_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Portuguese_Portugal-64Bit-Base', WINDOWS_SERVER_2012_R2_RTM_SWEDISH_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Swedish-64Bit-Base', WINDOWS_SERVER_2016_ENGLISH_FULL_SQL_2016_SP1_EXPRESS = 'Windows_Server-2016-English-Full-SQL_2016_SP1_Express', @@ -114,7 +114,7 @@ export enum WindowsVersion { WINDOWS_SERVER_2012_RTM_JAPANESE_64BIT_SQL_2014_SP2_WEB = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2014_SP2_Web', WINDOWS_SERVER_2016_ENGLISH_CORE_SQL_2016_SP2_ENTERPRISE = 'Windows_Server-2016-English-Core-SQL_2016_SP2_Enterprise', /** @deprecated - use WINDOWS_SERVER_2016_PORTUGUESE_BRAZIL_FULL_BASE */ - WINDOWS_SERVER_2016_PORTUGESE_BRAZIL_FULL_BASE = 'Windows_Server-2016-Portuguese_Brazil-Full-Base', + WINDOWS_SERVER_2016_PORTUGESE_BRAZIL_FULL_BASE = 'Windows_Server-2016-Portugese_Brazil-Full-Base', WINDOWS_SERVER_2016_PORTUGUESE_BRAZIL_FULL_BASE = 'Windows_Server-2016-Portuguese_Brazil-Full-Base', WINDOWS_SERVER_2019_ENGLISH_FULL_BASE = 'Windows_Server-2019-English-Full-Base', WINDOWS_SERVER_2003_R2_SP2_ENGLISH_32BIT_BASE = 'Windows_Server-2003-R2_SP2-English-32Bit-Base', @@ -141,7 +141,7 @@ export enum WindowsVersion { WINDOWS_SERVER_2008_R2_SP1_ENGLISH_64BIT_BASE = 'Windows_Server-2008-R2_SP1-English-64Bit-Base', WINDOWS_SERVER_2008_R2_SP1_LANGUAGE_PACKS_64BIT_SQL_2008_R2_SP3_EXPRESS = 'Windows_Server-2008-R2_SP1-Language_Packs-64Bit-SQL_2008_R2_SP3_Express', /** @deprecated - use WINDOWS_SERVER_2012_SP2_PORTUGUESE_BRAZIL_64BIT_BASE */ - WINDOWS_SERVER_2012_SP2_PORTUGESE_BRAZIL_64BIT_BASE = 'Windows_Server-2008-SP2-Portuguese_Brazil-64Bit-Base', + WINDOWS_SERVER_2012_SP2_PORTUGESE_BRAZIL_64BIT_BASE = 'Windows_Server-2008-SP2-Portugese_Brazil-64Bit-Base', WINDOWS_SERVER_2012_SP2_PORTUGUESE_BRAZIL_64BIT_BASE = 'Windows_Server-2008-SP2-Portuguese_Brazil-64Bit-Base', WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_SQL_2016_SP1_WEB = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP1_Web', WINDOWS_SERVER_2012_R2_RTM_JAPANESE_64BIT_SQL_2014_SP3_EXPRESS = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2014_SP3_Express', @@ -156,7 +156,7 @@ export enum WindowsVersion { WINDOWS_SERVER_2008_SP2_ENGLISH_64BIT_SQL_2008_SP4_STANDARD = 'Windows_Server-2008-SP2-English-64Bit-SQL_2008_SP4_Standard', WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_BASE = 'Windows_Server-2012-R2_RTM-English-64Bit-Base', /** @deprecated - use WINDOWS_SERVER_2012_RTM_PORTUGUESE_BRAZIL_64BIT_BASE */ - WINDOWS_SERVER_2012_RTM_PORTUGESE_BRAZIL_64BIT_BASE = 'Windows_Server-2012-RTM-Portuguese_Brazil-64Bit-Base', + WINDOWS_SERVER_2012_RTM_PORTUGESE_BRAZIL_64BIT_BASE = 'Windows_Server-2012-RTM-Portugese_Brazil-64Bit-Base', WINDOWS_SERVER_2012_RTM_PORTUGUESE_BRAZIL_64BIT_BASE = 'Windows_Server-2012-RTM-Portuguese_Brazil-64Bit-Base', WINDOWS_SERVER_2016_ENGLISH_FULL_SQL_2016_SP1_WEB = 'Windows_Server-2016-English-Full-SQL_2016_SP1_Web', WINDOWS_SERVER_2016_ENGLISH_P3 = 'Windows_Server-2016-English-P3', @@ -182,7 +182,7 @@ export enum WindowsVersion { WINDOWS_SERVER_2019_POLISH_FULL_BASE = 'Windows_Server-2019-Polish-Full-Base', WINDOWS_SERVER_2008_R2_SP1_JAPANESE_64BIT_SQL_2008_R2_SP3_WEB = 'Windows_Server-2008-R2_SP1-Japanese-64Bit-SQL_2008_R2_SP3_Web', /** @deprecated - use WINDOWS_SERVER_2008_R2_SP1_PORTUGUESE_BRAZIL_64BIT_BASE */ - WINDOWS_SERVER_2008_R2_SP1_PORTUGESE_BRAZIL_64BIT_BASE = 'Windows_Server-2008-R2_SP1-Portuguese_Brazil-64Bit-Base', + WINDOWS_SERVER_2008_R2_SP1_PORTUGESE_BRAZIL_64BIT_BASE = 'Windows_Server-2008-R2_SP1-Portugese_Brazil-64Bit-Base', WINDOWS_SERVER_2008_R2_SP1_PORTUGUESE_BRAZIL_64BIT_BASE = 'Windows_Server-2008-R2_SP1-Portuguese_Brazil-64Bit-Base', WINDOWS_SERVER_2012_R2_RTM_JAPANESE_64BIT_SQL_2016_SP1_ENTERPRISE = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP1_Enterprise', WINDOWS_SERVER_2012_RTM_JAPANESE_64BIT_SQL_2016_SP2_EXPRESS = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP2_Express', @@ -216,11 +216,11 @@ export enum WindowsVersion { WINDOWS_SERVER_2008_R2_SP1_ENGLISH_64BIT_SQL_2012_SP4_STANDARD = 'Windows_Server-2008-R2_SP1-English-64Bit-SQL_2012_SP4_Standard', /** @deprecated - use WINDOWS_SERVER_2008_SP2_PORTUGUESE_BRAZIL_32BIT_BASE */ WINDOWS_SERVER_2008_SP2_PORTUGESE_BRAZIL_32BIT_BASE = 'Windows_Server-2008-SP2-Portuguese_Brazil-32Bit-Base', - WINDOWS_SERVER_2008_SP2_PORTUGUESE_BRAZIL_32BIT_BASE = 'Windows_Server-2008-SP2-Portuguese_Brazil-32Bit-Base', + WINDOWS_SERVER_2008_SP2_PORTUGUESE_BRAZIL_32BIT_BASE = 'Windows_Server-2008-SP2-Portugese_Brazil-32Bit-Base', WINDOWS_SERVER_2012_R2_RTM_JAPANESE_64BIT_SQL_2014_SP2_STANDARD = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2014_SP2_Standard', WINDOWS_SERVER_2012_RTM_JAPANESE_64BIT_SQL_2012_SP4_EXPRESS = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2012_SP4_Express', /** @deprecated - use WINDOWS_SERVER_2012_RTM_PORTUGUESE_PORTUGAL_64BIT_BASE */ - WINDOWS_SERVER_2012_RTM_PORTUGESE_PORTUGAL_64BIT_BASE = 'Windows_Server-2012-RTM-Portuguese_Portugal-64Bit-Base', + WINDOWS_SERVER_2012_RTM_PORTUGESE_PORTUGAL_64BIT_BASE = 'Windows_Server-2012-RTM-Portugese_Portugal-64Bit-Base', WINDOWS_SERVER_2012_RTM_PORTUGUESE_PORTUGAL_64BIT_BASE = 'Windows_Server-2012-RTM-Portuguese_Portugal-64Bit-Base', WINDOWS_SERVER_2016_CZECH_FULL_BASE = 'Windows_Server-2016-Czech-Full-Base', WINDOWS_SERVER_2016_JAPANESE_FULL_SQL_2016_SP1_STANDARD = 'Windows_Server-2016-Japanese-Full-SQL_2016_SP1_Standard', @@ -235,7 +235,7 @@ export enum WindowsVersion { WINDOWS_SERVER_2016_ENGLISH_CORE_SQL_2016_SP2_WEB = 'Windows_Server-2016-English-Core-SQL_2016_SP2_Web', WINDOWS_SERVER_2016_ENGLISH_FULL_SQL_2017_STANDARD = 'Windows_Server-2016-English-Full-SQL_2017_Standard', /** @deprecated - use WINDOWS_SERVER_2019_PORTUGUESE_BRAZIL_FULL_BASE */ - WINDOWS_SERVER_2019_PORTUGESE_BRAZIL_FULL_BASE = 'Windows_Server-2019-Portuguese_Brazil-Full-Base', + WINDOWS_SERVER_2019_PORTUGESE_BRAZIL_FULL_BASE = 'Windows_Server-2019-Portugese_Brazil-Full-Base', WINDOWS_SERVER_2019_PORTUGUESE_BRAZIL_FULL_BASE = 'Windows_Server-2019-Portuguese_Brazil-Full-Base', WINDOWS_SERVER_2008_R2_SP1_ENGLISH_64BIT_SQL_2008_R2_SP3_STANDARD = 'Windows_Server-2008-R2_SP1-English-64Bit-SQL_2008_R2_SP3_Standard', WINDOWS_SERVER_2008_R2_SP1_ENGLISH_64BIT_SHAREPOINT_2010_SP2_FOUNDATION = 'Windows_Server-2008-R2_SP1-English-64Bit-SharePoint_2010_SP2_Foundation', @@ -246,7 +246,7 @@ export enum WindowsVersion { WINDOWS_SERVER_2016_ENGLISH_CORE_SQL_2016_SP2_STANDARD = 'Windows_Server-2016-English-Core-SQL_2016_SP2_Standard', WINDOWS_SERVER_2016_JAPANESE_FULL_SQL_2016_SP2_STANDARD = 'Windows_Server-2016-Japanese-Full-SQL_2016_SP2_Standard', /** @deprecated - use WINDOWS_SERVER_2019_PORTUGUESE_PORTUGAL_FULL_BASE */ - WINDOWS_SERVER_2019_PORTUGESE_PORTUGAL_FULL_BASE = 'Windows_Server-2019-Portuguese_Portugal-Full-Base', + WINDOWS_SERVER_2019_PORTUGESE_PORTUGAL_FULL_BASE = 'Windows_Server-2019-Portugese_Portugal-Full-Base', WINDOWS_SERVER_2019_PORTUGUESE_PORTUGAL_FULL_BASE = 'Windows_Server-2019-Portuguese_Portugal-Full-Base', WINDOWS_SERVER_2019_SWEDISH_FULL_BASE = 'Windows_Server-2019-Swedish-Full-Base', WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_HYPERV = 'Windows_Server-2012-R2_RTM-English-64Bit-HyperV', diff --git a/packages/@aws-cdk/aws-ec2/test/instance.test.ts b/packages/@aws-cdk/aws-ec2/test/instance.test.ts index 3c945a84d342b..4a8dc16a3efe2 100644 --- a/packages/@aws-cdk/aws-ec2/test/instance.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/instance.test.ts @@ -121,38 +121,37 @@ describe('instance', () => { }); + test('instances with local NVME drive are correctly named', () => { // GIVEN const sampleInstanceClassKeys = [{ - key: 'R5D', + key: InstanceClass.R5D, value: 'r5d', }, { - key: 'MEMORY5_NVME_DRIVE', + key: InstanceClass.MEMORY5_NVME_DRIVE, value: 'r5d', }, { - key: 'R5AD', + key: InstanceClass.R5AD, value: 'r5ad', }, { - key: 'MEMORY5_AMD_NVME_DRIVE', + key: InstanceClass.MEMORY5_AMD_NVME_DRIVE, value: 'r5ad', }, { - key: 'M5AD', + key: InstanceClass.M5AD, value: 'm5ad', }, { - key: 'STANDARD5_AMD_NVME_DRIVE', + key: InstanceClass.STANDARD5_AMD_NVME_DRIVE, value: 'm5ad', }]; // A sample of instances with NVME drives for (const instanceClass of sampleInstanceClassKeys) { // WHEN - const key = instanceClass.key as keyof(typeof InstanceClass); - const instanceType = InstanceClass[key]; + const key = instanceClass.key; + const instanceType = InstanceType.of(key, InstanceSize.NANO); // THEN - expect(instanceType).toBe(instanceClass.value); + expect(instanceType.toString().split('.')[0]).toBe(instanceClass.value); } - - }); test('instance architecture throws an error when instance type is invalid', () => { // GIVEN diff --git a/packages/@aws-cdk/aws-ec2/test/userdata.test.ts b/packages/@aws-cdk/aws-ec2/test/userdata.test.ts index c385ce83a7254..fc877cbb2c7c9 100644 --- a/packages/@aws-cdk/aws-ec2/test/userdata.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/userdata.test.ts @@ -1,5 +1,5 @@ -import { Bucket } from '@aws-cdk/aws-s3'; import { Template, Match } from '@aws-cdk/assertions'; +import { Bucket } from '@aws-cdk/aws-s3'; import { Aws, Stack, CfnResource } from '@aws-cdk/core'; import * as ec2 from '../lib'; diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/base/scheduled-task-base.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/base/scheduled-task-base.ts index acc2846988837..1278be4ab6964 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/base/scheduled-task-base.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/base/scheduled-task-base.ts @@ -161,7 +161,7 @@ export abstract class ScheduledTaskBase extends CoreConstruct { throw new Error('You must specify a desiredTaskCount greater than 0'); } this.desiredTaskCount = props.desiredTaskCount || 1; - this.subnetSelection = props.subnetSelection || { subnetType: SubnetType.PRIVATE }; + this.subnetSelection = props.subnetSelection || { subnetType: SubnetType.PRIVATE_WITH_NAT }; this._securityGroups = props.securityGroups; // An EventRule that describes the event trigger (in this case a scheduled run) diff --git a/packages/@aws-cdk/aws-eks-legacy/lib/cluster.ts b/packages/@aws-cdk/aws-eks-legacy/lib/cluster.ts index 8c364f7268b3a..6edabf355ebf1 100644 --- a/packages/@aws-cdk/aws-eks-legacy/lib/cluster.ts +++ b/packages/@aws-cdk/aws-eks-legacy/lib/cluster.ts @@ -110,7 +110,7 @@ export interface ClusterProps { * * ```ts * const vpcSubnets = [ - * { subnetType: ec2.SubnetType.PRIVATE } + * { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT } * ] * ``` * diff --git a/packages/@aws-cdk/aws-eks/lib/cluster.ts b/packages/@aws-cdk/aws-eks/lib/cluster.ts index 66821aed579e9..c9a610ed24b19 100644 --- a/packages/@aws-cdk/aws-eks/lib/cluster.ts +++ b/packages/@aws-cdk/aws-eks/lib/cluster.ts @@ -405,7 +405,7 @@ export interface CommonClusterOptions { * * For example, to only select private subnets, supply the following: * - * `vpcSubnets: [{ subnetType: ec2.SubnetType.PRIVATE }]` + * `vpcSubnets: [{ subnetType: ec2.SubnetType.PRIVATE_WITH_NAT }]` * * @default - All public and private subnets */ @@ -1342,7 +1342,7 @@ export class Cluster extends ClusterBase { description: 'EKS Control Plane Security Group', }); - this.vpcSubnets = props.vpcSubnets ?? [{ subnetType: ec2.SubnetType.PUBLIC }, { subnetType: ec2.SubnetType.PRIVATE }]; + this.vpcSubnets = props.vpcSubnets ?? [{ subnetType: ec2.SubnetType.PUBLIC }, { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT }]; const selectedSubnetIdsPerGroup = this.vpcSubnets.map(s => this.vpc.selectSubnets(s).subnetIds); if (selectedSubnetIdsPerGroup.some(Token.isUnresolved) && selectedSubnetIdsPerGroup.length > 1) { diff --git a/packages/@aws-cdk/aws-eks/lib/fargate-profile.ts b/packages/@aws-cdk/aws-eks/lib/fargate-profile.ts index 8d5b0301ff24b..7625a4cfafb5d 100644 --- a/packages/@aws-cdk/aws-eks/lib/fargate-profile.ts +++ b/packages/@aws-cdk/aws-eks/lib/fargate-profile.ts @@ -165,7 +165,7 @@ export class FargateProfile extends CoreConstruct implements ITaggable { let subnets: string[] | undefined; if (props.vpc) { - const selection: ec2.SubnetSelection = props.subnetSelection ?? { subnetType: ec2.SubnetType.PRIVATE }; + const selection: ec2.SubnetSelection = props.subnetSelection ?? { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT }; subnets = props.vpc.selectSubnets(selection).subnetIds; } diff --git a/packages/@aws-cdk/aws-elasticloadbalancing/lib/load-balancer.ts b/packages/@aws-cdk/aws-elasticloadbalancing/lib/load-balancer.ts index e4029c9dc55c6..830373ec6cd95 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancing/lib/load-balancer.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancing/lib/load-balancer.ts @@ -477,7 +477,7 @@ function loadBalancerSubnets(props: LoadBalancerProps): SelectedSubnets { }); } else { return props.vpc.selectSubnets({ - subnetType: SubnetType.PRIVATE, + subnetType: SubnetType.PRIVATE_WITH_NAT, }); } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-elasticsearch/lib/domain.ts b/packages/@aws-cdk/aws-elasticsearch/lib/domain.ts index 88930526b81a5..86414cd66106f 100644 --- a/packages/@aws-cdk/aws-elasticsearch/lib/domain.ts +++ b/packages/@aws-cdk/aws-elasticsearch/lib/domain.ts @@ -1304,7 +1304,7 @@ export class Domain extends DomainBase implements IDomain, ec2.IConnectable { let subnets: ec2.ISubnet[] | undefined; if (props.vpc) { - subnets = selectSubnets(props.vpc, props.vpcSubnets ?? [{ subnetType: ec2.SubnetType.PRIVATE }]); + subnets = selectSubnets(props.vpc, props.vpcSubnets ?? [{ subnetType: ec2.SubnetType.PRIVATE_WITH_NAT }]); securityGroups = props.securityGroups ?? [new ec2.SecurityGroup(this, 'SecurityGroup', { vpc: props.vpc, description: `Security group for domain ${this.node.id}`, diff --git a/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts b/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts index c3bed0dc2c048..13a08dbd8d4eb 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts @@ -162,7 +162,7 @@ export class EcsTask implements events.IRuleTarget { const taskCount = this.taskCount; const taskDefinitionArn = this.taskDefinition.taskDefinitionArn; - const subnetSelection = this.props.subnetSelection || { subnetType: ec2.SubnetType.PRIVATE }; + const subnetSelection = this.props.subnetSelection || { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT }; const assignPublicIp = subnetSelection.subnetType === ec2.SubnetType.PUBLIC ? 'ENABLED' : 'DISABLED'; const baseEcsParameters = { taskCount, taskDefinitionArn }; diff --git a/packages/@aws-cdk/aws-neptune/lib/cluster.ts b/packages/@aws-cdk/aws-neptune/lib/cluster.ts index 2a33f4e4629fa..a9303286b3693 100644 --- a/packages/@aws-cdk/aws-neptune/lib/cluster.ts +++ b/packages/@aws-cdk/aws-neptune/lib/cluster.ts @@ -435,7 +435,7 @@ export class DatabaseCluster extends DatabaseClusterBase implements IDatabaseClu super(scope, id); this.vpc = props.vpc; - this.vpcSubnets = props.vpcSubnets ?? { subnetType: ec2.SubnetType.PRIVATE }; + this.vpcSubnets = props.vpcSubnets ?? { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT }; // Determine the subnet(s) to deploy the Neptune cluster to const { subnetIds, internetConnectivityEstablished } = this.vpc.selectSubnets(this.vpcSubnets); diff --git a/packages/@aws-cdk/aws-neptune/lib/subnet-group.ts b/packages/@aws-cdk/aws-neptune/lib/subnet-group.ts index 383435b7a0b38..d46c0163cfa34 100644 --- a/packages/@aws-cdk/aws-neptune/lib/subnet-group.ts +++ b/packages/@aws-cdk/aws-neptune/lib/subnet-group.ts @@ -74,7 +74,7 @@ export class SubnetGroup extends Resource implements ISubnetGroup { constructor(scope: Construct, id: string, props: SubnetGroupProps) { super(scope, id); - const { subnetIds } = props.vpc.selectSubnets(props.vpcSubnets ?? { subnetType: ec2.SubnetType.PRIVATE }); + const { subnetIds } = props.vpc.selectSubnets(props.vpcSubnets ?? { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT }); const subnetGroup = new CfnDBSubnetGroup(this, 'Resource', { dbSubnetGroupDescription: props.description || 'Subnet group for Neptune', diff --git a/packages/@aws-cdk/aws-opensearchservice/lib/domain.ts b/packages/@aws-cdk/aws-opensearchservice/lib/domain.ts index fbcd1d9f33d51..2b94569ee5c19 100644 --- a/packages/@aws-cdk/aws-opensearchservice/lib/domain.ts +++ b/packages/@aws-cdk/aws-opensearchservice/lib/domain.ts @@ -1236,7 +1236,7 @@ export class Domain extends DomainBase implements IDomain, ec2.IConnectable { let subnets: ec2.ISubnet[] | undefined; if (props.vpc) { - subnets = selectSubnets(props.vpc, props.vpcSubnets ?? [{ subnetType: ec2.SubnetType.PRIVATE }]); + subnets = selectSubnets(props.vpc, props.vpcSubnets ?? [{ subnetType: ec2.SubnetType.PRIVATE_WITH_NAT }]); securityGroups = props.securityGroups ?? [new ec2.SecurityGroup(this, 'SecurityGroup', { vpc: props.vpc, description: `Security group for domain ${this.node.id}`, diff --git a/packages/@aws-cdk/aws-redshift/lib/cluster.ts b/packages/@aws-cdk/aws-redshift/lib/cluster.ts index a43b6f6993c72..548c78f851671 100644 --- a/packages/@aws-cdk/aws-redshift/lib/cluster.ts +++ b/packages/@aws-cdk/aws-redshift/lib/cluster.ts @@ -415,7 +415,7 @@ export class Cluster extends ClusterBase { this.vpc = props.vpc; this.vpcSubnets = props.vpcSubnets ?? { - subnetType: ec2.SubnetType.PRIVATE, + subnetType: ec2.SubnetType.PRIVATE_WITH_NAT, }; const removalPolicy = props.removalPolicy ?? RemovalPolicy.RETAIN; diff --git a/packages/@aws-cdk/aws-redshift/lib/subnet-group.ts b/packages/@aws-cdk/aws-redshift/lib/subnet-group.ts index 1d4a6cbb25eca..35d8c53c8826f 100644 --- a/packages/@aws-cdk/aws-redshift/lib/subnet-group.ts +++ b/packages/@aws-cdk/aws-redshift/lib/subnet-group.ts @@ -65,7 +65,7 @@ export class ClusterSubnetGroup extends Resource implements IClusterSubnetGroup constructor(scope: Construct, id: string, props: ClusterSubnetGroupProps) { super(scope, id); - const { subnetIds } = props.vpc.selectSubnets(props.vpcSubnets ?? { subnetType: ec2.SubnetType.PRIVATE }); + const { subnetIds } = props.vpc.selectSubnets(props.vpcSubnets ?? { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT }); const subnetGroup = new CfnClusterSubnetGroup(this, 'Default', { description: props.description, diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/ecs/run-task.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/ecs/run-task.ts index 26dbc84a00e56..934bcd763a776 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/ecs/run-task.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/ecs/run-task.ts @@ -289,7 +289,7 @@ export class EcsRunTask extends sfn.TaskStateBase implements ec2.IConnectable { } private configureAwsVpcNetworking() { - const subnetSelection = this.props.subnets ?? { subnetType: this.props.assignPublicIp ? ec2.SubnetType.PUBLIC : ec2.SubnetType.PRIVATE }; + const subnetSelection = this.props.subnets ?? { subnetType: this.props.assignPublicIp ? ec2.SubnetType.PUBLIC : ec2.SubnetType.PRIVATE_WITH_NAT }; this.networkConfiguration = { AwsvpcConfiguration: { diff --git a/packages/aws-cdk-lib/package.json b/packages/aws-cdk-lib/package.json index 9e2d24647660d..96cd77e7c31a0 100644 --- a/packages/aws-cdk-lib/package.json +++ b/packages/aws-cdk-lib/package.json @@ -500,6 +500,7 @@ "./aws-iotthingsgraph": "./aws-iotthingsgraph/index.js", "./aws-iotwireless": "./aws-iotwireless/index.js", "./aws-ivs": "./aws-ivs/index.js", + "./aws-kafkaconnect": "./aws-kafkaconnect/index.js", "./aws-kendra": "./aws-kendra/index.js", "./aws-kinesis": "./aws-kinesis/index.js", "./aws-kinesisanalytics": "./aws-kinesisanalytics/index.js", @@ -605,7 +606,8 @@ "./pipelines/.jsii": "./pipelines/.jsii", "./pipelines/.warnings.jsii.js": "./pipelines/.warnings.jsii.js", "./pipelines/lib/helpers-internal": "./pipelines/lib/helpers-internal/index.js", - "./region-info": "./region-info/index.js" + "./region-info": "./region-info/index.js", + "./triggers": "./triggers/index.js" }, "preferredCdkCliVersion": "2" } diff --git a/packages/aws-cdk/does-not-exist.json b/packages/aws-cdk/does-not-exist.json new file mode 100644 index 0000000000000..fd1433699a125 --- /dev/null +++ b/packages/aws-cdk/does-not-exist.json @@ -0,0 +1 @@ +{"expiration":1646706808371,"notices":[{"title":"Error when building EKS cluster with monocdk import","issueNumber":17061,"overview":"When using monocdk/aws-eks to build a stack containing an EKS cluster, error is thrown about missing lambda-layer-node-proxy-agent/layer/package.json.","components":[{"name":"cli","version":"<1.130.0 >=1.126.0"}],"schemaVersion":"1"}]} diff --git a/tools/@aws-cdk/pkglint/test/temp5Tmm1x/README.md b/tools/@aws-cdk/pkglint/test/temp5Tmm1x/README.md new file mode 100644 index 0000000000000..79d4c4729cec3 --- /dev/null +++ b/tools/@aws-cdk/pkglint/test/temp5Tmm1x/README.md @@ -0,0 +1,31 @@ +# Alexa Skills Kit Construct Library + + +--- + +![cfn-resources: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge) + +> All classes with the `Cfn` prefix in this module ([CFN Resources]) are always stable and safe to use. +> +> [CFN Resources]: https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib + +--- + + + +This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project. + +```ts nofixture +import * as alexa_ask from '@aws-cdk/alexa-ask'; +``` + + + +There are no hand-written ([L2](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib)) constructs for this service yet. +However, you can still use the automatically generated [L1](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_l1_using) constructs, and use this service exactly as you would using CloudFormation directly. + +For more information on the resources and properties available for this service, see the [CloudFormation documentation for Alexa::ASK](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Alexa_ASK.html). + +(Read the [CDK Contributing Guide](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) if you are interested in contributing to this construct library.) + + From 867b9c3c107e9b67d68440880c754c915c51412a Mon Sep 17 00:00:00 2001 From: Yathi <511386+yuth@users.noreply.github.com> Date: Wed, 9 Mar 2022 17:20:44 -0800 Subject: [PATCH 2/5] chore: remove unneeded files --- packages/aws-cdk/does-not-exist.json | 1 - .../pkglint/test/temp5Tmm1x/README.md | 31 ------------------- 2 files changed, 32 deletions(-) delete mode 100644 packages/aws-cdk/does-not-exist.json delete mode 100644 tools/@aws-cdk/pkglint/test/temp5Tmm1x/README.md diff --git a/packages/aws-cdk/does-not-exist.json b/packages/aws-cdk/does-not-exist.json deleted file mode 100644 index fd1433699a125..0000000000000 --- a/packages/aws-cdk/does-not-exist.json +++ /dev/null @@ -1 +0,0 @@ -{"expiration":1646706808371,"notices":[{"title":"Error when building EKS cluster with monocdk import","issueNumber":17061,"overview":"When using monocdk/aws-eks to build a stack containing an EKS cluster, error is thrown about missing lambda-layer-node-proxy-agent/layer/package.json.","components":[{"name":"cli","version":"<1.130.0 >=1.126.0"}],"schemaVersion":"1"}]} diff --git a/tools/@aws-cdk/pkglint/test/temp5Tmm1x/README.md b/tools/@aws-cdk/pkglint/test/temp5Tmm1x/README.md deleted file mode 100644 index 79d4c4729cec3..0000000000000 --- a/tools/@aws-cdk/pkglint/test/temp5Tmm1x/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# Alexa Skills Kit Construct Library - - ---- - -![cfn-resources: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge) - -> All classes with the `Cfn` prefix in this module ([CFN Resources]) are always stable and safe to use. -> -> [CFN Resources]: https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib - ---- - - - -This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project. - -```ts nofixture -import * as alexa_ask from '@aws-cdk/alexa-ask'; -``` - - - -There are no hand-written ([L2](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib)) constructs for this service yet. -However, you can still use the automatically generated [L1](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_l1_using) constructs, and use this service exactly as you would using CloudFormation directly. - -For more information on the resources and properties available for this service, see the [CloudFormation documentation for Alexa::ASK](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Alexa_ASK.html). - -(Read the [CDK Contributing Guide](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) if you are interested in contributing to this construct library.) - - From 0e9ca1df71b853f3d7a7faa4c09044a3534de6f9 Mon Sep 17 00:00:00 2001 From: Yathi <511386+yuth@users.noreply.github.com> Date: Thu, 10 Mar 2022 10:36:10 -0800 Subject: [PATCH 3/5] fixup: update test to use non deprecated subnet type --- packages/@aws-cdk/aws-appsync/test/appsync-rds.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-rds.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-rds.test.ts index cc7329344b84e..bd97c9624a761 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-rds.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-rds.test.ts @@ -36,7 +36,7 @@ describe('Rds Data Source configuration', () => { credentials: { username: 'clusteradmin' }, clusterIdentifier: 'db-endpoint-test', vpc, - vpcSubnets: { subnetType: SubnetType.PRIVATE }, + vpcSubnets: { subnetType: SubnetType.PRIVATE_WITH_NAT }, securityGroups: [securityGroup], defaultDatabaseName: 'Animals', }); From f66e7fa085f8af4a321a01a4919e5d210afa4859 Mon Sep 17 00:00:00 2001 From: Yathi <511386+yuth@users.noreply.github.com> Date: Thu, 10 Mar 2022 13:06:27 -0800 Subject: [PATCH 4/5] fixup: update test to use non deprecated subnet type again --- packages/@aws-cdk/aws-appsync/test/appsync-rds.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-rds.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-rds.test.ts index bd97c9624a761..c98b1bdedabab 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-rds.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-rds.test.ts @@ -235,7 +235,7 @@ describe('adding rds data source from imported api', () => { credentials: { username: 'clusteradmin' }, clusterIdentifier: 'db-endpoint-test', vpc, - vpcSubnets: { subnetType: SubnetType.PRIVATE }, + vpcSubnets: { subnetType: SubnetType.PRIVATE_WITH_NAT }, securityGroups: [securityGroup], defaultDatabaseName: 'Animals', }); From e68c6ec1330939d965a856b6bc3f4afa88f9631a Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Thu, 30 Jun 2022 10:15:09 +0200 Subject: [PATCH 5/5] Missing instance types --- packages/@aws-cdk/aws-ec2/lib/instance-types.ts | 16 ++++++++++++---- packages/@aws-cdk/aws-ec2/test/instance.test.ts | 3 +-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/@aws-cdk/aws-ec2/lib/instance-types.ts b/packages/@aws-cdk/aws-ec2/lib/instance-types.ts index a0e50e4237c48..81f23307868ca 100644 --- a/packages/@aws-cdk/aws-ec2/lib/instance-types.ts +++ b/packages/@aws-cdk/aws-ec2/lib/instance-types.ts @@ -462,7 +462,7 @@ export enum InstanceClass { /** * I/O-optimized instances with local NVME drive powered by Intel Xeon Scalable processors (code named Ice Lake), 4th generation */ - IO4_INTEL = 'i4i', + IO4_INTEL = 'io4_intel', /** * I/O-optimized instances with local NVME drive powered by Intel Xeon Scalable processors (code named Ice Lake), 4th generation @@ -576,7 +576,7 @@ export enum InstanceClass { /** * Memory-intensive instances with higher network bandwith, local NVME drive, and extended memory. Intel Xeon Scalable (Ice Lake) processors */ - MEMORY_INTENSIVE_2_XT_INTEL = 'x2iedn', + MEMORY_INTENSIVE_2_XT_INTEL = 'memory_intensive_2_xt_intel', /** * Memory-intensive instances with higher network bandwith, local NVME drive, and extended memory. Intel Xeon Scalable (Ice Lake) processors @@ -586,7 +586,7 @@ export enum InstanceClass { /** * Memory-intensive instances with higher network bandwith and local NVME drive, Intel Xeon Scalable (Ice Lake) processors */ - MEMORY_INTENSIVE_2_INTEL = 'x2idn', + MEMORY_INTENSIVE_2_INTEL = 'memory_intensive_2_intel', /** * Memory-intensive instances with higher network bandwith and local NVME drive, Intel Xeon Scalable (Ice Lake) processors @@ -596,7 +596,7 @@ export enum InstanceClass { /** * Memory-intensive instances with higher network bandwith and single-threaded performance, Intel Xeon Scalable (Cascade Lake) processors */ - MEMORY_INTENSIVE_2_XTZ_INTEL = 'x2iezn', + MEMORY_INTENSIVE_2_XTZ_INTEL = 'memory_intensive_2_xtz_intel', /** * Memory-intensive instances with higher network bandwith and single-threaded performance, Intel Xeon Scalable (Cascade Lake) processors @@ -1089,6 +1089,14 @@ export class InstanceType { [InstanceClass.VT1]: 'vt1', [InstanceClass.HIGH_PERFORMANCE_COMPUTING6_AMD]: 'hpc6a', [InstanceClass.HPC6A]: 'hpc6a', + [InstanceClass.I4I]: 'i4i', + [InstanceClass.IO4_INTEL]: 'i4i', + [InstanceClass.X2IEDN]: 'x2iedn', + [InstanceClass.MEMORY_INTENSIVE_2_XT_INTEL]: 'x2iedn', + [InstanceClass.X2IDN]: 'x2idn', + [InstanceClass.MEMORY_INTENSIVE_2_INTEL]: 'x2idn', + [InstanceClass.X2IEZN]: 'x2iezn', + [InstanceClass.MEMORY_INTENSIVE_2_XTZ_INTEL]: 'x2iezn', }; return new InstanceType(`${instanceClassMap[instanceClass] ?? instanceClass}.${instanceSize}`); } diff --git a/packages/@aws-cdk/aws-ec2/test/instance.test.ts b/packages/@aws-cdk/aws-ec2/test/instance.test.ts index b2c797371e0ee..fc0d12c4d2482 100644 --- a/packages/@aws-cdk/aws-ec2/test/instance.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/instance.test.ts @@ -156,8 +156,7 @@ describe('instance', () => { for (const instanceClass of sampleInstanceClassKeys) { // WHEN - const key = instanceClass.key as keyof (typeof InstanceClass); - const instanceType = InstanceClass[key]; + const instanceType = InstanceType.of(instanceClass.key, InstanceSize.LARGE); // THEN expect(instanceType.toString().split('.')[0]).toBe(instanceClass.value); }