Git Product home page Git Product logo

terraform-aws-ebssnap's Introduction

terraform-aws-ebssnap

Build Status Latest Release GitHub tag (latest SemVer) Terraform Version Infrastructure Tests pre-commit checkov Infrastructure Tests

A Terraform module to automate the taking of backup snapshots.


Usage

Include this repository as a module in your existing terraform code:

module "ebsnapshot" {
  source          = "JamesWoolfenden/ebssnap/aws"
  version         = "0.2.9"
  common_tags     = var.common_tags
  snapshot_name   = local.snapshot_name
  cron_expression = var.cron_expression
  regions         = var.regions
}

Creates a lambda and cloudwatch event to look for any instances that have the specified tag and then takes a snapshot of that volume. This is a heavily modified version of this module: https://github.com/kgorskowski/ebs_bckup

Set up your Terraform tf.vars file to look something like:

common_tags = {
    application = "terraform"
    module      = "auto-ebs-snapshot"
    environment = "develop"
}

EC2_INSTANCE_TAG = "Backup"
RETENTION_DAYS   = 10
cron_expression  = "45 1 * * ? *"
regions          = ["eu-west-1","eu-west-2","eu-west-3"]

Requirements

No requirements.

Providers

Name Version
archive n/a
aws n/a
random n/a
template n/a

Modules

No modules.

Resources

Name Type
aws_cloudwatch_event_rule.ebsbackuptimer resource
aws_cloudwatch_event_target.runebsbackuplambda resource
aws_iam_role.ebsbackuplambda resource
aws_iam_role_policy.ebsbackuplambda resource
aws_lambda_function.ebsbackup resource
aws_lambda_permission.allow_cloudwatch_to_call resource
random_string.label resource
template_dir.vars resource
archive_file.lambda_zip data source
aws_iam_policy_document.ebsbackuplambda data source

Inputs

Name Description Type Default Required
EC2_INSTANCE_TAG Tag to identify the EC2 target instances of the Lambda Function string "Backup" no
RETENTION_DAYS Numbers of Days that the EBS Snapshots will be stored (INT) string 5 no
common_tags Implements the common tags scheme map(any) n/a yes
cron_expression Cron expression for firing up the Lambda Function string n/a yes
regions Which Regions to apply the snapshots too list(any) n/a yes
runtime n/a string "python2.7" no
snapshot_name The name of the snapshot string n/a yes
timeout Lambda Timeout in seconds number 60 no
tracing_mode Xray tracing mode string "Active" no

Outputs

Name Description
lambda n/a
role n/a

Related Projects

Check out these related projects.

Contributors

James Woolfenden
James Woolfenden

terraform-aws-ebssnap's People

Contributors

jameswoolfenden avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.