TableAttributesV2 Struct
Attributes of a DynamoDB table.
| Source | aws-dynamodb/lib/table-v2.ts |
|---|---|
| Type last changed |
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_dynamodb as dynamodb } from 'aws-cdk-lib';
import { aws_kms as kms } from 'aws-cdk-lib';
declare const key: kms.Key;
const tableAttributesV2: dynamodb.TableAttributesV2 = {
encryptionKey: key,
globalIndexes: ['globalIndexes'],
grantIndexPermissions: false,
localIndexes: ['localIndexes'],
tableArn: 'tableArn',
tableId: 'tableId',
tableName: 'tableName',
tableStreamArn: 'tableStreamArn',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_dynamodb as dynamodb
from aws_cdk import aws_kms as kms
# key: kms.Key
table_attributes_v2 = dynamodb.TableAttributesV2(
encryption_key=key,
global_indexes=["globalIndexes"],
grant_index_permissions=False,
local_indexes=["localIndexes"],
table_arn="tableArn",
table_id="tableId",
table_name="tableName",
table_stream_arn="tableStreamArn"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.dynamodb.*;
import software.amazon.awscdk.services.kms.*;
Key key;
TableAttributesV2 tableAttributesV2 = TableAttributesV2.builder()
.encryptionKey(key)
.globalIndexes(List.of("globalIndexes"))
.grantIndexPermissions(false)
.localIndexes(List.of("localIndexes"))
.tableArn("tableArn")
.tableId("tableId")
.tableName("tableName")
.tableStreamArn("tableStreamArn")
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.DynamoDB;
using Amazon.CDK.AWS.KMS;
Key key;
var tableAttributesV2 = new TableAttributesV2 {
EncryptionKey = key,
GlobalIndexes = new [] { "globalIndexes" },
GrantIndexPermissions = false,
LocalIndexes = new [] { "localIndexes" },
TableArn = "tableArn",
TableId = "tableId",
TableName = "tableName",
TableStreamArn = "tableStreamArn"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
var key Key
tableAttributesV2 := &TableAttributesV2{
EncryptionKey: key,
GlobalIndexes: []*string{
jsii.String("globalIndexes"),
},
GrantIndexPermissions: jsii.Boolean(false),
LocalIndexes: []*string{
jsii.String("localIndexes"),
},
TableArn: jsii.String("tableArn"),
TableId: jsii.String("tableId"),
TableName: jsii.String("tableName"),
TableStreamArn: jsii.String("tableStreamArn"),
}
Properties
encryptionKeyoptionalIKeyencryption_keyoptionalIKeyencryptionKeyoptionalIKeyEncryptionKeyoptionalIKeyEncryptionKeyoptionalIKey #KMS encryption key for the table.
Default: no KMS encryption key
globalIndexesoptionalstring[]global_indexesoptionaltyping.List[str]globalIndexesoptionalList<String>GlobalIndexesoptionalstring[]GlobalIndexesoptional*[]*string #The name of the global indexes set for the table.
Default: no global indexes
Note: You must set either this property or localIndexes if you want permissions to be granted for indexes as well as the table itself.
grantIndexPermissionsoptionalbooleangrant_index_permissionsoptionalboolgrantIndexPermissionsoptionalBooleanGrantIndexPermissionsoptionalboolGrantIndexPermissionsoptional*bool = false #Whether or not to grant permissions for all indexes of the table.
Note: If false, permissions will only be granted to indexes when globalIndexes or localIndexes is specified.
localIndexesoptionalstring[]local_indexesoptionaltyping.List[str]localIndexesoptionalList<String>LocalIndexesoptionalstring[]LocalIndexesoptional*[]*string #The name of the local indexes set for the table.
Default: no local indexes
Note: You must set either this property or globalIndexes if you want permissions to be granted for indexes as well as the table itself.
tableArnoptionalstringtable_arnoptionalstrtableArnoptionalStringTableArnoptionalstringTableArnoptional*string #The ARN of the table.
Default: table arn generated using tableName and region of stack
Note: You must specify this or the tableName.
tableIdoptionalstringtable_idoptionalstrtableIdoptionalStringTableIdoptionalstringTableIdoptional*string #The ID of the table.
Default: no table id
tableNameoptionalstringtable_nameoptionalstrtableNameoptionalStringTableNameoptionalstringTableNameoptional*string #The name of the table.
Default: table name retrieved from provided tableArn
Note: You must specify this or the tableArn.
tableStreamArnoptionalstringtable_stream_arnoptionalstrtableStreamArnoptionalStringTableStreamArnoptionalstringTableStreamArnoptional*string #The stream ARN of the table.
Default: no table stream ARN