Skip to main content
Data Storage Modules 0.35.0Last updated in version 0.31.4

Share Snapshot Lambda Module

View SourceRelease Notes

This module creates an AWS Lambda function that can share snapshots of an Amazon Relational Database (RDS) database with another AWS account. Typically, the snapshots are created by the lambda-create-snapshot module, which can be configured to automatically trigger this lambda function after each run.

Background info

For more info on how to backup RDS snapshots to a separate AWS account, check out the lambda-create-snapshot module documentation.

Sample Usage

main.tf

# ------------------------------------------------------------------------------------------------------
# DEPLOY GRUNTWORK'S LAMBDA-SHARE-SNAPSHOT MODULE
# ------------------------------------------------------------------------------------------------------

module "lambda_share_snapshot" {

source = "git::git@github.com:gruntwork-io/terraform-aws-data-storage.git//modules/lambda-share-snapshot?ref=v0.35.0"

# ----------------------------------------------------------------------------------------------------
# REQUIRED VARIABLES
# ----------------------------------------------------------------------------------------------------

# The ARN of the RDS database
rds_db_arn = <string>

# ----------------------------------------------------------------------------------------------------
# OPTIONAL VARIABLES
# ----------------------------------------------------------------------------------------------------

# Set to false to have this module skip creating resources. This weird
# parameter exists solely because Terraform does not support conditional
# modules. Therefore, this is a hack to allow you to conditionally decide if
# this module should create anything or not.
create_resources = true

# The maximum number of retries the lambda function will make while waiting
# for the snapshot to be available
max_retries = 60

# The name for the lambda function and other resources created by these
# Terraform configurations
name = "share-rds-snapshot"

# The amount of time, in seconds, between retries.
sleep_between_retries_sec = 60

}


Reference

Required

rds_db_arnstringrequired

The ARN of the RDS database

Optional

create_resourcesbooloptional

Set to false to have this module skip creating resources. This weird parameter exists solely because Terraform does not support conditional modules. Therefore, this is a hack to allow you to conditionally decide if this module should create anything or not.

true
max_retriesnumberoptional

The maximum number of retries the lambda function will make while waiting for the snapshot to be available

60
namestringoptional

The name for the lambda function and other resources created by these Terraform configurations

"share-rds-snapshot"

The amount of time, in seconds, between retries.

60