Skip to content
v2.274.0

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 ​

encryptedResourceIEncryptedResourceencrypted_resourceIEncryptedResourceencryptedResourceIEncryptedResourceEncryptedResourceIEncryptedResourceEncryptedResourceIEncryptedResourcedeprecated#
- 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.

hasIndexbooleanhas_indexboolhasIndexBooleanHasIndexboolHasIndex*bool= false#
Whether this table has indexes.

If so, permissions are granted on all table indexes as well.

policyResourceIResourceWithPolicyV2policy_resourceIResourceWithPolicyV2policyResourceIResourceWithPolicyV2PolicyResourceIResourceWithPolicyV2PolicyResourceIResourceWithPolicyV2deprecated#
- 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.

regionsstring[]regionstyping.List[str]regionsList<String>Regionsstring[]Regions*[]*string#
Additional regions other than the main one that this table is replicated to.

Default: No regions

tableITableReftableITableReftableITableRefTableITableRefTableITableRefrequired#
The table to grant permissions on.