Schema for AWS::SNS::TopicInlinePolicy
SNS inline policy to allow AWS account to publish
resource "awscc_sns_topic_inline_policy" "example" {
topic_arn = awscc_sns_topic.example.topic_arn
policy_document = jsonencode({
"Version" : "2012-10-17",
"Statement" : [
{
"Effect" : "Allow",
"Principal" : {
"AWS" : "arn:aws:iam::${var.target_account}:root"
},
"Action" : [
"SNS:Publish"
]
"Resource" : awscc_sns_topic.example.topic_arn
}
]
})
}
resource "awscc_sns_topic" "example" {
topic_name = "sns-example-topic"
tags = [{
key = "Modified By"
value = "AWSCC"
}]
}
variable "target_account" {
type = string
}
policy_document
(String) A policy document that contains permissions to add to the specified SNS topics.topic_arn
(String) The Amazon Resource Name (ARN) of the topic to which you want to add the policy.id
(String) Uniquely identifies the resource.Import is supported using the following syntax:
$ terraform import awscc_sns_topic_inline_policy.example <resource ID>