Resource: aws_sns_topic_data_protection_policy

Provides an SNS data protection topic policy resource

Example Usage

resource "aws_sns_topic" "example" {
  name = "example"
}

resource "aws_sns_topic_data_protection_policy" "example" {
  arn = aws_sns_topic.example.arn
  policy = jsonencode(
    {
      "Description" = "Example data protection policy"
      "Name"        = "__example_data_protection_policy"
      "Statement" = [
        {
          "DataDirection" = "Inbound"
          "DataIdentifier" = [
            "arn:aws:dataprotection::aws:data-identifier/EmailAddress",
          ]
          "Operation" = {
            "Deny" = {}
          }
          "Principal" = [
            "*",
          ]
          "Sid" = "__deny_statement_11ba9d96"
        },
      ]
      "Version" = "2021-06-01"
    }
  )
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import SNS Data Protection Topic Policy using the topic ARN. For example:

import {
  to = aws_sns_topic_data_protection_policy.example
  id = "arn:aws:sns:us-west-2:0123456789012:example"
}

Using terraform import, import SNS Data Protection Topic Policy using the topic ARN. For example:

% terraform import aws_sns_topic_data_protection_policy.example arn:aws:sns:us-west-2:0123456789012:example