From b984ba32b18d7e7d9c759fceec5e5f8702d9739a Mon Sep 17 00:00:00 2001 From: watany <76135106+watany-dev@users.noreply.github.com> Date: Fri, 8 Nov 2024 04:48:56 +0000 Subject: [PATCH 1/6] fix(ec2): expose EntryProperty --- packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts | 10 +++++++++- .../aws-cdk-lib/aws-ec2/test/prefix-list.test.ts | 12 +++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts b/packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts index 1f0ae1efbd77a..1188aa135b61b 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts @@ -14,6 +14,14 @@ export interface IPrefixList extends IResource { readonly prefixListId: string; } +/** + * An entry for a prefix list. + */ +export interface EntryProperty extends CfnPrefixList.EntryProperty{ + cidr: string; + description?: string; +} + /** * The IP address type. */ @@ -60,7 +68,7 @@ export interface PrefixListProps extends PrefixListOptions { * * @default [] */ - readonly entries?: CfnPrefixList.EntryProperty[]; + readonly entries?: EntryProperty[]; } /** diff --git a/packages/aws-cdk-lib/aws-ec2/test/prefix-list.test.ts b/packages/aws-cdk-lib/aws-ec2/test/prefix-list.test.ts index 209f6cb665e02..12274861b904e 100644 --- a/packages/aws-cdk-lib/aws-ec2/test/prefix-list.test.ts +++ b/packages/aws-cdk-lib/aws-ec2/test/prefix-list.test.ts @@ -1,6 +1,6 @@ import { Template } from '../../assertions'; import { Stack } from '../../core'; -import { AddressFamily, PrefixList } from '../lib/prefix-list'; +import { AddressFamily, EntryProperty, PrefixList } from '../lib/prefix-list'; describe('prefix list', () => { test('default empty prefixlist', () => { @@ -35,11 +35,13 @@ describe('prefix list', () => { test('prefixlist with entries', () => { // GIVEN const stack = new Stack(); + + const entries: EntryProperty[] = [ + { cidr: '10.0.0.1/32' }, + { cidr: '10.0.0.2/32', description: 'sample1' }, + ]; new PrefixList(stack, 'prefix-list', { - entries: [ - { cidr: '10.0.0.1/32' }, - { cidr: '10.0.0.2/32', description: 'sample1' }, - ], + entries, prefixListName: 'prefix-list', }); From fb0db25c4a33288bb53021fd3ab7b232cdec6050 Mon Sep 17 00:00:00 2001 From: watany <76135106+watany-dev@users.noreply.github.com> Date: Fri, 8 Nov 2024 05:29:17 +0000 Subject: [PATCH 2/6] fix: remove extend --- packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts b/packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts index 1188aa135b61b..ce70e9a835b61 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts @@ -17,9 +17,18 @@ export interface IPrefixList extends IResource { /** * An entry for a prefix list. */ -export interface EntryProperty extends CfnPrefixList.EntryProperty{ - cidr: string; - description?: string; +export interface EntryProperty { + /** + * The CIDR block. + */ + readonly cidr: string; + + /** + * A description for the entry. + * + * Constraints: Up to 255 characters in length. + */ + readonly description?: string; } /** From d3ea9abfc31d34a3618d70474374be45c626a646 Mon Sep 17 00:00:00 2001 From: watany <76135106+watany-dev@users.noreply.github.com> Date: Fri, 8 Nov 2024 05:39:23 +0000 Subject: [PATCH 3/6] update integ-test --- .../aws-ec2/test/integ.prefix-list.js.snapshot/cdk.out | 2 +- .../integ-ec2-prefix-list-test.assets.json | 6 +++--- .../integ-ec2-prefix-list-test.template.json | 6 +++--- .../test/integ.prefix-list.js.snapshot/integ.json | 2 +- ...ntegtestDefaultTestDeployAssert24D5C536.assets.json | 2 +- .../test/integ.prefix-list.js.snapshot/manifest.json | 8 ++++++-- .../test/integ.prefix-list.js.snapshot/tree.json | 10 +++++----- 7 files changed, 20 insertions(+), 16 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/cdk.out index 7925065efbcc4..c6e612584e352 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"31.0.0"} \ No newline at end of file +{"version":"38.0.1"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/integ-ec2-prefix-list-test.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/integ-ec2-prefix-list-test.assets.json index 16839acb7274c..465f9fea4dfb6 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/integ-ec2-prefix-list-test.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/integ-ec2-prefix-list-test.assets.json @@ -1,7 +1,7 @@ { - "version": "31.0.0", + "version": "38.0.1", "files": { - "2cb0a44838e31f68717daa5de0b7b2149c2fedb3892bff48470b979550060afa": { + "9cc064894e83cfbc2df24434589f779ff6b8de6b7d8be0e505decece10bf5d9e": { "source": { "path": "integ-ec2-prefix-list-test.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "2cb0a44838e31f68717daa5de0b7b2149c2fedb3892bff48470b979550060afa.json", + "objectKey": "9cc064894e83cfbc2df24434589f779ff6b8de6b7d8be0e505decece10bf5d9e.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/integ-ec2-prefix-list-test.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/integ-ec2-prefix-list-test.template.json index 19a92b33dc58d..db9e972c16eca 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/integ-ec2-prefix-list-test.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/integ-ec2-prefix-list-test.template.json @@ -4,8 +4,6 @@ "Type": "AWS::EC2::PrefixList", "Properties": { "AddressFamily": "IPv4", - "MaxEntries": 2, - "PrefixListName": "integec2prefixlisttestPrefixList498BBB96", "Entries": [ { "Cidr": "10.0.0.1/32" @@ -14,7 +12,9 @@ "Cidr": "10.0.0.2/32", "Description": "sample1" } - ] + ], + "MaxEntries": 2, + "PrefixListName": "integec2prefixlisttestPrefixList498BBB96" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/integ.json index d40abfebc1d07..8321000ef072d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "31.0.0", + "version": "38.0.1", "testCases": { "integ-test/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/integtestDefaultTestDeployAssert24D5C536.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/integtestDefaultTestDeployAssert24D5C536.assets.json index ecd9f6bd2a455..90c1e9e0e0637 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/integtestDefaultTestDeployAssert24D5C536.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/integtestDefaultTestDeployAssert24D5C536.assets.json @@ -1,5 +1,5 @@ { - "version": "31.0.0", + "version": "38.0.1", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/manifest.json index 71062d7cae93d..1991f7ef3146c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "31.0.0", + "version": "38.0.1", "artifacts": { "integ-ec2-prefix-list-test.assets": { "type": "cdk:asset-manifest", @@ -14,10 +14,12 @@ "environment": "aws://unknown-account/unknown-region", "properties": { "templateFile": "integ-ec2-prefix-list-test.template.json", + "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2cb0a44838e31f68717daa5de0b7b2149c2fedb3892bff48470b979550060afa.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/9cc064894e83cfbc2df24434589f779ff6b8de6b7d8be0e505decece10bf5d9e.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -67,7 +69,9 @@ "environment": "aws://unknown-account/unknown-region", "properties": { "templateFile": "integtestDefaultTestDeployAssert24D5C536.template.json", + "terminationProtection": false, "validateOnSynth": false, + "notificationArns": [], "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/tree.json index ca1b5265d7056..7567944c26d39 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.prefix-list.js.snapshot/tree.json @@ -19,8 +19,6 @@ "aws:cdk:cloudformation:type": "AWS::EC2::PrefixList", "aws:cdk:cloudformation:props": { "addressFamily": "IPv4", - "maxEntries": 2, - "prefixListName": "integec2prefixlisttestPrefixList498BBB96", "entries": [ { "cidr": "10.0.0.1/32" @@ -29,7 +27,9 @@ "cidr": "10.0.0.2/32", "description": "sample1" } - ] + ], + "maxEntries": 2, + "prefixListName": "integec2prefixlisttestPrefixList498BBB96" } }, "constructInfo": { @@ -78,7 +78,7 @@ "path": "integ-test/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.270" + "version": "10.4.2" } }, "DeployAssert": { @@ -124,7 +124,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.270" + "version": "10.4.2" } } }, From 0feeb450e2b18c8a60b07d7dfe2d30ee875e296b Mon Sep 17 00:00:00 2001 From: watany <76135106+watany-dev@users.noreply.github.com> Date: Fri, 8 Nov 2024 06:35:17 +0000 Subject: [PATCH 4/6] adding default --- packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts b/packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts index ce70e9a835b61..9333c690d744b 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts @@ -27,6 +27,8 @@ export interface EntryProperty { * A description for the entry. * * Constraints: Up to 255 characters in length. + * + * @default No Value. */ readonly description?: string; } From 8de8d7e2c27c86f4eea8a82a209cbed13b19d5e6 Mon Sep 17 00:00:00 2001 From: watany <76135106+watany-dev@users.noreply.github.com> Date: Thu, 14 Nov 2024 06:35:34 +0000 Subject: [PATCH 5/6] fix --- packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts b/packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts index 9333c690d744b..2616e6bd96cc2 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts @@ -28,7 +28,7 @@ export interface EntryProperty { * * Constraints: Up to 255 characters in length. * - * @default No Value. + * @default None */ readonly description?: string; } From a74b7970b720ea3b2c3e6e8ce5d97f19c850c947 Mon Sep 17 00:00:00 2001 From: watany <76135106+watany-dev@users.noreply.github.com> Date: Fri, 22 Nov 2024 07:04:22 +0000 Subject: [PATCH 6/6] extend --- packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts b/packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts index 2616e6bd96cc2..9c483538401ed 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts @@ -17,21 +17,7 @@ export interface IPrefixList extends IResource { /** * An entry for a prefix list. */ -export interface EntryProperty { - /** - * The CIDR block. - */ - readonly cidr: string; - - /** - * A description for the entry. - * - * Constraints: Up to 255 characters in length. - * - * @default None - */ - readonly description?: string; -} +export interface EntryProperty extends CfnPrefixList.EntryProperty {} /** * The IP address type.