You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tf-modules/monitoring/sns-to-cloudwatch-logs
lalanza808 95d3b23186 adding sns-to-cloudwatch-logs module 4 years ago
..
lambda adding sns-to-cloudwatch-logs module 4 years ago
README.md adding sns-to-cloudwatch-logs module 4 years ago
cloudwatch.tf adding sns-to-cloudwatch-logs module 4 years ago
lambda.tf adding sns-to-cloudwatch-logs module 4 years ago
lambda_iam.tf adding sns-to-cloudwatch-logs module 4 years ago
main.tf adding sns-to-cloudwatch-logs module 4 years ago
output.tf adding sns-to-cloudwatch-logs module 4 years ago
s3.tf adding sns-to-cloudwatch-logs module 4 years ago
sns.tf adding sns-to-cloudwatch-logs module 4 years ago
variables.tf adding sns-to-cloudwatch-logs module 4 years ago

README.md

SNS to Cloudwatch Logs

This module creates an SNS topic with Lambda subscription and Cloudwatch Log groups. When messages are published to the SNS topic the Lambda function transforms the event message into a JSON object and pushes the event into a Cloudwatch Log stream.

This is useful in some cases where an AWS service only has an SNS topic option (like Guard Duty) but you want to export logs to other services (like Datadog).

The Python script found under ./lambda is zipped up via the archive_file Terraform data type and stored onto S3 via aws_s3_bucket_object Terraform resource.

Usage

module "sns" {
  source = "github.com/lalanza808/tf-modules.git/monitoring/sns-to-cloudwatch-logs"

  namespace = "sandbox-guardduty"
}

Inputs

namespace is the only input. All the resources get named with this variable.

Outputs

You will want to reference the outputs to retrieve the SNS topic ARN; many other modules will want to use it as an input to another module. See output.tf for full details.