From 4911e67f1609966b033fef57ec51de7172ebc0ef Mon Sep 17 00:00:00 2001 From: maz Date: Sun, 16 Jun 2024 18:25:23 +0900 Subject: [PATCH 1/5] feat: enable contributor insights for global secondary index --- ...b-contributor-insights-for-gis.assets.json | 19 ++ ...contributor-insights-for-gis.template.json | 105 ++++++++++ ...efaultTestDeployAssert6C041B3E.assets.json | 19 ++ ...aultTestDeployAssert6C041B3E.template.json | 36 ++++ .../cdk.out | 1 + .../integ.json | 12 ++ .../manifest.json | 113 +++++++++++ .../tree.json | 192 ++++++++++++++++++ ...g.dynamodb.contirubtor-insights-for-gsi.ts | 41 ++++ packages/aws-cdk-lib/aws-dynamodb/README.md | 19 +- .../aws-cdk-lib/aws-dynamodb/lib/table.ts | 10 + .../aws-dynamodb/test/dynamodb.test.ts | 47 ++++- 12 files changed, 609 insertions(+), 5 deletions(-) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/aws-cdk-dynamodb-contributor-insights-for-gis.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/aws-cdk-dynamodb-contributor-insights-for-gis.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/cdk.out create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/integ.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/manifest.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/tree.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/aws-cdk-dynamodb-contributor-insights-for-gis.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/aws-cdk-dynamodb-contributor-insights-for-gis.assets.json new file mode 100644 index 0000000000000..a4aba0e79c136 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/aws-cdk-dynamodb-contributor-insights-for-gis.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "f9b6221d41c7d1dec71841a066339cb8de39d9cc4b599c8bd8af7b741044e64c": { + "source": { + "path": "aws-cdk-dynamodb-contributor-insights-for-gis.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "f9b6221d41c7d1dec71841a066339cb8de39d9cc4b599c8bd8af7b741044e64c.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-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/aws-cdk-dynamodb-contributor-insights-for-gis.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/aws-cdk-dynamodb-contributor-insights-for-gis.template.json new file mode 100644 index 0000000000000..567ea9b452573 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/aws-cdk-dynamodb-contributor-insights-for-gis.template.json @@ -0,0 +1,105 @@ +{ + "Resources": { + "TableWithGlobalSecondaryIndexCC8E841E": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "AttributeDefinitions": [ + { + "AttributeName": "hashKey", + "AttributeType": "S" + }, + { + "AttributeName": "gsiHashKey", + "AttributeType": "S" + } + ], + "GlobalSecondaryIndexes": [ + { + "ContributorInsightsSpecification": { + "Enabled": true + }, + "IndexName": "GSI-ContributorInsightsEnabled", + "KeySchema": [ + { + "AttributeName": "gsiHashKey", + "KeyType": "HASH" + } + ], + "Projection": { + "ProjectionType": "ALL" + }, + "ProvisionedThroughput": { + "ReadCapacityUnits": 5, + "WriteCapacityUnits": 5 + } + }, + { + "ContributorInsightsSpecification": { + "Enabled": false + }, + "IndexName": "GSI-ContributorInsightsDisabled", + "KeySchema": [ + { + "AttributeName": "gsiHashKey", + "KeyType": "HASH" + } + ], + "Projection": { + "ProjectionType": "ALL" + }, + "ProvisionedThroughput": { + "ReadCapacityUnits": 5, + "WriteCapacityUnits": 5 + } + } + ], + "KeySchema": [ + { + "AttributeName": "hashKey", + "KeyType": "HASH" + } + ], + "ProvisionedThroughput": { + "ReadCapacityUnits": 5, + "WriteCapacityUnits": 5 + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "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-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.assets.json new file mode 100644 index 0000000000000..27fae8555be5e --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.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-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.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-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/cdk.out new file mode 100644 index 0000000000000..1f0068d32659a --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"36.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/integ.json new file mode 100644 index 0000000000000..b5de14fbb86e7 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "36.0.0", + "testCases": { + "aws-cdk-dynamodb-contributor-insights-for-gis-test/DefaultTest": { + "stacks": [ + "aws-cdk-dynamodb-contributor-insights-for-gis" + ], + "assertionStack": "aws-cdk-dynamodb-contributor-insights-for-gis-test/DefaultTest/DeployAssert", + "assertionStackName": "awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/manifest.json new file mode 100644 index 0000000000000..26bf8cdac76b1 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/manifest.json @@ -0,0 +1,113 @@ +{ + "version": "36.0.0", + "artifacts": { + "aws-cdk-dynamodb-contributor-insights-for-gis.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-cdk-dynamodb-contributor-insights-for-gis.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-cdk-dynamodb-contributor-insights-for-gis": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-cdk-dynamodb-contributor-insights-for-gis.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}/f9b6221d41c7d1dec71841a066339cb8de39d9cc4b599c8bd8af7b741044e64c.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-cdk-dynamodb-contributor-insights-for-gis.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": [ + "aws-cdk-dynamodb-contributor-insights-for-gis.assets" + ], + "metadata": { + "/aws-cdk-dynamodb-contributor-insights-for-gis/TableWithGlobalSecondaryIndex/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "TableWithGlobalSecondaryIndexCC8E841E" + } + ], + "/aws-cdk-dynamodb-contributor-insights-for-gis/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-cdk-dynamodb-contributor-insights-for-gis/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-cdk-dynamodb-contributor-insights-for-gis" + }, + "awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.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": [ + "awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.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": [ + "awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.assets" + ], + "metadata": { + "/aws-cdk-dynamodb-contributor-insights-for-gis-test/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-cdk-dynamodb-contributor-insights-for-gis-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-cdk-dynamodb-contributor-insights-for-gis-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-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/tree.json new file mode 100644 index 0000000000000..6797b4aea23d2 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/tree.json @@ -0,0 +1,192 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "aws-cdk-dynamodb-contributor-insights-for-gis": { + "id": "aws-cdk-dynamodb-contributor-insights-for-gis", + "path": "aws-cdk-dynamodb-contributor-insights-for-gis", + "children": { + "TableWithGlobalSecondaryIndex": { + "id": "TableWithGlobalSecondaryIndex", + "path": "aws-cdk-dynamodb-contributor-insights-for-gis/TableWithGlobalSecondaryIndex", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-dynamodb-contributor-insights-for-gis/TableWithGlobalSecondaryIndex/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::DynamoDB::Table", + "aws:cdk:cloudformation:props": { + "attributeDefinitions": [ + { + "attributeName": "hashKey", + "attributeType": "S" + }, + { + "attributeName": "gsiHashKey", + "attributeType": "S" + } + ], + "globalSecondaryIndexes": [ + { + "contributorInsightsSpecification": { + "enabled": true + }, + "indexName": "GSI-ContributorInsightsEnabled", + "keySchema": [ + { + "attributeName": "gsiHashKey", + "keyType": "HASH" + } + ], + "projection": { + "projectionType": "ALL" + }, + "provisionedThroughput": { + "readCapacityUnits": 5, + "writeCapacityUnits": 5 + } + }, + { + "contributorInsightsSpecification": { + "enabled": false + }, + "indexName": "GSI-ContributorInsightsDisabled", + "keySchema": [ + { + "attributeName": "gsiHashKey", + "keyType": "HASH" + } + ], + "projection": { + "projectionType": "ALL" + }, + "provisionedThroughput": { + "readCapacityUnits": 5, + "writeCapacityUnits": 5 + } + } + ], + "keySchema": [ + { + "attributeName": "hashKey", + "keyType": "HASH" + } + ], + "provisionedThroughput": { + "readCapacityUnits": 5, + "writeCapacityUnits": 5 + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_dynamodb.CfnTable", + "version": "0.0.0" + } + }, + "ScalingRole": { + "id": "ScalingRole", + "path": "aws-cdk-dynamodb-contributor-insights-for-gis/TableWithGlobalSecondaryIndex/ScalingRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_dynamodb.Table", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-dynamodb-contributor-insights-for-gis/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-dynamodb-contributor-insights-for-gis/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "aws-cdk-dynamodb-contributor-insights-for-gis-test": { + "id": "aws-cdk-dynamodb-contributor-insights-for-gis-test", + "path": "aws-cdk-dynamodb-contributor-insights-for-gis-test", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "aws-cdk-dynamodb-contributor-insights-for-gis-test/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-dynamodb-contributor-insights-for-gis-test/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "aws-cdk-dynamodb-contributor-insights-for-gis-test/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-dynamodb-contributor-insights-for-gis-test/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-dynamodb-contributor-insights-for-gis-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.3.0" + } + } + }, + "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-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.ts new file mode 100644 index 0000000000000..27311c9a9acd6 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.ts @@ -0,0 +1,41 @@ +import { App, RemovalPolicy, Stack } from 'aws-cdk-lib'; +import { Attribute, AttributeType, Table } from 'aws-cdk-lib/aws-dynamodb'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; + +// CDK parameters +const STACK_NAME = 'aws-cdk-dynamodb-contributor-insights-for-gis'; + +// DynamoDB table parameters +const TABLE = 'TableWithGlobalSecondaryIndex'; +const TABLE_PARTITION_KEY: Attribute = { name: 'hashKey', type: AttributeType.STRING }; + +// DynamoDB global secondary index parameters +const GSI_TEST_CASE_1 = 'GSI-ContributorInsightsEnabled'; +const GSI_TEST_CASE_2 = 'GSI-ContributorInsightsDisabled'; +const GSI_PARTITION_KEY: Attribute = { name: 'gsiHashKey', type: AttributeType.STRING }; + +const app = new App(); + +const stack = new Stack(app, STACK_NAME); + +const table = new Table(stack, TABLE, { + partitionKey: TABLE_PARTITION_KEY, + removalPolicy: RemovalPolicy.DESTROY, +}); + +table.addGlobalSecondaryIndex({ + contributorInsightsEnabled: true, + indexName: GSI_TEST_CASE_1, + partitionKey: GSI_PARTITION_KEY, +}); +table.addGlobalSecondaryIndex({ + contributorInsightsEnabled: false, + indexName: GSI_TEST_CASE_2, + partitionKey: GSI_PARTITION_KEY, +}); + +new IntegTest(app, 'aws-cdk-dynamodb-contributor-insights-for-gis-test', { + testCases: [stack], +}); + +app.synth(); diff --git a/packages/aws-cdk-lib/aws-dynamodb/README.md b/packages/aws-cdk-lib/aws-dynamodb/README.md index 83d3e35c7d2f2..ed22bd388e421 100644 --- a/packages/aws-cdk-lib/aws-dynamodb/README.md +++ b/packages/aws-cdk-lib/aws-dynamodb/README.md @@ -136,7 +136,7 @@ class BarStack extends cdk.Stack { const app = new cdk.App(); const fooStack = new FooStack(app, 'FooStack', { env: { region: 'us-west-2' } }); -const barStack = new BarStack(app, 'BarStack', { +const barStack = new BarStack(app, 'BarStack', { replicaTable: fooStack.globalTable.replica('us-east-1'), env: { region: 'us-east-1' }, }); @@ -514,6 +514,21 @@ const table = new dynamodb.TableV2(this, 'Table', { }); ``` +When you use `Table`, you can enable contributor insights for a table or specifig global secondary index by setting `contributorInsightsEnabled` to `true`. + +```ts +const table = new dynamodb.Table(this, 'Table', { + partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING }, + contributorInsightsEnabled: true, // for a table +}); + +table.addGlobalSecondaryIndex({ + contributorInsightsEnabled: true, // for a specific global secondary index + indexName: 'gsi', + partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING }, +}); +``` + Further reading: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/contributorinsights_HowItWorks.html @@ -602,7 +617,7 @@ https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.Tabl ## Tags -You can add tags to a `TableV2` in several ways. By adding the tags to the construct itself it will apply the tags to the +You can add tags to a `TableV2` in several ways. By adding the tags to the construct itself it will apply the tags to the primary table. ```ts const table = new dynamodb.TableV2(this, 'Table', { diff --git a/packages/aws-cdk-lib/aws-dynamodb/lib/table.ts b/packages/aws-cdk-lib/aws-dynamodb/lib/table.ts index a9127cabf957a..4565d623d8af9 100644 --- a/packages/aws-cdk-lib/aws-dynamodb/lib/table.ts +++ b/packages/aws-cdk-lib/aws-dynamodb/lib/table.ts @@ -418,6 +418,13 @@ export interface GlobalSecondaryIndexProps extends SecondaryIndexProps, SchemaOp * @default 5 */ readonly writeCapacity?: number; + + /** + * Whether CloudWatch contributor insights is enabled for the specified global secondary index. + * + * @default false + */ + readonly contributorInsightsEnabled?: boolean; } /** @@ -1182,6 +1189,9 @@ export class Table extends TableBase { const gsiProjection = this.buildIndexProjection(props); this.globalSecondaryIndexes.push({ + contributorInsightsSpecification: props.contributorInsightsEnabled === undefined + ? undefined + : { enabled: props.contributorInsightsEnabled ? true : false }, indexName: props.indexName, keySchema: gsiKeySchema, projection: gsiProjection, diff --git a/packages/aws-cdk-lib/aws-dynamodb/test/dynamodb.test.ts b/packages/aws-cdk-lib/aws-dynamodb/test/dynamodb.test.ts index 39598ee4f588a..9cf755ac6e7a9 100644 --- a/packages/aws-cdk-lib/aws-dynamodb/test/dynamodb.test.ts +++ b/packages/aws-cdk-lib/aws-dynamodb/test/dynamodb.test.ts @@ -52,7 +52,7 @@ const GSI_NAME = 'MyGSI'; const GSI_PARTITION_KEY: Attribute = { name: 'gsiHashKey', type: AttributeType.STRING }; const GSI_SORT_KEY: Attribute = { name: 'gsiSortKey', type: AttributeType.BINARY }; const GSI_NON_KEY = 'gsiNonKey'; -function * GSI_GENERATOR(): Generator { +function* GSI_GENERATOR(): Generator { let n = 0; while (true) { const globalSecondaryIndexProps: GlobalSecondaryIndexProps = { @@ -63,7 +63,7 @@ function * GSI_GENERATOR(): Generator { n++; } } -function * NON_KEY_ATTRIBUTE_GENERATOR(nonKeyPrefix: string): Generator { +function* NON_KEY_ATTRIBUTE_GENERATOR(nonKeyPrefix: string): Generator { let n = 0; while (true) { yield `${nonKeyPrefix}${n}`; @@ -75,7 +75,7 @@ function * NON_KEY_ATTRIBUTE_GENERATOR(nonKeyPrefix: string): Generator { +function* LSI_GENERATOR(): Generator { let n = 0; while (true) { const localSecondaryIndexProps: LocalSecondaryIndexProps = { @@ -1254,6 +1254,47 @@ test('when adding a global secondary index without specifying read and write cap ); }); +test.each([true, false])('when adding a global secondary index with contributoreIngishtsEnabled %s', (contributorInsightsEnabled: boolean) => { + const stack = new Stack(); + const table = new Table(stack, CONSTRUCT_NAME, { + partitionKey: TABLE_PARTITION_KEY, + sortKey: TABLE_SORT_KEY, + }); + + table.addGlobalSecondaryIndex({ + contributorInsightsEnabled, + indexName: GSI_NAME, + partitionKey: GSI_PARTITION_KEY, + }); + + Template.fromStack(stack).hasResourceProperties('AWS::DynamoDB::Table', + { + AttributeDefinitions: [ + { AttributeName: 'hashKey', AttributeType: 'S' }, + { AttributeName: 'sortKey', AttributeType: 'N' }, + { AttributeName: 'gsiHashKey', AttributeType: 'S' }, + ], + KeySchema: [ + { AttributeName: 'hashKey', KeyType: 'HASH' }, + { AttributeName: 'sortKey', KeyType: 'RANGE' }, + ], + ProvisionedThroughput: { ReadCapacityUnits: 5, WriteCapacityUnits: 5 }, + GlobalSecondaryIndexes: [ + { + ContributorInsightsSpecification: { + Enabled: contributorInsightsEnabled, + }, + IndexName: 'MyGSI', + KeySchema: [ + { AttributeName: 'gsiHashKey', KeyType: 'HASH' }, + ], + Projection: { ProjectionType: 'ALL' }, + }, + ], + }, + ); +}); + test('when adding a local secondary index with hash + range key', () => { const stack = new Stack(); const table = new Table(stack, CONSTRUCT_NAME, { partitionKey: TABLE_PARTITION_KEY, sortKey: TABLE_SORT_KEY }); From 861f986e6def6fae73e04fe090881651cc903e9a Mon Sep 17 00:00:00 2001 From: maz Date: Sat, 22 Jun 2024 16:25:44 +0900 Subject: [PATCH 2/5] minor update --- packages/aws-cdk-lib/aws-dynamodb/lib/table.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/aws-cdk-lib/aws-dynamodb/lib/table.ts b/packages/aws-cdk-lib/aws-dynamodb/lib/table.ts index 4565d623d8af9..96b14b849bf2b 100644 --- a/packages/aws-cdk-lib/aws-dynamodb/lib/table.ts +++ b/packages/aws-cdk-lib/aws-dynamodb/lib/table.ts @@ -1189,9 +1189,7 @@ export class Table extends TableBase { const gsiProjection = this.buildIndexProjection(props); this.globalSecondaryIndexes.push({ - contributorInsightsSpecification: props.contributorInsightsEnabled === undefined - ? undefined - : { enabled: props.contributorInsightsEnabled ? true : false }, + contributorInsightsSpecification: props.contributorInsightsEnabled !== undefined ? { enabled: props.contributorInsightsEnabled } : undefined, indexName: props.indexName, keySchema: gsiKeySchema, projection: gsiProjection, From 1b1678c23963532118db3081bbe55dace0e122c8 Mon Sep 17 00:00:00 2001 From: mazyu36 Date: Sun, 22 Sep 2024 09:08:35 +0900 Subject: [PATCH 3/5] Update packages/aws-cdk-lib/aws-dynamodb/README.md Co-authored-by: Kazuho Cryer-Shinozuka --- packages/aws-cdk-lib/aws-dynamodb/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-dynamodb/README.md b/packages/aws-cdk-lib/aws-dynamodb/README.md index 240400b69d946..41244dec60ea9 100644 --- a/packages/aws-cdk-lib/aws-dynamodb/README.md +++ b/packages/aws-cdk-lib/aws-dynamodb/README.md @@ -527,7 +527,7 @@ const table = new dynamodb.TableV2(this, 'Table', { }); ``` -When you use `Table`, you can enable contributor insights for a table or specifig global secondary index by setting `contributorInsightsEnabled` to `true`. +When you use `Table`, you can enable contributor insights for a table or specific global secondary index by setting `contributorInsightsEnabled` to `true`. ```ts const table = new dynamodb.Table(this, 'Table', { From 1991ac12f3dc8071aac8b1c97ecd2cbd35ad7adc Mon Sep 17 00:00:00 2001 From: mazyu36 Date: Sun, 22 Sep 2024 09:08:43 +0900 Subject: [PATCH 4/5] Update packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.ts Co-authored-by: Kazuho Cryer-Shinozuka --- .../test/integ.dynamodb.contirubtor-insights-for-gsi.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.ts index 27311c9a9acd6..6f56debb6e473 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.ts @@ -38,4 +38,3 @@ new IntegTest(app, 'aws-cdk-dynamodb-contributor-insights-for-gis-test', { testCases: [stack], }); -app.synth(); From 716c60f18ded0db5c3dbadb47e67695edb6bcad7 Mon Sep 17 00:00:00 2001 From: maz Date: Sun, 22 Sep 2024 09:12:52 +0900 Subject: [PATCH 5/5] update integ test --- ...-contributor-insights-for-gsi.assets.json} | 4 +- ...ontributor-insights-for-gsi.template.json} | 0 ...faultTestDeployAssert9D8EC318.assets.json} | 4 +- ...ultTestDeployAssert9D8EC318.template.json} | 0 .../cdk.out | 2 +- .../integ.json | 10 ++--- .../manifest.json | 40 +++++++++---------- .../tree.json | 32 +++++++-------- ...g.dynamodb.contirubtor-insights-for-gsi.ts | 5 +-- 9 files changed, 48 insertions(+), 49 deletions(-) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/{aws-cdk-dynamodb-contributor-insights-for-gis.assets.json => aws-cdk-dynamodb-contributor-insights-for-gsi.assets.json} (87%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/{aws-cdk-dynamodb-contributor-insights-for-gis.template.json => aws-cdk-dynamodb-contributor-insights-for-gsi.template.json} (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/{awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.assets.json => awscdkdynamodbcontributorinsightsforgsitestDefaultTestDeployAssert9D8EC318.assets.json} (81%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/{awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.template.json => awscdkdynamodbcontributorinsightsforgsitestDefaultTestDeployAssert9D8EC318.template.json} (100%) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/aws-cdk-dynamodb-contributor-insights-for-gis.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/aws-cdk-dynamodb-contributor-insights-for-gsi.assets.json similarity index 87% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/aws-cdk-dynamodb-contributor-insights-for-gis.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/aws-cdk-dynamodb-contributor-insights-for-gsi.assets.json index a4aba0e79c136..e62b42408dc2f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/aws-cdk-dynamodb-contributor-insights-for-gis.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/aws-cdk-dynamodb-contributor-insights-for-gsi.assets.json @@ -1,9 +1,9 @@ { - "version": "36.0.0", + "version": "36.0.24", "files": { "f9b6221d41c7d1dec71841a066339cb8de39d9cc4b599c8bd8af7b741044e64c": { "source": { - "path": "aws-cdk-dynamodb-contributor-insights-for-gis.template.json", + "path": "aws-cdk-dynamodb-contributor-insights-for-gsi.template.json", "packaging": "file" }, "destinations": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/aws-cdk-dynamodb-contributor-insights-for-gis.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/aws-cdk-dynamodb-contributor-insights-for-gsi.template.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/aws-cdk-dynamodb-contributor-insights-for-gis.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/aws-cdk-dynamodb-contributor-insights-for-gsi.template.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/awscdkdynamodbcontributorinsightsforgsitestDefaultTestDeployAssert9D8EC318.assets.json similarity index 81% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/awscdkdynamodbcontributorinsightsforgsitestDefaultTestDeployAssert9D8EC318.assets.json index 27fae8555be5e..165991a4ee766 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/awscdkdynamodbcontributorinsightsforgsitestDefaultTestDeployAssert9D8EC318.assets.json @@ -1,9 +1,9 @@ { - "version": "36.0.0", + "version": "36.0.24", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { - "path": "awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.template.json", + "path": "awscdkdynamodbcontributorinsightsforgsitestDefaultTestDeployAssert9D8EC318.template.json", "packaging": "file" }, "destinations": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/awscdkdynamodbcontributorinsightsforgsitestDefaultTestDeployAssert9D8EC318.template.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/awscdkdynamodbcontributorinsightsforgsitestDefaultTestDeployAssert9D8EC318.template.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/cdk.out index 1f0068d32659a..4efaa16f29af9 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"36.0.24"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/integ.json index b5de14fbb86e7..e57a4eaa2d1dd 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/integ.json @@ -1,12 +1,12 @@ { - "version": "36.0.0", + "version": "36.0.24", "testCases": { - "aws-cdk-dynamodb-contributor-insights-for-gis-test/DefaultTest": { + "aws-cdk-dynamodb-contributor-insights-for-gsi-test/DefaultTest": { "stacks": [ - "aws-cdk-dynamodb-contributor-insights-for-gis" + "aws-cdk-dynamodb-contributor-insights-for-gsi" ], - "assertionStack": "aws-cdk-dynamodb-contributor-insights-for-gis-test/DefaultTest/DeployAssert", - "assertionStackName": "awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E" + "assertionStack": "aws-cdk-dynamodb-contributor-insights-for-gsi-test/DefaultTest/DeployAssert", + "assertionStackName": "awscdkdynamodbcontributorinsightsforgsitestDefaultTestDeployAssert9D8EC318" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/manifest.json index 26bf8cdac76b1..221a00e60b0cc 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/manifest.json @@ -1,19 +1,19 @@ { - "version": "36.0.0", + "version": "36.0.24", "artifacts": { - "aws-cdk-dynamodb-contributor-insights-for-gis.assets": { + "aws-cdk-dynamodb-contributor-insights-for-gsi.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "aws-cdk-dynamodb-contributor-insights-for-gis.assets.json", + "file": "aws-cdk-dynamodb-contributor-insights-for-gsi.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "aws-cdk-dynamodb-contributor-insights-for-gis": { + "aws-cdk-dynamodb-contributor-insights-for-gsi": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "aws-cdk-dynamodb-contributor-insights-for-gis.template.json", + "templateFile": "aws-cdk-dynamodb-contributor-insights-for-gsi.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", @@ -22,7 +22,7 @@ "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "aws-cdk-dynamodb-contributor-insights-for-gis.assets" + "aws-cdk-dynamodb-contributor-insights-for-gsi.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -31,43 +31,43 @@ } }, "dependencies": [ - "aws-cdk-dynamodb-contributor-insights-for-gis.assets" + "aws-cdk-dynamodb-contributor-insights-for-gsi.assets" ], "metadata": { - "/aws-cdk-dynamodb-contributor-insights-for-gis/TableWithGlobalSecondaryIndex/Resource": [ + "/aws-cdk-dynamodb-contributor-insights-for-gsi/TableWithGlobalSecondaryIndex/Resource": [ { "type": "aws:cdk:logicalId", "data": "TableWithGlobalSecondaryIndexCC8E841E" } ], - "/aws-cdk-dynamodb-contributor-insights-for-gis/BootstrapVersion": [ + "/aws-cdk-dynamodb-contributor-insights-for-gsi/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/aws-cdk-dynamodb-contributor-insights-for-gis/CheckBootstrapVersion": [ + "/aws-cdk-dynamodb-contributor-insights-for-gsi/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "aws-cdk-dynamodb-contributor-insights-for-gis" + "displayName": "aws-cdk-dynamodb-contributor-insights-for-gsi" }, - "awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.assets": { + "awscdkdynamodbcontributorinsightsforgsitestDefaultTestDeployAssert9D8EC318.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.assets.json", + "file": "awscdkdynamodbcontributorinsightsforgsitestDefaultTestDeployAssert9D8EC318.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E": { + "awscdkdynamodbcontributorinsightsforgsitestDefaultTestDeployAssert9D8EC318": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.template.json", + "templateFile": "awscdkdynamodbcontributorinsightsforgsitestDefaultTestDeployAssert9D8EC318.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", @@ -76,7 +76,7 @@ "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.assets" + "awscdkdynamodbcontributorinsightsforgsitestDefaultTestDeployAssert9D8EC318.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -85,23 +85,23 @@ } }, "dependencies": [ - "awscdkdynamodbcontributorinsightsforgistestDefaultTestDeployAssert6C041B3E.assets" + "awscdkdynamodbcontributorinsightsforgsitestDefaultTestDeployAssert9D8EC318.assets" ], "metadata": { - "/aws-cdk-dynamodb-contributor-insights-for-gis-test/DefaultTest/DeployAssert/BootstrapVersion": [ + "/aws-cdk-dynamodb-contributor-insights-for-gsi-test/DefaultTest/DeployAssert/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/aws-cdk-dynamodb-contributor-insights-for-gis-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + "/aws-cdk-dynamodb-contributor-insights-for-gsi-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "aws-cdk-dynamodb-contributor-insights-for-gis-test/DefaultTest/DeployAssert" + "displayName": "aws-cdk-dynamodb-contributor-insights-for-gsi-test/DefaultTest/DeployAssert" }, "Tree": { "type": "cdk:tree", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/tree.json index 6797b4aea23d2..2f7c91f42507f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.js.snapshot/tree.json @@ -4,17 +4,17 @@ "id": "App", "path": "", "children": { - "aws-cdk-dynamodb-contributor-insights-for-gis": { - "id": "aws-cdk-dynamodb-contributor-insights-for-gis", - "path": "aws-cdk-dynamodb-contributor-insights-for-gis", + "aws-cdk-dynamodb-contributor-insights-for-gsi": { + "id": "aws-cdk-dynamodb-contributor-insights-for-gsi", + "path": "aws-cdk-dynamodb-contributor-insights-for-gsi", "children": { "TableWithGlobalSecondaryIndex": { "id": "TableWithGlobalSecondaryIndex", - "path": "aws-cdk-dynamodb-contributor-insights-for-gis/TableWithGlobalSecondaryIndex", + "path": "aws-cdk-dynamodb-contributor-insights-for-gsi/TableWithGlobalSecondaryIndex", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-contributor-insights-for-gis/TableWithGlobalSecondaryIndex/Resource", + "path": "aws-cdk-dynamodb-contributor-insights-for-gsi/TableWithGlobalSecondaryIndex/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::DynamoDB::Table", "aws:cdk:cloudformation:props": { @@ -87,7 +87,7 @@ }, "ScalingRole": { "id": "ScalingRole", - "path": "aws-cdk-dynamodb-contributor-insights-for-gis/TableWithGlobalSecondaryIndex/ScalingRole", + "path": "aws-cdk-dynamodb-contributor-insights-for-gsi/TableWithGlobalSecondaryIndex/ScalingRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -101,7 +101,7 @@ }, "BootstrapVersion": { "id": "BootstrapVersion", - "path": "aws-cdk-dynamodb-contributor-insights-for-gis/BootstrapVersion", + "path": "aws-cdk-dynamodb-contributor-insights-for-gsi/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -109,7 +109,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "aws-cdk-dynamodb-contributor-insights-for-gis/CheckBootstrapVersion", + "path": "aws-cdk-dynamodb-contributor-insights-for-gsi/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" @@ -121,17 +121,17 @@ "version": "0.0.0" } }, - "aws-cdk-dynamodb-contributor-insights-for-gis-test": { - "id": "aws-cdk-dynamodb-contributor-insights-for-gis-test", - "path": "aws-cdk-dynamodb-contributor-insights-for-gis-test", + "aws-cdk-dynamodb-contributor-insights-for-gsi-test": { + "id": "aws-cdk-dynamodb-contributor-insights-for-gsi-test", + "path": "aws-cdk-dynamodb-contributor-insights-for-gsi-test", "children": { "DefaultTest": { "id": "DefaultTest", - "path": "aws-cdk-dynamodb-contributor-insights-for-gis-test/DefaultTest", + "path": "aws-cdk-dynamodb-contributor-insights-for-gsi-test/DefaultTest", "children": { "Default": { "id": "Default", - "path": "aws-cdk-dynamodb-contributor-insights-for-gis-test/DefaultTest/Default", + "path": "aws-cdk-dynamodb-contributor-insights-for-gsi-test/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", "version": "10.3.0" @@ -139,11 +139,11 @@ }, "DeployAssert": { "id": "DeployAssert", - "path": "aws-cdk-dynamodb-contributor-insights-for-gis-test/DefaultTest/DeployAssert", + "path": "aws-cdk-dynamodb-contributor-insights-for-gsi-test/DefaultTest/DeployAssert", "children": { "BootstrapVersion": { "id": "BootstrapVersion", - "path": "aws-cdk-dynamodb-contributor-insights-for-gis-test/DefaultTest/DeployAssert/BootstrapVersion", + "path": "aws-cdk-dynamodb-contributor-insights-for-gsi-test/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -151,7 +151,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "aws-cdk-dynamodb-contributor-insights-for-gis-test/DefaultTest/DeployAssert/CheckBootstrapVersion", + "path": "aws-cdk-dynamodb-contributor-insights-for-gsi-test/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.ts index 6f56debb6e473..7e1968ba12fc4 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.contirubtor-insights-for-gsi.ts @@ -3,7 +3,7 @@ import { Attribute, AttributeType, Table } from 'aws-cdk-lib/aws-dynamodb'; import { IntegTest } from '@aws-cdk/integ-tests-alpha'; // CDK parameters -const STACK_NAME = 'aws-cdk-dynamodb-contributor-insights-for-gis'; +const STACK_NAME = 'aws-cdk-dynamodb-contributor-insights-for-gsi'; // DynamoDB table parameters const TABLE = 'TableWithGlobalSecondaryIndex'; @@ -34,7 +34,6 @@ table.addGlobalSecondaryIndex({ partitionKey: GSI_PARTITION_KEY, }); -new IntegTest(app, 'aws-cdk-dynamodb-contributor-insights-for-gis-test', { +new IntegTest(app, 'aws-cdk-dynamodb-contributor-insights-for-gsi-test', { testCases: [stack], }); -