-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
74 lines (60 loc) · 2.64 KB
/
main.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
locals {
metadata = {
package = "terraform-aws-messaging"
version = trimspace(file("${path.module}/../../VERSION"))
module = basename(path.module)
name = var.name
}
module_tags = var.module_tags_enabled ? {
"module.terraform.io/package" = local.metadata.package
"module.terraform.io/version" = local.metadata.version
"module.terraform.io/name" = local.metadata.module
"module.terraform.io/full-name" = "${local.metadata.package}/${local.metadata.module}"
"module.terraform.io/instance" = local.metadata.name
} : {}
}
###################################################
# SNS Topic
###################################################
# INFO: Not supported attributes
# - `name_prefix`
# - `delivery_policy`
resource "aws_sns_topic" "this" {
name = var.name
display_name = var.display_name
fifo_topic = true
content_based_deduplication = var.content_based_deduplication
## Observability
tracing_config = (var.xray_tracing_enabled
? "Active"
: "PassThrough"
)
## Encryption
signature_version = var.signature_version
kms_master_key_id = (var.encryption_at_rest.enabled
? var.encryption_at_rest.kms_key
: null
)
# application_success_feedback_role_arn - (Optional) The IAM role permitted to receive success feedback for this topic
# application_success_feedback_sample_rate - (Optional) Percentage of success to sample
# application_failure_feedback_role_arn - (Optional) IAM role for failure feedback
# http_success_feedback_role_arn - (Optional) The IAM role permitted to receive success feedback for this topic
# http_success_feedback_sample_rate - (Optional) Percentage of success to sample
# http_failure_feedback_role_arn - (Optional) IAM role for failure feedback
# lambda_success_feedback_role_arn - (Optional) The IAM role permitted to receive success feedback for this topic
# lambda_success_feedback_sample_rate - (Optional) Percentage of success to sample
# lambda_failure_feedback_role_arn - (Optional) IAM role for failure feedback
# sqs_success_feedback_role_arn - (Optional) The IAM role permitted to receive success feedback for this topic
# sqs_success_feedback_sample_rate - (Optional) Percentage of success to sample
# sqs_failure_feedback_role_arn - (Optional) IAM role for failure feedback
# firehose_success_feedback_role_arn - (Optional) The IAM role permitted to receive success feedback for this topic
# firehose_success_feedback_sample_rate - (Optional) Percentage of success to sample
# firehose_failure_feedback_role_arn
tags = merge(
{
"Name" = local.metadata.name
},
local.module_tags,
var.tags,
)
}