github.com/ves/terraform@v0.8.0-beta2/website/source/docs/providers/aws/r/sns_topic_policy.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: sns_topic_policy" 4 sidebar_current: "docs-aws-resource-sns-topic-policy" 5 description: |- 6 Provides an SNS topic policy resource. 7 --- 8 9 # aws\_sns\_topic\_policy 10 11 Provides an SNS topic policy resource 12 13 ## Example Usage 14 15 ``` 16 resource "aws_sns_topic" "test" { 17 name = "my-topic-with-policy" 18 } 19 20 resource "aws_sns_topic_policy" "custom" { 21 arn = "${aws_sns_topic.test.arn}" 22 policy = <<POLICY 23 { 24 "Version": "2012-10-17", 25 "Id": "default", 26 "Statement":[{ 27 "Sid": "default", 28 "Effect": "Allow", 29 "Principal": {"AWS":"*"}, 30 "Action": [ 31 "SNS:GetTopicAttributes", 32 "SNS:SetTopicAttributes", 33 "SNS:AddPermission", 34 "SNS:RemovePermission", 35 "SNS:DeleteTopic" 36 ], 37 "Resource": "${aws_sns_topic.test.arn}" 38 }] 39 } 40 POLICY 41 } 42 ``` 43 44 ## Argument Reference 45 46 The following arguments are supported: 47 48 * `arn` - (Required) The ARN of the SNS topic 49 * `policy` - (Required) The fully-formed AWS policy as JSON