|
@@ -0,0 +1,92 @@
|
|
|
+#### DisableEbsEncryptionByDefault
|
|
|
+resource "aws_sns_topic" "fcm-input-DisableEbsEncryptionByDefault" {
|
|
|
+ name = "fcm-input-DisableEbsEncryptionByDefault"
|
|
|
+ kms_master_key_id = "alias/aws/sns"
|
|
|
+
|
|
|
+ tags = {
|
|
|
+ Project = "FredsCloudMonitor"
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+data "aws_iam_policy_document" "fcm-input-DisableEbsEncryptionByDefault" {
|
|
|
+ statement {
|
|
|
+ effect = "Allow"
|
|
|
+ actions = ["SNS:Publish"]
|
|
|
+
|
|
|
+ principals {
|
|
|
+ type = "Service"
|
|
|
+ identifiers = ["events.amazonaws.com"]
|
|
|
+ }
|
|
|
+
|
|
|
+ resources = [
|
|
|
+ "${aws_sns_topic.fcm-input-DisableEbsEncryptionByDefault.arn}"
|
|
|
+ ]
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+resource "aws_sns_topic_policy" "fcm-input-DisableEbsEncryptionByDefault" {
|
|
|
+ arn = "${aws_sns_topic.fcm-input-DisableEbsEncryptionByDefault.arn}"
|
|
|
+ policy = "${data.aws_iam_policy_document.fcm-input-DisableEbsEncryptionByDefault.json}"
|
|
|
+}
|
|
|
+
|
|
|
+#### EnableEbsEncryptionByDefault
|
|
|
+resource "aws_sns_topic" "fcm-input-EnableEbsEncryptionByDefault" {
|
|
|
+ name = "fcm-input-EnableEbsEncryptionByDefault"
|
|
|
+ kms_master_key_id = "alias/aws/sns"
|
|
|
+
|
|
|
+ tags = {
|
|
|
+ Project = "FredsCloudMonitor"
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+data "aws_iam_policy_document" "fcm-input-EnableEbsEncryptionByDefault" {
|
|
|
+ statement {
|
|
|
+ effect = "Allow"
|
|
|
+ actions = ["SNS:Publish"]
|
|
|
+
|
|
|
+ principals {
|
|
|
+ type = "Service"
|
|
|
+ identifiers = ["events.amazonaws.com"]
|
|
|
+ }
|
|
|
+
|
|
|
+ resources = [
|
|
|
+ "${aws_sns_topic.fcm-input-EnableEbsEncryptionByDefault.arn}"
|
|
|
+ ]
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+resource "aws_sns_topic_policy" "fcm-input-EnableEbsEncryptionByDefault" {
|
|
|
+ arn = "${aws_sns_topic.fcm-input-EnableEbsEncryptionByDefault.arn}"
|
|
|
+ policy = "${data.aws_iam_policy_document.fcm-input-EnableEbsEncryptionByDefault.json}"
|
|
|
+}
|
|
|
+
|
|
|
+#### Custom: EbsEncryptionByDefault
|
|
|
+resource "aws_sns_topic" "fcm-custom-EbsEncryptionByDefault" {
|
|
|
+ name = "fcm-custom_EbsEncryptionByDefault"
|
|
|
+ kms_master_key_id = "alias/aws/sns"
|
|
|
+
|
|
|
+ tags = {
|
|
|
+ Project = "FredsCloudMonitor"
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+data "aws_iam_policy_document" "fcm-custom-EbsEncryptionByDefault" {
|
|
|
+ statement {
|
|
|
+ effect = "Allow"
|
|
|
+ actions = ["SNS:Publish"]
|
|
|
+
|
|
|
+ principals {
|
|
|
+ type = "Service"
|
|
|
+ identifiers = ["events.amazonaws.com"]
|
|
|
+ }
|
|
|
+
|
|
|
+ resources = [
|
|
|
+ "${aws_sns_topic.fcm-custom-EbsEncryptionByDefault.arn}"
|
|
|
+ ]
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+resource "aws_sns_topic_policy" "fcm-custom-EbsEncryptionByDefault" {
|
|
|
+ arn = "${aws_sns_topic.fcm-custom-EbsEncryptionByDefault.arn}"
|
|
|
+ policy = "${data.aws_iam_policy_document.fcm-custom-EbsEncryptionByDefault.json}"
|
|
|
+}
|