From a9c1cd0e34ddc9bf07096901444e4e00849855ab Mon Sep 17 00:00:00 2001 From: Pahud Hsieh Date: Tue, 23 Apr 2024 16:17:03 +0000 Subject: [PATCH 01/11] default to gp3 --- packages/aws-cdk-lib/aws-ec2/lib/volume.ts | 9 ++++++-- .../aws-cdk-lib/aws-ec2/test/volume.test.ts | 22 +++++++++++++++++-- packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md | 16 +++++++++++++- packages/aws-cdk-lib/cx-api/lib/features.ts | 13 +++++++++++ 4 files changed, 55 insertions(+), 5 deletions(-) diff --git a/packages/aws-cdk-lib/aws-ec2/lib/volume.ts b/packages/aws-cdk-lib/aws-ec2/lib/volume.ts index 57a2b6ae5cf48..323f9838d18e3 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/volume.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/volume.ts @@ -4,7 +4,9 @@ import { IInstance } from './instance'; import { AccountRootPrincipal, Grant, IGrantable } from '../../aws-iam'; import { IKey, ViaServicePrincipal } from '../../aws-kms'; import { IResource, Resource, Size, SizeRoundingBehavior, Stack, Token, Tags, Names, RemovalPolicy } from '../../core'; +import { FeatureFlags } from '../../core'; import { md5hash } from '../../core/lib/helpers-internal'; +import * as cxapi from '../../cx-api'; /** * Block device @@ -65,7 +67,8 @@ export interface EbsDeviceOptionsBase { * The EBS volume type * @see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html * - * @default `EbsDeviceVolumeType.GP2` + * @default `EbsDeviceVolumeType.GP2` or `EbsDeviceVolumeType.GP3` if + * `@aws-cdk/aws-ec2:ebsDefaultGp3Volume` is enabled. */ readonly volumeType?: EbsDeviceVolumeType; } @@ -621,7 +624,9 @@ export class Volume extends VolumeBase { size: props.size?.toGibibytes({ rounding: SizeRoundingBehavior.FAIL }), snapshotId: props.snapshotId, throughput: props.throughput, - volumeType: props.volumeType ?? EbsDeviceVolumeType.GENERAL_PURPOSE_SSD, + volumeType: props.volumeType ?? + FeatureFlags.of(this).isEnabled(cxapi.EBS_DEFAULT_GP3) ? + EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3 : EbsDeviceVolumeType.GENERAL_PURPOSE_SSD, }); resource.applyRemovalPolicy(props.removalPolicy); diff --git a/packages/aws-cdk-lib/aws-ec2/test/volume.test.ts b/packages/aws-cdk-lib/aws-ec2/test/volume.test.ts index cce55f2497bc8..ec602f6252825 100644 --- a/packages/aws-cdk-lib/aws-ec2/test/volume.test.ts +++ b/packages/aws-cdk-lib/aws-ec2/test/volume.test.ts @@ -2,6 +2,7 @@ import { Match, Template } from '../../assertions'; import { AccountRootPrincipal, Role } from '../../aws-iam'; import * as kms from '../../aws-kms'; import * as cdk from '../../core'; +import { cx_api as cxapi } from '../../cx-api'; import { AmazonLinuxGeneration, EbsDeviceVolumeType, @@ -29,7 +30,7 @@ describe('volume', () => { AvailabilityZone: 'us-east-1a', MultiAttachEnabled: false, Size: 8, - VolumeType: 'gp2', + VolumeType: 'gp3', Tags: [ { Key: 'Name', @@ -79,7 +80,7 @@ describe('volume', () => { AvailabilityZone: 'us-east-1a', MultiAttachEnabled: false, Size: 8, - VolumeType: 'gp2', + VolumeType: 'gp3', Tags: [{ Key: 'TagKey', Value: 'TagValue', @@ -457,6 +458,23 @@ describe('volume', () => { }); }); + test('EBS_DEFAULT_GP3 feature flag', () => { + // GIVEN + const stack = new cdk.Stack(); + + // WHEN + stack.node.setContext(cxapi.EBS_DEFAULT_GP3, true); + new Volume(stack, 'Volume', { + availabilityZone: 'us-east-1a', + size: cdk.Size.gibibytes(500), + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::EC2::Volume', { + VolumeType: 'gp3', + }); + }); + describe('grantAttachVolume to any instance with encryption', () => { test('with default key policies', () => { // GIVEN diff --git a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md index 54d245483776a..f341e3f01d5e2 100644 --- a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +++ b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md @@ -68,6 +68,7 @@ Flags come in three types: | [@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2](#aws-cdkaws-codepipelinedefaultpipelinetypetov2) | Enables Pipeline to set the default pipeline type to V2. | 2.133.0 | (default) | | [@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope](#aws-cdkaws-kmsreducecrossaccountregionpolicyscope) | When enabled, IAM Policy created from KMS key grant will reduce the resource scope to this key only. | 2.134.0 | (fix) | | [@aws-cdk/aws-eks:nodegroupNameAttribute](#aws-cdkaws-eksnodegroupnameattribute) | When enabled, nodegroupName attribute of the managed EKS NodeGroup will not have the cluster name prefix. | 2.138.0 | (fix) | +| [@aws-cdk/aws-ec2:ebsDefaultGp3Volume](#aws-cdkaws-ec2defaultgp3volume) | When enabled, the default volume type of EBS will be GP3. | 2.139.0 | (default) | @@ -128,7 +129,8 @@ The following json shows the current recommended set of flags, as `cdk init` wou "@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse": true, "@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2": true, "@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope": true, - "@aws-cdk/aws-eks:nodegroupNameAttribute": true + "@aws-cdk/aws-eks:nodegroupNameAttribute": true, + "@aws-cdk/aws-ec2:ebsDefaultGp3Volume": true, } } ``` @@ -1280,5 +1282,17 @@ When this feature flag is enabled, the nodegroupName attribute will be exactly t | (not in v1) | | | | 2.138.0 | `false` | `true` | +### @aws-cdk/aws-ec2:ebsDefaultGp3Volume + +*When enabled, the default volume type for EBS will be GP3.* (default) + +When this featuer flag is enabled, the default volume type of the EBS volume will be `EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3`. + + +| Since | Default | Recommended | +| ----- | ----- | ----- | +| (not in v1) | | | +| 2.139.0 | `false` | `true` | + diff --git a/packages/aws-cdk-lib/cx-api/lib/features.ts b/packages/aws-cdk-lib/cx-api/lib/features.ts index ba52813ceb600..3deda31f45eba 100644 --- a/packages/aws-cdk-lib/cx-api/lib/features.ts +++ b/packages/aws-cdk-lib/cx-api/lib/features.ts @@ -102,6 +102,7 @@ export const CODEPIPELINE_CROSS_ACCOUNT_KEYS_DEFAULT_VALUE_TO_FALSE = '@aws-cdk/ export const CODEPIPELINE_DEFAULT_PIPELINE_TYPE_TO_V2 = '@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2'; export const KMS_REDUCE_CROSS_ACCOUNT_REGION_POLICY_SCOPE = '@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope'; export const EKS_NODEGROUP_NAME = '@aws-cdk/aws-eks:nodegroupNameAttribute'; +export const EBS_DEFAULT_GP3 = '@aws-cdk/aws-ec2:ebsDefaultGp3Volume'; export const FLAGS: Record = { ////////////////////////////////////////////////////////////////////// @@ -1047,6 +1048,18 @@ export const FLAGS: Record = { introducedIn: { v2: 'V2NEXT' }, recommendedValue: true, }, + + ////////////////////////////////////////////////////////////////////// + [EBS_DEFAULT_GP3]: { + type: FlagType.ApiDefault, + summary: 'When enabled, the default volume type of the EBS volume will be GP3', + detailsMd: ` + When this featuer flag is enabled, the default volume type of the EBS volume will be \`EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3\`. + `, + introducedIn: { v2: 'V2NEXT' }, + recommendedValue: true, + compatibilityWithOldBehaviorMd: 'Pass `volumeType: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD` to `Volume` construct to restore the previous behavior.', + }, }; const CURRENT_MV = 'v2'; From e38f8af86cdbfbd3d57f37724972752626bb9508 Mon Sep 17 00:00:00 2001 From: Pahud Hsieh Date: Tue, 23 Apr 2024 16:24:23 +0000 Subject: [PATCH 02/11] update doc string --- packages/aws-cdk-lib/aws-ec2/lib/volume.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-ec2/lib/volume.ts b/packages/aws-cdk-lib/aws-ec2/lib/volume.ts index 323f9838d18e3..18e4e94d73077 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/volume.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/volume.ts @@ -67,7 +67,7 @@ export interface EbsDeviceOptionsBase { * The EBS volume type * @see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html * - * @default `EbsDeviceVolumeType.GP2` or `EbsDeviceVolumeType.GP3` if + * @default `EbsDeviceVolumeType.GENERAL_PURPOSE_SSD` or `EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3` if * `@aws-cdk/aws-ec2:ebsDefaultGp3Volume` is enabled. */ readonly volumeType?: EbsDeviceVolumeType; From 3f97d31006e93a8c3ccf136f5c4f035b1340f825 Mon Sep 17 00:00:00 2001 From: Pahud Hsieh Date: Tue, 23 Apr 2024 16:25:34 +0000 Subject: [PATCH 03/11] minor --- packages/aws-cdk-lib/aws-ec2/lib/volume.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/aws-ec2/lib/volume.ts b/packages/aws-cdk-lib/aws-ec2/lib/volume.ts index 18e4e94d73077..b1422e5b7026a 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/volume.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/volume.ts @@ -3,8 +3,7 @@ import { CfnVolume } from './ec2.generated'; import { IInstance } from './instance'; import { AccountRootPrincipal, Grant, IGrantable } from '../../aws-iam'; import { IKey, ViaServicePrincipal } from '../../aws-kms'; -import { IResource, Resource, Size, SizeRoundingBehavior, Stack, Token, Tags, Names, RemovalPolicy } from '../../core'; -import { FeatureFlags } from '../../core'; +import { IResource, Resource, Size, SizeRoundingBehavior, Stack, Token, Tags, Names, RemovalPolicy, FeatureFlags } from '../../core'; import { md5hash } from '../../core/lib/helpers-internal'; import * as cxapi from '../../cx-api'; From 4a25b5dff48e52400a7309ad17b15805407b47e3 Mon Sep 17 00:00:00 2001 From: Pahud Hsieh Date: Tue, 23 Apr 2024 17:01:42 +0000 Subject: [PATCH 04/11] update test --- packages/@aws-cdk/cx-api/FEATURE_FLAGS.md | 35 ++++++++++++++++++- packages/aws-cdk-lib/aws-ec2/lib/volume.ts | 4 +-- .../aws-cdk-lib/aws-ec2/test/volume.test.ts | 6 ++-- packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md | 29 ++++++++------- 4 files changed, 55 insertions(+), 19 deletions(-) diff --git a/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md b/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md index e3688ae4b55ae..58df49927d0f1 100644 --- a/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md +++ b/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md @@ -67,6 +67,8 @@ Flags come in three types: | [@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse](#aws-cdkaws-codepipelinecrossaccountkeysdefaultvaluetofalse) | Enables Pipeline to set the default value for crossAccountKeys to false. | 2.127.0 | (default) | | [@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2](#aws-cdkaws-codepipelinedefaultpipelinetypetov2) | Enables Pipeline to set the default pipeline type to V2. | 2.133.0 | (default) | | [@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope](#aws-cdkaws-kmsreducecrossaccountregionpolicyscope) | When enabled, IAM Policy created from KMS key grant will reduce the resource scope to this key only. | 2.134.0 | (fix) | +| [@aws-cdk/aws-ec2:ebsDefaultGp3Volume](#aws-cdkaws-ec2ebsdefaultgp3volume) | When enabled, the default volume type of the EBS volume will be GP3 | V2NEXT | (default) | +| [@aws-cdk/aws-eks:nodegroupNameAttribute](#aws-cdkaws-eksnodegroupnameattribute) | When enabled, nodegroupName attribute of the provisioned EKS NodeGroup will not have the cluster name prefix. | V2NEXT | (fix) | @@ -124,7 +126,9 @@ The following json shows the current recommended set of flags, as `cdk init` wou "@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction": true, "@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse": true, "@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2": true, - "@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope": true + "@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope": true, + "@aws-cdk/aws-eks:nodegroupNameAttribute": true, + "@aws-cdk/aws-ec2:ebsDefaultGp3Volume": true } } ``` @@ -1265,4 +1269,33 @@ When this feature flag is enabled and calling KMS key grant method, the created | 2.134.0 | `false` | `true` | +### @aws-cdk/aws-ec2:ebsDefaultGp3Volume + +*When enabled, the default volume type of the EBS volume will be GP3* (default) + +When this featuer flag is enabled, the default volume type of the EBS volume will be `EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3`. + + +| Since | Default | Recommended | +| ----- | ----- | ----- | +| (not in v1) | | | +| V2NEXT | `false` | `true` | + +**Compatibility with old behavior:** Pass `volumeType: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD` to `Volume` construct to restore the previous behavior. + + +### @aws-cdk/aws-eks:nodegroupNameAttribute + +*When enabled, nodegroupName attribute of the provisioned EKS NodeGroup will not have the cluster name prefix.* (fix) + +When this feature flag is enabled, the nodegroupName attribute will be exactly the name of the nodegroup without +any prefix. + + +| Since | Default | Recommended | +| ----- | ----- | ----- | +| (not in v1) | | | +| V2NEXT | `false` | `true` | + + diff --git a/packages/aws-cdk-lib/aws-ec2/lib/volume.ts b/packages/aws-cdk-lib/aws-ec2/lib/volume.ts index b1422e5b7026a..70d19b119f717 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/volume.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/volume.ts @@ -624,8 +624,8 @@ export class Volume extends VolumeBase { snapshotId: props.snapshotId, throughput: props.throughput, volumeType: props.volumeType ?? - FeatureFlags.of(this).isEnabled(cxapi.EBS_DEFAULT_GP3) ? - EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3 : EbsDeviceVolumeType.GENERAL_PURPOSE_SSD, + (FeatureFlags.of(this).isEnabled(cxapi.EBS_DEFAULT_GP3) ? + EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3 : EbsDeviceVolumeType.GENERAL_PURPOSE_SSD), }); resource.applyRemovalPolicy(props.removalPolicy); diff --git a/packages/aws-cdk-lib/aws-ec2/test/volume.test.ts b/packages/aws-cdk-lib/aws-ec2/test/volume.test.ts index ec602f6252825..612555a544c3c 100644 --- a/packages/aws-cdk-lib/aws-ec2/test/volume.test.ts +++ b/packages/aws-cdk-lib/aws-ec2/test/volume.test.ts @@ -2,7 +2,7 @@ import { Match, Template } from '../../assertions'; import { AccountRootPrincipal, Role } from '../../aws-iam'; import * as kms from '../../aws-kms'; import * as cdk from '../../core'; -import { cx_api as cxapi } from '../../cx-api'; +import * as cxapi from '../../cx-api'; import { AmazonLinuxGeneration, EbsDeviceVolumeType, @@ -30,7 +30,7 @@ describe('volume', () => { AvailabilityZone: 'us-east-1a', MultiAttachEnabled: false, Size: 8, - VolumeType: 'gp3', + VolumeType: 'gp2', Tags: [ { Key: 'Name', @@ -80,7 +80,7 @@ describe('volume', () => { AvailabilityZone: 'us-east-1a', MultiAttachEnabled: false, Size: 8, - VolumeType: 'gp3', + VolumeType: 'gp2', Tags: [{ Key: 'TagKey', Value: 'TagValue', diff --git a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md index f341e3f01d5e2..58df49927d0f1 100644 --- a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +++ b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md @@ -67,10 +67,8 @@ Flags come in three types: | [@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse](#aws-cdkaws-codepipelinecrossaccountkeysdefaultvaluetofalse) | Enables Pipeline to set the default value for crossAccountKeys to false. | 2.127.0 | (default) | | [@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2](#aws-cdkaws-codepipelinedefaultpipelinetypetov2) | Enables Pipeline to set the default pipeline type to V2. | 2.133.0 | (default) | | [@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope](#aws-cdkaws-kmsreducecrossaccountregionpolicyscope) | When enabled, IAM Policy created from KMS key grant will reduce the resource scope to this key only. | 2.134.0 | (fix) | -| [@aws-cdk/aws-eks:nodegroupNameAttribute](#aws-cdkaws-eksnodegroupnameattribute) | When enabled, nodegroupName attribute of the managed EKS NodeGroup will not have the cluster name prefix. | 2.138.0 | (fix) | -| [@aws-cdk/aws-ec2:ebsDefaultGp3Volume](#aws-cdkaws-ec2defaultgp3volume) | When enabled, the default volume type of EBS will be GP3. | 2.139.0 | (default) | - - +| [@aws-cdk/aws-ec2:ebsDefaultGp3Volume](#aws-cdkaws-ec2ebsdefaultgp3volume) | When enabled, the default volume type of the EBS volume will be GP3 | V2NEXT | (default) | +| [@aws-cdk/aws-eks:nodegroupNameAttribute](#aws-cdkaws-eksnodegroupnameattribute) | When enabled, nodegroupName attribute of the provisioned EKS NodeGroup will not have the cluster name prefix. | V2NEXT | (fix) | @@ -130,7 +128,7 @@ The following json shows the current recommended set of flags, as `cdk init` wou "@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2": true, "@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope": true, "@aws-cdk/aws-eks:nodegroupNameAttribute": true, - "@aws-cdk/aws-ec2:ebsDefaultGp3Volume": true, + "@aws-cdk/aws-ec2:ebsDefaultGp3Volume": true } } ``` @@ -1270,29 +1268,34 @@ When this feature flag is enabled and calling KMS key grant method, the created | (not in v1) | | | | 2.134.0 | `false` | `true` | -### @aws-cdk/aws-eks:nodegroupNameAttribute -*When enabled, nodegroupName attribute of the managed EKS nodegroup will not have the cluster name prefix.* (fix) +### @aws-cdk/aws-ec2:ebsDefaultGp3Volume + +*When enabled, the default volume type of the EBS volume will be GP3* (default) -When this feature flag is enabled, the nodegroupName attribute will be exactly the name of the nodegroup without any prefix. +When this featuer flag is enabled, the default volume type of the EBS volume will be `EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3`. | Since | Default | Recommended | | ----- | ----- | ----- | | (not in v1) | | | -| 2.138.0 | `false` | `true` | +| V2NEXT | `false` | `true` | -### @aws-cdk/aws-ec2:ebsDefaultGp3Volume +**Compatibility with old behavior:** Pass `volumeType: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD` to `Volume` construct to restore the previous behavior. -*When enabled, the default volume type for EBS will be GP3.* (default) -When this featuer flag is enabled, the default volume type of the EBS volume will be `EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3`. +### @aws-cdk/aws-eks:nodegroupNameAttribute + +*When enabled, nodegroupName attribute of the provisioned EKS NodeGroup will not have the cluster name prefix.* (fix) + +When this feature flag is enabled, the nodegroupName attribute will be exactly the name of the nodegroup without +any prefix. | Since | Default | Recommended | | ----- | ----- | ----- | | (not in v1) | | | -| 2.139.0 | `false` | `true` | +| V2NEXT | `false` | `true` | From 76492b8b2347a4da14d0de3c6fbcbfc042c1ecf6 Mon Sep 17 00:00:00 2001 From: Pahud Hsieh Date: Tue, 23 Apr 2024 17:05:48 +0000 Subject: [PATCH 05/11] update the md --- packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md | 21 +++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md index 58df49927d0f1..2bbc727d17f6e 100644 --- a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +++ b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md @@ -67,8 +67,8 @@ Flags come in three types: | [@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse](#aws-cdkaws-codepipelinecrossaccountkeysdefaultvaluetofalse) | Enables Pipeline to set the default value for crossAccountKeys to false. | 2.127.0 | (default) | | [@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2](#aws-cdkaws-codepipelinedefaultpipelinetypetov2) | Enables Pipeline to set the default pipeline type to V2. | 2.133.0 | (default) | | [@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope](#aws-cdkaws-kmsreducecrossaccountregionpolicyscope) | When enabled, IAM Policy created from KMS key grant will reduce the resource scope to this key only. | 2.134.0 | (fix) | -| [@aws-cdk/aws-ec2:ebsDefaultGp3Volume](#aws-cdkaws-ec2ebsdefaultgp3volume) | When enabled, the default volume type of the EBS volume will be GP3 | V2NEXT | (default) | | [@aws-cdk/aws-eks:nodegroupNameAttribute](#aws-cdkaws-eksnodegroupnameattribute) | When enabled, nodegroupName attribute of the provisioned EKS NodeGroup will not have the cluster name prefix. | V2NEXT | (fix) | +| [@aws-cdk/aws-ec2:ebsDefaultGp3Volume](#aws-cdkaws-ec2ebsdefaultgp3volume) | When enabled, the default volume type of the EBS volume will be GP3 | V2NEXT | (default) | @@ -1268,12 +1268,12 @@ When this feature flag is enabled and calling KMS key grant method, the created | (not in v1) | | | | 2.134.0 | `false` | `true` | +### @aws-cdk/aws-eks:nodegroupNameAttribute -### @aws-cdk/aws-ec2:ebsDefaultGp3Volume - -*When enabled, the default volume type of the EBS volume will be GP3* (default) +*When enabled, nodegroupName attribute of the provisioned EKS NodeGroup will not have the cluster name prefix.* (fix) -When this featuer flag is enabled, the default volume type of the EBS volume will be `EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3`. +When this feature flag is enabled, the nodegroupName attribute will be exactly the name of the nodegroup without +any prefix. | Since | Default | Recommended | @@ -1281,15 +1281,11 @@ When this featuer flag is enabled, the default volume type of the EBS volume wil | (not in v1) | | | | V2NEXT | `false` | `true` | -**Compatibility with old behavior:** Pass `volumeType: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD` to `Volume` construct to restore the previous behavior. - - -### @aws-cdk/aws-eks:nodegroupNameAttribute +### @aws-cdk/aws-ec2:ebsDefaultGp3Volume -*When enabled, nodegroupName attribute of the provisioned EKS NodeGroup will not have the cluster name prefix.* (fix) +*When enabled, the default volume type of the EBS volume will be GP3* (default) -When this feature flag is enabled, the nodegroupName attribute will be exactly the name of the nodegroup without -any prefix. +When this featuer flag is enabled, the default volume type of the EBS volume will be `EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3`. | Since | Default | Recommended | @@ -1297,5 +1293,6 @@ any prefix. | (not in v1) | | | | V2NEXT | `false` | `true` | +**Compatibility with old behavior:** Pass `volumeType: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD` to `Volume` construct to restore the previous behavior. From ae488ead3b017a2a88a03617767384e6e991b925 Mon Sep 17 00:00:00 2001 From: Pahud Hsieh Date: Tue, 23 Apr 2024 17:46:26 +0000 Subject: [PATCH 06/11] update md --- packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md index 2bbc727d17f6e..80c618e5b334b 100644 --- a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +++ b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md @@ -67,8 +67,8 @@ Flags come in three types: | [@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse](#aws-cdkaws-codepipelinecrossaccountkeysdefaultvaluetofalse) | Enables Pipeline to set the default value for crossAccountKeys to false. | 2.127.0 | (default) | | [@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2](#aws-cdkaws-codepipelinedefaultpipelinetypetov2) | Enables Pipeline to set the default pipeline type to V2. | 2.133.0 | (default) | | [@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope](#aws-cdkaws-kmsreducecrossaccountregionpolicyscope) | When enabled, IAM Policy created from KMS key grant will reduce the resource scope to this key only. | 2.134.0 | (fix) | -| [@aws-cdk/aws-eks:nodegroupNameAttribute](#aws-cdkaws-eksnodegroupnameattribute) | When enabled, nodegroupName attribute of the provisioned EKS NodeGroup will not have the cluster name prefix. | V2NEXT | (fix) | -| [@aws-cdk/aws-ec2:ebsDefaultGp3Volume](#aws-cdkaws-ec2ebsdefaultgp3volume) | When enabled, the default volume type of the EBS volume will be GP3 | V2NEXT | (default) | +| [@aws-cdk/aws-eks:nodegroupNameAttribute](#aws-cdkaws-eksnodegroupnameattribute) | When enabled, nodegroupName attribute of the provisioned EKS NodeGroup will not have the cluster name prefix. | 2.138.0 | (fix) | +| [@aws-cdk/aws-ec2:ebsDefaultGp3Volume](#aws-cdkaws-ec2ebsdefaultgp3volume) | When enabled, the default volume type of the EBS volume will be GP3 | 2.139.0 | (default) | @@ -1279,7 +1279,7 @@ any prefix. | Since | Default | Recommended | | ----- | ----- | ----- | | (not in v1) | | | -| V2NEXT | `false` | `true` | +| 2.138.0 | `false` | `true` | ### @aws-cdk/aws-ec2:ebsDefaultGp3Volume @@ -1291,7 +1291,7 @@ When this featuer flag is enabled, the default volume type of the EBS volume wil | Since | Default | Recommended | | ----- | ----- | ----- | | (not in v1) | | | -| V2NEXT | `false` | `true` | +| 2.139.0 | `false` | `true` | **Compatibility with old behavior:** Pass `volumeType: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD` to `Volume` construct to restore the previous behavior. From c94465f49107217e77933d3842ef5e80beb17eb3 Mon Sep 17 00:00:00 2001 From: Pahud Hsieh Date: Tue, 23 Apr 2024 17:49:56 +0000 Subject: [PATCH 07/11] revert --- packages/@aws-cdk/cx-api/FEATURE_FLAGS.md | 37 ++--------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md b/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md index 58df49927d0f1..cce2087288c38 100644 --- a/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md +++ b/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md @@ -67,8 +67,6 @@ Flags come in three types: | [@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse](#aws-cdkaws-codepipelinecrossaccountkeysdefaultvaluetofalse) | Enables Pipeline to set the default value for crossAccountKeys to false. | 2.127.0 | (default) | | [@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2](#aws-cdkaws-codepipelinedefaultpipelinetypetov2) | Enables Pipeline to set the default pipeline type to V2. | 2.133.0 | (default) | | [@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope](#aws-cdkaws-kmsreducecrossaccountregionpolicyscope) | When enabled, IAM Policy created from KMS key grant will reduce the resource scope to this key only. | 2.134.0 | (fix) | -| [@aws-cdk/aws-ec2:ebsDefaultGp3Volume](#aws-cdkaws-ec2ebsdefaultgp3volume) | When enabled, the default volume type of the EBS volume will be GP3 | V2NEXT | (default) | -| [@aws-cdk/aws-eks:nodegroupNameAttribute](#aws-cdkaws-eksnodegroupnameattribute) | When enabled, nodegroupName attribute of the provisioned EKS NodeGroup will not have the cluster name prefix. | V2NEXT | (fix) | @@ -126,9 +124,7 @@ The following json shows the current recommended set of flags, as `cdk init` wou "@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction": true, "@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse": true, "@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2": true, - "@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope": true, - "@aws-cdk/aws-eks:nodegroupNameAttribute": true, - "@aws-cdk/aws-ec2:ebsDefaultGp3Volume": true + "@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope": true } } ``` @@ -1269,33 +1265,4 @@ When this feature flag is enabled and calling KMS key grant method, the created | 2.134.0 | `false` | `true` | -### @aws-cdk/aws-ec2:ebsDefaultGp3Volume - -*When enabled, the default volume type of the EBS volume will be GP3* (default) - -When this featuer flag is enabled, the default volume type of the EBS volume will be `EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3`. - - -| Since | Default | Recommended | -| ----- | ----- | ----- | -| (not in v1) | | | -| V2NEXT | `false` | `true` | - -**Compatibility with old behavior:** Pass `volumeType: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD` to `Volume` construct to restore the previous behavior. - - -### @aws-cdk/aws-eks:nodegroupNameAttribute - -*When enabled, nodegroupName attribute of the provisioned EKS NodeGroup will not have the cluster name prefix.* (fix) - -When this feature flag is enabled, the nodegroupName attribute will be exactly the name of the nodegroup without -any prefix. - - -| Since | Default | Recommended | -| ----- | ----- | ----- | -| (not in v1) | | | -| V2NEXT | `false` | `true` | - - - + \ No newline at end of file From c7cf0d18da74948c470c2ffc139d8ae2d8cf5fdc Mon Sep 17 00:00:00 2001 From: Pahud Hsieh Date: Tue, 23 Apr 2024 17:51:01 +0000 Subject: [PATCH 08/11] revert --- packages/@aws-cdk/cx-api/FEATURE_FLAGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md b/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md index cce2087288c38..e3688ae4b55ae 100644 --- a/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md +++ b/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md @@ -1265,4 +1265,4 @@ When this feature flag is enabled and calling KMS key grant method, the created | 2.134.0 | `false` | `true` | - \ No newline at end of file + From 0b70f7dbbd8ebea72fd26c10483e04eacff85912 Mon Sep 17 00:00:00 2001 From: Pahud Hsieh Date: Tue, 23 Apr 2024 17:54:32 +0000 Subject: [PATCH 09/11] rev --- packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md index 80c618e5b334b..ec1a93e9f9d01 100644 --- a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +++ b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md @@ -1270,10 +1270,9 @@ When this feature flag is enabled and calling KMS key grant method, the created ### @aws-cdk/aws-eks:nodegroupNameAttribute -*When enabled, nodegroupName attribute of the provisioned EKS NodeGroup will not have the cluster name prefix.* (fix) +*When enabled, nodegroupName attribute of the managed EKS nodegroup will not have the cluster name prefix.* (fix) -When this feature flag is enabled, the nodegroupName attribute will be exactly the name of the nodegroup without -any prefix. +When this feature flag is enabled, the nodegroupName attribute will be exactly the name of the nodegroup without any prefix. | Since | Default | Recommended | From 54afe0db5a508f5d085ad66c4395625963789783 Mon Sep 17 00:00:00 2001 From: Pahud Hsieh Date: Tue, 23 Apr 2024 17:55:19 +0000 Subject: [PATCH 10/11] rev --- packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md index ec1a93e9f9d01..1dbe567f08c5b 100644 --- a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +++ b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md @@ -67,7 +67,7 @@ Flags come in three types: | [@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse](#aws-cdkaws-codepipelinecrossaccountkeysdefaultvaluetofalse) | Enables Pipeline to set the default value for crossAccountKeys to false. | 2.127.0 | (default) | | [@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2](#aws-cdkaws-codepipelinedefaultpipelinetypetov2) | Enables Pipeline to set the default pipeline type to V2. | 2.133.0 | (default) | | [@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope](#aws-cdkaws-kmsreducecrossaccountregionpolicyscope) | When enabled, IAM Policy created from KMS key grant will reduce the resource scope to this key only. | 2.134.0 | (fix) | -| [@aws-cdk/aws-eks:nodegroupNameAttribute](#aws-cdkaws-eksnodegroupnameattribute) | When enabled, nodegroupName attribute of the provisioned EKS NodeGroup will not have the cluster name prefix. | 2.138.0 | (fix) | +| [@aws-cdk/aws-eks:nodegroupNameAttribute](#aws-cdkaws-eksnodegroupnameattribute) | When enabled, nodegroupName attribute of the managed EKS NodeGroup will not have the cluster name prefix. | 2.138.0 | (fix) | | [@aws-cdk/aws-ec2:ebsDefaultGp3Volume](#aws-cdkaws-ec2ebsdefaultgp3volume) | When enabled, the default volume type of the EBS volume will be GP3 | 2.139.0 | (default) | From aa40ff7d0cc4da43bb9b2e2d695db705bddf17ae Mon Sep 17 00:00:00 2001 From: Pahud Hsieh Date: Wed, 24 Apr 2024 18:58:00 +0000 Subject: [PATCH 11/11] update README --- packages/aws-cdk-lib/cx-api/README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/aws-cdk-lib/cx-api/README.md b/packages/aws-cdk-lib/cx-api/README.md index 17134308a606a..5862a3016db16 100644 --- a/packages/aws-cdk-lib/cx-api/README.md +++ b/packages/aws-cdk-lib/cx-api/README.md @@ -326,3 +326,19 @@ _cdk.json_ } } ``` + +* `@aws-cdk/aws-ec2:ebsDefaultGp3Volume` + +When enabled, the default volume type of the EBS volume will be GP3. + +When this featuer flag is enabled, the default volume type of the EBS volume will be `EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3` + +_cdk.json_ + +```json +{ + "context": { + "@aws-cdk/aws-ec2:ebsDefaultGp3Volume": true + } +} +```