TableGrantsProps Struct
Construction properties for TableGrants.
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_iam as iam } from 'aws-cdk-lib';
import { aws_dynamodb as interfaces_dynamodb } from 'aws-cdk-lib/interfaces';
declare const encryptedResource: iam.IEncryptedResource;
declare const resourceWithPolicyV2: iam.IResourceWithPolicyV2;
declare const tableRef: interfaces_dynamodb.ITableRef;
const tableGrantsProps: dynamodb.TableGrantsProps = {
table: tableRef,
// the properties below are optional
encryptedResource: encryptedResource,
hasIndex: false,
policyResource: resourceWithPolicyV2,
regions: ['regions'],
};
Properties
encryptedResourceoptionalIEncryptedResourceencrypted_resourceoptionalIEncryptedResourceencryptedResourceoptionalIEncryptedResourceEncryptedResourceoptionalIEncryptedResourceEncryptedResourceoptionalIEncryptedResourcedeprecated#- Leave this field undefined. If the table is encrypted with a customer-managed KMS key, appropriate grants to the key will be automatically added.
Default: A best-effort attempt will be made to discover an associated KMS key and grant permissions to it.
hasIndexoptionalbooleanhas_indexoptionalboolhasIndexoptionalBooleanHasIndexoptionalboolHasIndexoptional*bool= false#Whether this table has indexes.
If so, permissions are granted on all table indexes as well.
policyResourceoptionalIResourceWithPolicyV2policy_resourceoptionalIResourceWithPolicyV2policyResourceoptionalIResourceWithPolicyV2PolicyResourceoptionalIResourceWithPolicyV2PolicyResourceoptionalIResourceWithPolicyV2deprecated#- Leave this field undefined. A best-effort attempt will be made to discover a resource policy and add permissions to it.
Default: A best-effort attempt will be made to discover a resource policy and add permissions to it.
regionsoptionalstring[]regionsoptionaltyping.List[str]regionsoptionalList<String>Regionsoptionalstring[]Regionsoptional*[]*string#Additional regions other than the main one that this table is replicated to.
Default: No regions