-
Notifications
You must be signed in to change notification settings - Fork 0
/
sns.tf
31 lines (27 loc) · 654 Bytes
/
sns.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
variable "ses_subscription_email" {
default = ""
type = string
}
resource "aws_sns_topic" "thumbnails" {
name = "thumbnails-topic"
}
resource "aws_iam_policy" "sns_iam_topic_policy" {
name = "sns_iam_topic_policy"
policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Action = [
"sns:Publish"
]
Effect = "Allow"
Resource = aws_sns_topic.thumbnails.arn
},
]
})
}
resource "aws_sns_topic_subscription" "thumbnails_ses_target" {
topic_arn = aws_sns_topic.thumbnails.arn
protocol = "email"
endpoint = var.ses_subscription_email // TF_VAR_ses_subscription_arn
}