You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
terraform-aws-sns-to-cloudwatch-logs-lambda is a Terraform module to provision a Lambda Function which routes SNS messages to CloudWatch Logs
Exception: if using var.aws_region to specify deployment region, use version = "2.0.1", until you can switch to provider aliases and explicit provider passing.
Terraform Module Features
This Module allows simple and rapid deployment
Creates Lambda function, Lambda Layer, IAM Policies, Triggers, and Subscriptions
Creates (or use existing) SNS Topic, CloudWatch Log Group and Log Group Stream
Options:
Create CloudWatch Event to prevent Function hibernation
Set Log Group retention period
Python function editable in repository and in Lambda UI
Use with IAM instance policy requires --region $AWS_REGION parameter
Usage
module"sns_logger"{source="robertpeteuil/sns-to-cloudwatch-logs-lambda/aws"version="3.0.1"# Use with Terraform >= 0.12 (including 0.13)# version = "1.0.1" # Latest version for Terraform <= 0.11sns_topic_name="projectx-logging"log_group_name="projectx"log_stream_name="script-logs"}
NOTE: Make sure you are using version pinning to avoid unexpected changes when the module is updated.
Required Inputs
Name
Description
Type
Default
Required
sns_topic_name
Name of SNS Topic to be logged by Gateway
string
-
yes
log_group_name
Name of CloudWatch Log Group
string
-
yes
log_stream_name
Name of CloudWatch Log Stream
string
-
yes
Optional Inputs
Name
Description
Type
Default
Required
create_sns_topic
Create new SNS topic
string
true
no
create_log_group
Create new log group
string
true
no
create_log_stream
Create new log stream
string
true
no
log_group_retention_days
Log Group retention (days)
string
0 (forever)
no
lambda_func_name
Name for Lambda Function
string
dynamically calculated
no
lambda_description
Lambda Function Description
string
Route SNS messages to CloudWatch Logs
no
lambda_tags
Mapping of Tags to assign to Lambda function
map
{}
no
lambda_publish_func
Publish Lambda Function
string
false
no
lambda_runtime
Lambda runtime for Function
string
python3.11
no
lambda_timeout
Function time-out (seconds)
string
3
no
lambda_mem_size
Function RAM assigned (MB)
string
128
no
create_warmer_event
Create CloudWatch trigger event to prevent hibernation
Name of CloudWatch Log Stream created or used (if previously created). If using an existing stream it must exist in the Log group specified in 'log_group_name'.