From 01be69f6445f57150e240ca960ee67fab4cf0ee3 Mon Sep 17 00:00:00 2001 From: Yu Urata <77177966+andyu17@users.noreply.github.com> Date: Sun, 26 Jan 2025 10:15:26 +0900 Subject: [PATCH 1/4] docs(batch): fix typos (#33166) ### Issue # (if applicable) None ### Reason for this change Fixed typos in code comments. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/aws-cdk-lib/aws-batch/lib/ecs-job-definition.ts | 4 ++-- .../aws-cdk-lib/aws-batch/lib/multinode-job-definition.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/aws-cdk-lib/aws-batch/lib/ecs-job-definition.ts b/packages/aws-cdk-lib/aws-batch/lib/ecs-job-definition.ts index f43aafbef86fb..2f895793f18b7 100644 --- a/packages/aws-cdk-lib/aws-batch/lib/ecs-job-definition.ts +++ b/packages/aws-cdk-lib/aws-batch/lib/ecs-job-definition.ts @@ -16,7 +16,7 @@ interface IEcsJobDefinition extends IJobDefinition { readonly container: IEcsContainerDefinition; /** - * Whether to propogate tags from the JobDefinition + * Whether to propagate tags from the JobDefinition * to the ECS task that Batch spawns * * @default false @@ -42,7 +42,7 @@ export interface EcsJobDefinitionProps extends JobDefinitionProps { readonly container: IEcsContainerDefinition; /** - * Whether to propogate tags from the JobDefinition + * Whether to propagate tags from the JobDefinition * to the ECS task that Batch spawns * * @default false diff --git a/packages/aws-cdk-lib/aws-batch/lib/multinode-job-definition.ts b/packages/aws-cdk-lib/aws-batch/lib/multinode-job-definition.ts index a103c8819f1fd..de5bf801440c6 100644 --- a/packages/aws-cdk-lib/aws-batch/lib/multinode-job-definition.ts +++ b/packages/aws-cdk-lib/aws-batch/lib/multinode-job-definition.ts @@ -42,7 +42,7 @@ interface IMultiNodeJobDefinition extends IJobDefinition { readonly mainNode?: number; /** - * Whether to propogate tags from the JobDefinition + * Whether to propagate tags from the JobDefinition * to the ECS task that Batch spawns * * @default false @@ -109,7 +109,7 @@ export interface MultiNodeJobDefinitionProps extends JobDefinitionProps { readonly mainNode?: number; /** - * Whether to propogate tags from the JobDefinition + * Whether to propagate tags from the JobDefinition * to the ECS task that Batch spawns * * @default false From 01abd83652632aa705ac8b972baf86c12deb5a64 Mon Sep 17 00:00:00 2001 From: Matsuda Date: Sun, 26 Jan 2025 10:47:43 +0900 Subject: [PATCH 2/4] feat(bedrock): support Luma AI's Ray2 visual AI model (#33163) Add a new foundation model. Ref * https://aws.amazon.com/about-aws/whats-new/2025/01/luma-ais-ray2-visual-ai-model-amazon-bedrock/ ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/aws-cdk-lib/aws-bedrock/lib/foundation-model.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/aws-cdk-lib/aws-bedrock/lib/foundation-model.ts b/packages/aws-cdk-lib/aws-bedrock/lib/foundation-model.ts index a43302c24d119..fe850e246bcd8 100644 --- a/packages/aws-cdk-lib/aws-bedrock/lib/foundation-model.ts +++ b/packages/aws-cdk-lib/aws-bedrock/lib/foundation-model.ts @@ -281,6 +281,9 @@ export class FoundationModelIdentifier { /** Base model "cohere.embed-multilingual-v3:0:512". */ public static readonly COHERE_EMBED_MULTILINGUAL_V3_0_512 = new FoundationModelIdentifier('cohere.embed-multilingual-v3:0:512'); + /** Base model "luma.ray-v2:0". */ + public static readonly LUMA_RAY_V2_0 = new FoundationModelIdentifier('luma.ray-v2:0'); + /** * Base model "meta.llama2-13b-v1". * @deprecated use latest version of the model From 111ffc210d7230a25be4711f6623e3303a884496 Mon Sep 17 00:00:00 2001 From: Matsuda Date: Sun, 26 Jan 2025 11:20:15 +0900 Subject: [PATCH 3/4] feat(rds): support Aurora PostgreSQL Limitless Database PostgreSQL 16.6 (#33162) Add new Limitless Database Engine. Ref: * https://aws.amazon.com/about-aws/whats-new/2025/01/amazon-aurora-postgresql-limitless-database-16-6/ * https://docs.aws.amazon.com/AmazonRDS/latest/AuroraPostgreSQLReleaseNotes/limitless-updates.html#16.6-limitless ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/aws-cdk-lib/aws-rds/lib/cluster-engine.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/aws-cdk-lib/aws-rds/lib/cluster-engine.ts b/packages/aws-cdk-lib/aws-rds/lib/cluster-engine.ts index 285bc661844d7..f4a3dfb56732b 100644 --- a/packages/aws-cdk-lib/aws-rds/lib/cluster-engine.ts +++ b/packages/aws-cdk-lib/aws-rds/lib/cluster-engine.ts @@ -1087,6 +1087,8 @@ export class AuroraPostgresEngineVersion { public static readonly VER_16_5 = AuroraPostgresEngineVersion.of('16.5', '16', { s3Import: true, s3Export: true }); /** Version "16.6". */ public static readonly VER_16_6 = AuroraPostgresEngineVersion.of('16.6', '16', { s3Import: true, s3Export: true }); + /** Version "16.6 limitless" */ + public static readonly VER_16_6_LIMITLESS = AuroraPostgresEngineVersion.of('16.6-limitless', '16', { s3Import: true, s3Export: true }); /** Version "17.1". */ public static readonly VER_17_1 = AuroraPostgresEngineVersion.of('17.1', '17', { s3Import: true, s3Export: true }); /** Version "17.2". */ From bfa0f15edaeac4be8f4dee66149db51432a6a8d2 Mon Sep 17 00:00:00 2001 From: Matsuda Date: Sun, 26 Jan 2025 11:52:25 +0900 Subject: [PATCH 4/4] feat(sns): support high throughput mode for FIFO topics (#33056) ### Issue # (if applicable) N/A ### Reason for this change Amazon SNS now supports high throughput mode. Ref: [high-throughput mode for Amazon SNS FIFO Topics](https://aws.amazon.com/about-aws/whats-new/2025/01/high-throughput-mode-amazon-sns-fifo-topics) ### Description of changes Add `fifoThroughputScope` property. ### Describe any new or updated permissions being added Nothing ### Description of how you validated changes Add unit tests and an integ test. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../cdk.out | 1 + .../integ.json | 12 ++ .../manifest.json | 119 ++++++++++++++ .../sns-fifo-throughput-scope.assets.json | 19 +++ .../sns-fifo-throughput-scope.template.json | 54 +++++++ ...efaultTestDeployAssertBAF90E92.assets.json | 19 +++ ...aultTestDeployAssertBAF90E92.template.json | 36 +++++ .../tree.json | 153 ++++++++++++++++++ .../test/integ.sns-fifo-throughput-scope.ts | 28 ++++ packages/aws-cdk-lib/aws-sns/README.md | 20 +++ packages/aws-cdk-lib/aws-sns/lib/topic.ts | 32 ++++ packages/aws-cdk-lib/aws-sns/test/sns.test.ts | 31 ++++ 12 files changed, 524 insertions(+) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/cdk.out create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/integ.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/manifest.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/sns-fifo-throughput-scope.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/sns-fifo-throughput-scope.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/snsfifothroughputscopetestDefaultTestDeployAssertBAF90E92.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/snsfifothroughputscopetestDefaultTestDeployAssertBAF90E92.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/tree.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/cdk.out new file mode 100644 index 0000000000000..91e1a8b9901d5 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"39.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/integ.json new file mode 100644 index 0000000000000..9a7b76d148fb2 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "39.0.0", + "testCases": { + "sns-fifo-throughput-scope-test/DefaultTest": { + "stacks": [ + "sns-fifo-throughput-scope" + ], + "assertionStack": "sns-fifo-throughput-scope-test/DefaultTest/DeployAssert", + "assertionStackName": "snsfifothroughputscopetestDefaultTestDeployAssertBAF90E92" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/manifest.json new file mode 100644 index 0000000000000..62f53ca3df8f3 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/manifest.json @@ -0,0 +1,119 @@ +{ + "version": "39.0.0", + "artifacts": { + "sns-fifo-throughput-scope.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "sns-fifo-throughput-scope.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "sns-fifo-throughput-scope": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "sns-fifo-throughput-scope.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "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}/f479d71edc397ab84e3385982c1e1598b5b59f17c8258c137fb2b424bb1d489d.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "sns-fifo-throughput-scope.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "sns-fifo-throughput-scope.assets" + ], + "metadata": { + "/sns-fifo-throughput-scope/MessageGroupScopeTopic/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "MessageGroupScopeTopicAB4E2D6F" + } + ], + "/sns-fifo-throughput-scope/TopicScopeTopic/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "TopicScopeTopic8DEBB616" + } + ], + "/sns-fifo-throughput-scope/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/sns-fifo-throughput-scope/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "sns-fifo-throughput-scope" + }, + "snsfifothroughputscopetestDefaultTestDeployAssertBAF90E92.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "snsfifothroughputscopetestDefaultTestDeployAssertBAF90E92.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "snsfifothroughputscopetestDefaultTestDeployAssertBAF90E92": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "snsfifothroughputscopetestDefaultTestDeployAssertBAF90E92.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "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", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "snsfifothroughputscopetestDefaultTestDeployAssertBAF90E92.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "snsfifothroughputscopetestDefaultTestDeployAssertBAF90E92.assets" + ], + "metadata": { + "/sns-fifo-throughput-scope-test/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/sns-fifo-throughput-scope-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "sns-fifo-throughput-scope-test/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/sns-fifo-throughput-scope.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/sns-fifo-throughput-scope.assets.json new file mode 100644 index 0000000000000..8c5792538e5db --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/sns-fifo-throughput-scope.assets.json @@ -0,0 +1,19 @@ +{ + "version": "39.0.0", + "files": { + "f479d71edc397ab84e3385982c1e1598b5b59f17c8258c137fb2b424bb1d489d": { + "source": { + "path": "sns-fifo-throughput-scope.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "f479d71edc397ab84e3385982c1e1598b5b59f17c8258c137fb2b424bb1d489d.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/sns-fifo-throughput-scope.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/sns-fifo-throughput-scope.template.json new file mode 100644 index 0000000000000..7608563be711a --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/sns-fifo-throughput-scope.template.json @@ -0,0 +1,54 @@ +{ + "Resources": { + "MessageGroupScopeTopicAB4E2D6F": { + "Type": "AWS::SNS::Topic", + "Properties": { + "FifoThroughputScope": "MessageGroup", + "FifoTopic": true, + "TopicName": "snsfifothroughputscope-MessageGroupScopeTopic-52DE3DD3.fifo" + } + }, + "TopicScopeTopic8DEBB616": { + "Type": "AWS::SNS::Topic", + "Properties": { + "FifoThroughputScope": "Topic", + "FifoTopic": true, + "TopicName": "snsfifothroughputscope-TopicScopeTopic-92BBF542.fifo" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/snsfifothroughputscopetestDefaultTestDeployAssertBAF90E92.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/snsfifothroughputscopetestDefaultTestDeployAssertBAF90E92.assets.json new file mode 100644 index 0000000000000..ad483902bf0d2 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/snsfifothroughputscopetestDefaultTestDeployAssertBAF90E92.assets.json @@ -0,0 +1,19 @@ +{ + "version": "39.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "snsfifothroughputscopetestDefaultTestDeployAssertBAF90E92.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/snsfifothroughputscopetestDefaultTestDeployAssertBAF90E92.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/snsfifothroughputscopetestDefaultTestDeployAssertBAF90E92.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/snsfifothroughputscopetestDefaultTestDeployAssertBAF90E92.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/tree.json new file mode 100644 index 0000000000000..3d6f075d2cb0f --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.js.snapshot/tree.json @@ -0,0 +1,153 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "sns-fifo-throughput-scope": { + "id": "sns-fifo-throughput-scope", + "path": "sns-fifo-throughput-scope", + "children": { + "MessageGroupScopeTopic": { + "id": "MessageGroupScopeTopic", + "path": "sns-fifo-throughput-scope/MessageGroupScopeTopic", + "children": { + "Resource": { + "id": "Resource", + "path": "sns-fifo-throughput-scope/MessageGroupScopeTopic/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SNS::Topic", + "aws:cdk:cloudformation:props": { + "fifoThroughputScope": "MessageGroup", + "fifoTopic": true, + "topicName": "snsfifothroughputscope-MessageGroupScopeTopic-52DE3DD3.fifo" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sns.CfnTopic", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sns.Topic", + "version": "0.0.0" + } + }, + "TopicScopeTopic": { + "id": "TopicScopeTopic", + "path": "sns-fifo-throughput-scope/TopicScopeTopic", + "children": { + "Resource": { + "id": "Resource", + "path": "sns-fifo-throughput-scope/TopicScopeTopic/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SNS::Topic", + "aws:cdk:cloudformation:props": { + "fifoThroughputScope": "Topic", + "fifoTopic": true, + "topicName": "snsfifothroughputscope-TopicScopeTopic-92BBF542.fifo" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sns.CfnTopic", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sns.Topic", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "sns-fifo-throughput-scope/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "sns-fifo-throughput-scope/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "sns-fifo-throughput-scope-test": { + "id": "sns-fifo-throughput-scope-test", + "path": "sns-fifo-throughput-scope-test", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "sns-fifo-throughput-scope-test/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "sns-fifo-throughput-scope-test/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "sns-fifo-throughput-scope-test/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "sns-fifo-throughput-scope-test/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "sns-fifo-throughput-scope-test/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.ts new file mode 100644 index 0000000000000..7efb9ffb719c7 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns-fifo-throughput-scope.ts @@ -0,0 +1,28 @@ +import { App, Stack, StackProps } from 'aws-cdk-lib'; +import { FifoThroughputScope, Topic } from 'aws-cdk-lib/aws-sns'; + +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; + +class SNSInteg extends Stack { + constructor(scope: App, id: string, props?: StackProps) { + super(scope, id, props); + + new Topic(this, 'MessageGroupScopeTopic', { + fifo: true, + fifoThroughputScope: FifoThroughputScope.MESSAGE_GROUP, + }); + + new Topic(this, 'TopicScopeTopic', { + fifo: true, + fifoThroughputScope: FifoThroughputScope.TOPIC, + }); + } +} + +const app = new App(); + +const stack = new SNSInteg(app, 'sns-fifo-throughput-scope'); + +new IntegTest(app, 'sns-fifo-throughput-scope-test', { + testCases: [stack], +}); diff --git a/packages/aws-cdk-lib/aws-sns/README.md b/packages/aws-cdk-lib/aws-sns/README.md index b4b219319b536..ec77935cd3be8 100644 --- a/packages/aws-cdk-lib/aws-sns/README.md +++ b/packages/aws-cdk-lib/aws-sns/README.md @@ -344,3 +344,23 @@ const topic = new sns.Topic(this, 'MyTopic', { tracingConfig: sns.TracingConfig.ACTIVE, }); ``` + +## High-throughput mode for Amazon SNS FIFO Topics + +High throughput FIFO topics in Amazon SNS efficiently manage high message throughput while maintaining strict message order, ensuring reliability and scalability for applications processing numerous messages. +This solution is ideal for scenarios demanding both high throughput and ordered message delivery. + +To improve message throughput using high throughput FIFO topics, increasing the number of message groups is recommended. + +For more information, see [High throughput FIFO topics in Amazon SNS](https://docs.aws.amazon.com/sns/latest/dg/fifo-high-throughput.html). + +You can configure high-throughput mode for your FIFO topics by setting the `fifoThroughputScope` property: + +```ts +const topic = new sns.Topic(this, 'MyTopic', { + fifo: true, + fifoThroughputScope: sns.FifoThroughputScope.TOPIC, +}); +``` + +**Note**: The `fifoThroughputScope` property is only available for FIFO topics. diff --git a/packages/aws-cdk-lib/aws-sns/lib/topic.ts b/packages/aws-cdk-lib/aws-sns/lib/topic.ts index 3da32881fc1af..fa4ac1fad49d3 100644 --- a/packages/aws-cdk-lib/aws-sns/lib/topic.ts +++ b/packages/aws-cdk-lib/aws-sns/lib/topic.ts @@ -99,6 +99,34 @@ export interface TopicProps { * @default TracingConfig.PASS_THROUGH */ readonly tracingConfig?: TracingConfig; + + /** + * Specifies the throughput quota and deduplication behavior to apply for the FIFO topic. + * + * You can only set this property when `fifo` is `true`. + * + * @default undefined - SNS default setting is FifoThroughputScope.TOPIC + */ + readonly fifoThroughputScope?: FifoThroughputScope; +} + +/** + * The throughput quota and deduplication behavior to apply for the FIFO topic. + */ +export enum FifoThroughputScope { + /** + * Topic scope + * - Throughput: 3000 messages per second and a bandwidth of 20MB per second. + * - Deduplication: Message deduplication is verified on the entire FIFO topic. + */ + TOPIC = 'Topic', + + /** + * Message group scope + * - Throughput: Maximum regional limits. + * - Deduplication: Message deduplication is only verified within a message group. + */ + MESSAGE_GROUP = 'MessageGroup', } /** @@ -264,6 +292,9 @@ export class Topic extends TopicBase { if (props.messageRetentionPeriodInDays && !props.fifo) { throw new ValidationError('`messageRetentionPeriodInDays` is only valid for FIFO SNS topics.', this); } + if (props.fifoThroughputScope && !props.fifo) { + throw new ValidationError('`fifoThroughputScope` can only be set for FIFO SNS topics.', this); + } if ( props.messageRetentionPeriodInDays !== undefined && !Token.isUnresolved(props.messageRetentionPeriodInDays) @@ -315,6 +346,7 @@ export class Topic extends TopicBase { signatureVersion: props.signatureVersion, deliveryStatusLogging: Lazy.any({ produce: () => this.renderLoggingConfigs() }, { omitEmptyArray: true }), tracingConfig: props.tracingConfig, + fifoThroughputScope: props.fifoThroughputScope, }); this.topicArn = this.getResourceArnAttribute(resource.ref, { diff --git a/packages/aws-cdk-lib/aws-sns/test/sns.test.ts b/packages/aws-cdk-lib/aws-sns/test/sns.test.ts index 6c8f04fb096b6..700ec97a85b2b 100644 --- a/packages/aws-cdk-lib/aws-sns/test/sns.test.ts +++ b/packages/aws-cdk-lib/aws-sns/test/sns.test.ts @@ -854,4 +854,35 @@ describe('Topic', () => { }); }); }); + + describe('fifoThroughputScope', () => { + test.each([sns.FifoThroughputScope.MESSAGE_GROUP, sns.FifoThroughputScope.TOPIC])('set fifoThroughputScope to %s', (fifoThroughputScope) => { + // GIVEN + const app = new cdk.App(); + const stack = new cdk.Stack(app); + + // WHEN + new sns.Topic(stack, 'MyTopic', { + fifo: true, + fifoThroughputScope, + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::SNS::Topic', { + FifoTopic: true, + FifoThroughputScope: fifoThroughputScope, + }); + }); + + test('throw error when specify fifoThroughputScope to standard topic', () => { + const app = new cdk.App(); + const stack = new cdk.Stack(app); + + expect( + () => new sns.Topic(stack, 'MyTopic', { + fifoThroughputScope: sns.FifoThroughputScope.MESSAGE_GROUP, + }), + ).toThrow('`fifoThroughputScope` can only be set for FIFO SNS topics.'); + }); + }); });