AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::SNS::TopicPolicy

CfnTopicPolicy

The `AWS::SNS::TopicPolicy` resource associates Amazon topics with a policy. For an example snippet, see [Declaring an Amazon policy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-iam.html#scenario-sns-policy) in the *CloudFormation User Guide* .

Import

import { CfnTopicPolicy } from 'aws-cdk-lib/aws-sns';

Or use the module namespace:

import * as sns from 'aws-cdk-lib/aws-sns';
// sns.CfnTopicPolicy

Properties

Configuration passed to the constructor as CfnTopicPolicyProps.

policyDocumentRequired
any

A policy document that contains permissions to add to the specified SNS topics.

topicsRequired
string[]

The Amazon Resource Names (ARN) of the topics to which you want to add the policy. You can use the `[Ref](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html)` function to specify an `[AWS::SNS::Topic](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html)` resource.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Get the Amazon SNS Cheat Sheet

Everything you need to know about Amazon SNS on one page. HD quality, print-friendly.

Download Free Infographic