Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing existing sns topic var #46

Conversation

joe-niland
Copy link
Member

what

why

  • Some teams use one SNS topic for multiple CloudWatch alarms

references

@joe-niland joe-niland requested review from a team as code owners July 9, 2022 03:57
@joe-niland joe-niland requested review from Makeshift and woz5999 and removed request for a team July 9, 2022 03:57
Copy link

@bridgecrew bridgecrew bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bridgecrew has found errors in this PR ⬇️

create_sns_topic = var.aws_sns_topic_arn == ""
aws_sns_topic_arn = local.create_sns_topic ? aws_sns_topic.default.*.arn : [var.aws_sns_topic_arn]
}

resource "aws_sns_topic" "default" {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM   Ensure AWS SNS topic has SSE enabled
    Resource: aws_sns_topic.default | ID: BC_AWS_GENERAL_15

How to Fix

resource "aws_sns_topic" "example" {
  ...
  name              = "user-updates-topic"
+ kms_master_key_id = "alias/aws/sns"
}

Description

Amazon SNS is a publishers and subscribers messaging service. When you publish messages to encrypted topics, customer master keys (CMK), powered by AWS KMS, can be used to encrypt your messages.

If you operate in a regulated market, such as HIPAA for healthcare, PCI DSS for finance, or FedRAMP for government, you need to ensure sensitive data messages passed in this service are encrypted at rest.

Benchmarks

  • PCI-DSS V3.2 3
  • FEDRAMP (MODERATE) SC-28

@joe-niland
Copy link
Member Author

/test all

create_sns_topic = var.aws_sns_topic_arn == ""
aws_sns_topic_arn = local.create_sns_topic ? aws_sns_topic.default.*.arn : [var.aws_sns_topic_arn]
}

resource "aws_sns_topic" "default" {
Copy link

@bridgecrew bridgecrew bot Jul 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM   Ensure AWS SNS topic has SSE enabled
    Resource: module.rds_alarms.aws_sns_topic.default | ID: BC_AWS_GENERAL_15

How to Fix

resource "aws_sns_topic" "example" {
  ...
  name              = "user-updates-topic"
+ kms_master_key_id = "alias/aws/sns"
}

Description

Amazon SNS is a publishers and subscribers messaging service. When you publish messages to encrypted topics, customer master keys (CMK), powered by AWS KMS, can be used to encrypt your messages.

If you operate in a regulated market, such as HIPAA for healthcare, PCI DSS for finance, or FedRAMP for government, you need to ensure sensitive data messages passed in this service are encrypted at rest.

Benchmarks

  • PCI-DSS V3.2 3
  • FEDRAMP (MODERATE) SC-28

🎉   Fixed by commit 9580fac - Add test for existing SNS topic

@joe-niland
Copy link
Member Author

/test all

@joe-niland
Copy link
Member Author

/test bats

@joe-niland
Copy link
Member Author

/test terratest

@joe-niland
Copy link
Member Author

/test terratest

@joe-niland
Copy link
Member Author

/test terratest

@hans-d hans-d closed this Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to not generate a new SNS topic
2 participants