TopicGrants

class aws_cdk.aws_sns.TopicGrants(*args: Any, **kwargs)

Bases: object

Collection of grant methods for a ITopicRef.

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_sns as sns
from aws_cdk.interfaces import aws_sns as interfaces_aws_sns

# topic_ref: interfaces_aws_sns.ITopicRef

topic_grants = sns.TopicGrants.from_topic(topic_ref)

Methods

publish(grantee)

Grant topic publishing permissions to the given identity.

Parameters:

grantee (IGrantable)

Return type:

Grant

subscribe(grantee)

Grant topic subscribing permissions to the given identity.

Parameters:

grantee (IGrantable)

Return type:

Grant

Static Methods

classmethod from_topic(resource)

Creates grants for TopicGrants.

Parameters:

resource (ITopicRef)

Return type:

TopicGrants