TopicGrants
- class aws_cdk.aws_sns.TopicGrants(*args: Any, **kwargs)
Bases:
objectCollection of grant methods for a ITopicRef.
- ExampleMetadata:
infused
Example:
topic = sns.Topic(self, "Topic") # This would work the same way if topic was a CfnTopic (L1) sns.TopicGrants.from_topic(topic).subscribe(iam.AnyPrincipal())
Methods
- actions(grantee, actions, *, key_actions=None, resource_arns=None)
Grant the given identity custom permissions.
- Parameters:
grantee (
IGrantable)actions (
Sequence[str])key_actions (
Optional[Sequence[str]]) – The KMS key actions to grant permissions for. Default: - No permission is added to the KMS key, even if it existsresource_arns (
Optional[Sequence[str]]) – The ARNs of the resources to grant permissions on. Default: - The ARN of the resource associated with the grant is used.
- Return type:
- publish(grantee)
Grant topic publishing permissions to the given identity.
- Parameters:
grantee (
IGrantable)- Return type:
- subscribe(grantee)
Grant topic subscribing permissions to the given identity.
- Parameters:
grantee (
IGrantable)- Return type:
Static Methods