Skip to content
v2.274.0

TopicGrants Facade ​

Collection of grant methods for a ITopicRef.

Example ​

ts
const topic = new sns.Topic(this, 'Topic');

// This would work the same way if topic was a CfnTopic (L1)
sns.TopicGrants.fromTopic(topic).subscribe(new iam.AnyPrincipal());

Methods ​

actions(grantee: IGrantable, actions: string[], options?: EncryptedPermissionsOptions): Grantdef actions(self, grantee: IGrantable, actions: typing.List[str], options: typing.Optional[EncryptedPermissionsOptions] = None) -> Grantpublic Grant actions(IGrantable grantee, List<String> actions, EncryptedPermissionsOptions options)public Grant Actions(IGrantable grantee, string[] actions, EncryptedPermissionsOptions? options = null)func Actions(Grantee IGrantable, Actions *[]*string, Options EncryptedPermissionsOptions) Grant#
Grant the given identity custom permissions.
fromTopic(resource: ITopicRef): TopicGrants // chainable@staticmethod def from_topic(resource: ITopicRef) -> TopicGrantspublic static TopicGrants fromTopic(ITopicRef resource)public static TopicGrants FromTopic(ITopicRef resource)func FromTopic(Resource ITopicRef) TopicGrantsstatic#
Creates grants for TopicGrants.
publish(grantee: IGrantable): Grantdef publish(self, grantee: IGrantable) -> Grantpublic Grant publish(IGrantable grantee)public Grant Publish(IGrantable grantee)func Publish(Grantee IGrantable) Grant#
Grant topic publishing permissions to the given identity.
subscribe(grantee: IGrantable): Grantdef subscribe(self, grantee: IGrantable) -> Grantpublic Grant subscribe(IGrantable grantee)public Grant Subscribe(IGrantable grantee)func Subscribe(Grantee IGrantable) Grant#
Grant topic subscribing permissions to the given identity.