Skip to content

Commit

Permalink
feat(dynamodb): enable contributor insights for global secondary index (
Browse files Browse the repository at this point in the history
#30560)

### Issue # (if applicable)

Closes #15671 .

### Reason for this change
To enable contributor insights for a specific global secondary index.

This feature is supported in [CFn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-globalsecondaryindex.html#cfn-dynamodb-contributorinsightsspecification-enabled).



### Description of changes
Add `contributorInsightsEnabled` property to the `GlobalSecondaryIndexProps` in `Table`.

In  [AWS::DynamoDB::GlobalTable GlobalSecondaryIndex](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-globalsecondaryindex.html),  `ContributorInsightsSpecification` does not exist.

So I didn't change `TableV2`.



### Description of how you validated changes
Add unit test and integ tests.



### 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*
  • Loading branch information
mazyu36 authored Oct 16, 2024
1 parent 108737d commit 799b541
Show file tree
Hide file tree
Showing 12 changed files with 605 additions and 5 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -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<String>",
"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."
}
]
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 799b541

Please sign in to comment.