TableGrantsProps Struct
Construction properties for TableGrants.
| Source | aws-dynamodb/lib/table-grants.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_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
# 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
// 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();
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" }
};
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
encryptedResourceoptionalIEncryptedResourceencrypted_resourceoptionalIEncryptedResourceencryptedResourceoptionalIEncryptedResourceEncryptedResourceoptionalIEncryptedResourceEncryptedResourceoptionalIEncryptedResource deprecated #- 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_resourceoptionalIResourceWithPolicyV2policyResourceoptionalIResourceWithPolicyV2PolicyResourceoptionalIResourceWithPolicyV2PolicyResourceoptionalIResourceWithPolicyV2 deprecated #- 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