rds-export-to-s3

binbashar/rds-export-to-s3/aws

Terraform Module HCL AWS

Terraform module that deploys Lambda functions to trigger exports of RDS snapshots to S3

Install
module "rds-export-to-s3" {
source = "binbashar/rds-export-to-s3/aws"
version = "0.4.3"
}
plain text: /constructs/tfmod-binbashar-rds-export-to-s3-aws/install.txt
⭐ Source on GitHub 📦 Registry page
README

Terraform Module: RDS Snapshots Export To S3 Brief Terraform module that deploys Lambda functions that take care of triggering and monitoring exports of RDS snapshots to S3. Design A Lambda function takes care of triggering the RDS Start Export Task for the given database name. The snapshots will be exported to the given S3 bucket. Another Lambda function is only interested in RDS Export Task events that match a given database name. Whenever a match is detected, a message will be published in the given SNS topic which you can use to trigger other components. E.g. a Lambda function that sends notifications to Slack. A single CloudWatch Event Rule takes care of listening for RDS Snapshots Events in order to call the aforementioned Lambda functions. Important considerations Please note, that

Inputs (13)
NameTypeDescriptionDefault
python_runtime_versionstringRuntime Version of Python to use."3.8"
prefixstringPrefix that will be used for naming resources. '<prefix>resouce-name'.null
database_namesstringThe names of the databases whose snapshots we want to export to S3. Comma-separanull
snapshots_bucket_namestringThe name of the bucket where the RDS snapshots will be exported to.null
customer_kms_key_arnstringThe ARN of customer managed key used for RDS export encryption. Mandatory if 'crnull
notifications_topic_arnstringThe ARN of an SNS Topic which will be used for publishing notifications messagesnull
tagsmap(string)(Optional) A mapping of tags to assign to the bucket.{}
rds_event_idsstringRDS (CloudWatch) Event ID that will trigger the calling of RDS Start Export Task"RDS-EVENT-0091, RDS-EVENT-0169"
log_levelstringThe log level of the Lambda function."INFO"
postfixstringPostfix that will be used for naming resources. 'resouce-name-<postfix>'.null
snapshots_bucket_prefixstringThe Amazon S3 bucket prefix to use as the file name and path of the exported snanull
create_customer_kms_keyboolCreate customer managed KMS key which is used for encrypting the exported snapshfalse
create_notifications_topicboolCreate new SNS notifications topic which will be used for publishing notificatiotrue
Outputs (7)
snapshots_events_sns_topics_arn — RDS Snapshots Events SNS Topics ARN
snapshots_events_export_monitor_sns_topics_arn — RDS Snapshots Export Monitor Events SNS Topics ARN
start_export_task_lambda_function_arn — Start Export Task Lambda Function ARN
start_export_task_lambda_role_arn — Start Export Task Lambda Role ARN
monitor_export_task_lambda_function_arn — Start Export Task Monitor Lambda Function ARN
monitor_export_task_lambda_role_arn — Start Export Task Monitor Lambda Role ARN
snapshots_export_encryption_key_arn — Snapshots Export Encryption Key ARN
Resources (11)
aws_cloudwatch_event_ruleaws_cloudwatch_event_targetaws_iam_policyaws_iam_roleaws_iam_role_policyaws_kms_aliasaws_kms_keyaws_lambda_permissionaws_sns_topicaws_sns_topic_policyaws_sns_topic_subscription
Details
FrameworkTerraform Module
LanguageHCL
Version0.4.3
Cloud AWS
★ Stars22
Forks20
Total downloads32.1k
Inputs13
Outputs7
Resources11
Examples2
Namespacebinbashar
Updated