github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/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  ```hcl
    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  
    23    policy = <<POLICY
    24  {
    25    "Version": "2012-10-17",
    26    "Id": "default",
    27    "Statement":[{
    28      "Sid": "default",
    29      "Effect": "Allow",
    30      "Principal": {"AWS":"*"},
    31      "Action": [
    32        "SNS:GetTopicAttributes",
    33        "SNS:SetTopicAttributes",
    34        "SNS:AddPermission",
    35        "SNS:RemovePermission",
    36        "SNS:DeleteTopic"
    37      ],
    38      "Resource": "${aws_sns_topic.test.arn}"
    39    }]
    40  }
    41  POLICY
    42  }
    43  ```
    44  
    45  ## Argument Reference
    46  
    47  The following arguments are supported:
    48  
    49  * `arn` - (Required) The ARN of the SNS topic
    50  * `policy` - (Required) The fully-formed AWS policy as JSON