Skip to content
This repository has been archived by the owner on Oct 31, 2019. It is now read-only.
/ devsecops-ebs-backup Public archive

Quick and easy implementation of EBS snapshots via AWS Lambda, with SNS notifications.

License

Notifications You must be signed in to change notification settings

GSA/devsecops-ebs-backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

devsecops-ebs-backup CircleCI

This is a quick implementation of an EBS backup solution with Terraform and Lambda.

It can be executed out of the box by installing Terraform and running the deployment steps below.

Test Deployment

Use these steps to deploy the test.

  1. Create an S3 bucket for the terraform state.

  2. Make sure you're using the latest Terraform. This was tested with Terraform 0.11.7.

  3. Run the following command:

    cd terraform/test
    cp backend.tfvars.example backend.tfvars
    cp terraform.tfvars.example terraform.tfvars
  4. Fill out backend.tfvars with the name of the S3 bucket you just created.

  5. Fill out terraform.tfvars with required values. At a minimum, required variables for this repo are "environment" and "ebs_backup_sns_subscription_addresses". "Environment" is type "string" and "ebs_backup_sns_subscription_addresses" is a terraform list variable.

  6. Run the init:

    terraform init --backend-config="backend.tfvars"
  7. Run a plan to make sure everything is fine and ready to go:

    terraform plan
  8. If there are no issues, apply the stack:

    terraform apply

The address that was configured in the variable "ebs_backup_sns_subscription_addresses" will be asked to confirm the SNS subscription in email. You MUST confirm with the link in the email to receive notifications from the Lambda scripts.

Attribution

The lambda function code used in this terraform module is adapted from this link