StreamGrants Class
A set of permissions to grant on a Table Stream.
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';
import { aws_dynamodb as interfaces_dynamodb } from 'aws-cdk-lib/interfaces';
declare const key: kms.Key;
declare const tableRef: interfaces_dynamodb.ITableRef;
const streamGrants = new dynamodb.StreamGrants({
tableStreamArn: 'tableStreamArn',
// the properties below are optional
encryptionKey: key,
table: tableRef,
});
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
from aws_cdk.interfaces import aws_dynamodb as interfaces_dynamodb
# key: kms.Key
# table_ref: interfaces_dynamodb.ITableRef
stream_grants = dynamodb.StreamGrants(
table_stream_arn="tableStreamArn",
# the properties below are optional
encryption_key=key,
table=table_ref
)
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.*;
import software.amazon.awscdk.interfaces.dynamodb.*;
Key key;
ITableRef tableRef;
StreamGrants streamGrants = StreamGrants.Builder.create()
.tableStreamArn("tableStreamArn")
// the properties below are optional
.encryptionKey(key)
.table(tableRef)
.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;
using Amazon.CDK.Interfaces.DynamoDB;
Key key;
ITableRef tableRef;
var streamGrants = new StreamGrants(new StreamGrantsProps {
TableStreamArn = "tableStreamArn",
// the properties below are optional
EncryptionKey = key,
Table = tableRef
});
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 key Key
var tableRef ITableRef
streamGrants := awscdk.Aws_dynamodb.NewStreamGrants(&StreamGrantsProps{
TableStreamArn: jsii.String("tableStreamArn"),
// the properties below are optional
EncryptionKey: key,
Table: tableRef,
})
Initializer
ts
new StreamGrants(props: StreamGrantsProps)
python
StreamGrants(props: StreamGrantsProps)
java
new StreamGrants(StreamGrantsProps props)
csharp
new StreamGrants(StreamGrantsProps props)
go
NewStreamGrants(Props StreamGrantsProps)
Methods
actions(grantee: IGrantable, ...actions: string[]): Grantdef actions(self, grantee: IGrantable, actions: str) -> Grantpublic Grant actions(IGrantable grantee, String actions)public Grant Actions(IGrantable grantee, string actions)func Actions(Grantee IGrantable, Actions *string) Grant#Adds an IAM policy statement associated with this table's stream to an IAM principal's policy.
If encryptionKey is present, appropriate grants to the key needs to be added separately using the table.encryptionKey.grant* methods.
2 parameters
Parameters
granteegranteegranteegranteeGrantee— The principal (no-op if undefined).actionsactionsactionsactionsActions— The set of actions to allow (i.e. "dynamodb:DescribeStream", "dynamodb:GetRecords", ...).
list(grantee: IGrantable): Grantdef list(self, grantee: IGrantable) -> Grantpublic Grant list(IGrantable grantee)public Grant List(IGrantable grantee)func List(Grantee IGrantable) Grant#Permits an IAM Principal to list streams attached to current dynamodb table.
1 parameter
Parameters
granteegranteegranteegranteeGrantee— The principal (no-op if undefined).
read(grantee: IGrantable): Grantdef read(self, grantee: IGrantable) -> Grantpublic Grant read(IGrantable grantee)public Grant Read(IGrantable grantee)func Read(Grantee IGrantable) Grant#Permits an IAM principal all stream data read operations for this table's stream: DescribeStream, GetRecords, GetShardIterator, ListStreams.
Appropriate grants will also be added to the customer-managed KMS key if one was configured.
1 parameter
Parameters
granteegranteegranteegranteeGrantee— The principal to grant access to.