Class TopicGrants

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.sns.TopicGrants
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)", date="2026-04-02T21:55:20.226Z") @Stability(Stable) public class TopicGrants extends software.amazon.jsii.JsiiObject
Collection of grant methods for a ITopicRef.

Example:

 Topic topic = new Topic(this, "Topic");
 // This would work the same way if topic was a CfnTopic (L1)
 TopicGrants.fromTopic(topic).subscribe(new AnyPrincipal());
 
  • Constructor Details

    • TopicGrants

      protected TopicGrants(software.amazon.jsii.JsiiObjectRef objRef)
    • TopicGrants

      protected TopicGrants(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • fromTopic

      @Stability(Stable) @NotNull public static TopicGrants fromTopic(@NotNull ITopicRef resource)
      Creates grants for TopicGrants.

      Parameters:
      resource - This parameter is required.
    • actions

      @Stability(Stable) @NotNull public Grant actions(@NotNull IGrantable grantee, @NotNull List<String> actions, @Nullable EncryptedPermissionsOptions options)
      Grant the given identity custom permissions.

      Parameters:
      grantee - This parameter is required.
      actions - This parameter is required.
      options -
    • actions

      @Stability(Stable) @NotNull public Grant actions(@NotNull IGrantable grantee, @NotNull List<String> actions)
      Grant the given identity custom permissions.

      Parameters:
      grantee - This parameter is required.
      actions - This parameter is required.
    • publish

      @Stability(Stable) @NotNull public Grant publish(@NotNull IGrantable grantee)
      Grant topic publishing permissions to the given identity.

      Parameters:
      grantee - This parameter is required.
    • subscribe

      @Stability(Stable) @NotNull public Grant subscribe(@NotNull IGrantable grantee)
      Grant topic subscribing permissions to the given identity.

      Parameters:
      grantee - This parameter is required.
    • getResource

      @Stability(Stable) @NotNull protected ITopicRef getResource()
    • getEncryptedResource

      @Stability(Stable) @Nullable protected IEncryptedResource getEncryptedResource()
    • getPolicyResource

      @Stability(Stable) @Nullable protected IResourceWithPolicyV2 getPolicyResource()