class TopicGrants
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.SNS.TopicGrants |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awssns#TopicGrants |
Java | software.amazon.awscdk.services.sns.TopicGrants |
Python | aws_cdk.aws_sns.TopicGrants |
TypeScript | aws-cdk-lib » aws_sns » TopicGrants |
Collection of grant methods for a ITopicRef.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_sns as sns } from 'aws-cdk-lib';
import { aws_sns as interfaces_aws_sns } from 'aws-cdk-lib/interfaces';
declare const topicRef: interfaces_aws_sns.ITopicRef;
const topicGrants = sns.TopicGrants.fromTopic(topicRef);
Properties
| Name | Type | Description |
|---|---|---|
| resource | ITopic | |
| encrypted | IEncrypted | |
| policy | IResource |
resource
Type:
ITopic
encryptedResource?
Type:
IEncrypted
(optional)
policyResource?
Type:
IResource
(optional)
Methods
| Name | Description |
|---|---|
| publish(grantee) | Grant topic publishing permissions to the given identity. |
| subscribe(grantee) | Grant topic subscribing permissions to the given identity. |
| static from | Creates grants for TopicGrants. |
publish(grantee)
public publish(grantee: IGrantable): Grant
Parameters
- grantee
IGrantable
Returns
Grant topic publishing permissions to the given identity.
subscribe(grantee)
public subscribe(grantee: IGrantable): Grant
Parameters
- grantee
IGrantable
Returns
Grant topic subscribing permissions to the given identity.
static fromTopic(resource)
public static fromTopic(resource: ITopicRef): TopicGrants
Parameters
- resource
ITopicRef
Returns
Creates grants for TopicGrants.

.NET
Go
Java
Python
TypeScript