# TableGrantsProps

Construction properties for TableGrants.

Used as props by: [TableGrants](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb.TableGrants.html)

- Source: [`aws-dynamodb/lib/table-grants.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-dynamodb/lib/table-grants.ts#L11)
- Type last changed: v2.239.0 · 19 Feb 2026

## Example

TypeScript:

```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'],
};
```

Python:

```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_iam as iam
from aws_cdk.interfaces import aws_dynamodb as interfaces_dynamodb

# encrypted_resource: iam.IEncryptedResource
# resource_with_policy_v2: iam.IResourceWithPolicyV2
# table_ref: interfaces_dynamodb.ITableRef

table_grants_props = dynamodb.TableGrantsProps(
    table=table_ref,

    # the properties below are optional
    encrypted_resource=encrypted_resource,
    has_index=False,
    policy_resource=resource_with_policy_v2,
    regions=["regions"]
)
```

Java:

```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.iam.*;
import software.amazon.awscdk.interfaces.dynamodb.*;

IEncryptedResource encryptedResource;
IResourceWithPolicyV2 resourceWithPolicyV2;
ITableRef tableRef;

TableGrantsProps tableGrantsProps = TableGrantsProps.builder()
        .table(tableRef)

        // the properties below are optional
        .encryptedResource(encryptedResource)
        .hasIndex(false)
        .policyResource(resourceWithPolicyV2)
        .regions(List.of("regions"))
        .build();
```

C# / .NET:

```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.IAM;
using Amazon.CDK.Interfaces.DynamoDB;

IEncryptedResource encryptedResource;
IResourceWithPolicyV2 resourceWithPolicyV2;
ITableRef tableRef;

var tableGrantsProps = new TableGrantsProps {
    Table = tableRef,

    // the properties below are optional
    EncryptedResource = encryptedResource,
    HasIndex = false,
    PolicyResource = resourceWithPolicyV2,
    Regions = new [] { "regions" }
};
```

Golang:

```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"
import "github.com/aws/aws-cdk-go/awscdk"

var encryptedResource IEncryptedResource
var resourceWithPolicyV2 IResourceWithPolicyV2
var tableRef ITableRef

tableGrantsProps := &TableGrantsProps{
	Table: tableRef,

	// the properties below are optional
	EncryptedResource: encryptedResource,
	HasIndex: jsii.Boolean(false),
	PolicyResource: resourceWithPolicyV2,
	Regions: []*string{
		jsii.String("regions"),
	},
}
```

## Properties

- `encryptedResource`: [IEncryptedResource](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IEncryptedResource.html) — - 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.

- `hasIndex`: boolean = false — Whether this table has indexes.

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

- `policyResource`: [IResourceWithPolicyV2](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IResourceWithPolicyV2.html) — - 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.

- `regions`: string[] — Additional regions other than the main one that this table is replicated to.

  **Default:** No regions

- `table`: [ITableRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_dynamodb.ITableRef.html) (required) — The table to grant permissions on.
