Skip to content

kabisa/terraform-aws-backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kabisa logo

terraform-aws-backup Build Status Latest Release Terraform version Slack Community

Terraform module designed to easily backup resources using AWS Backup.

Plans determine when to make a backup and for how long this backup should be retained. The backups are securely stored in a seperate vault and encrypted with a KMS key.

By default, the following rules are defined:

When To cold storage after (days) Deleted after (days)
Daily at 0:00 - 35
Weekly at Sunday 0:00 - 90
Monthly at first day of month 0:00 90 730

It's 100% Open Source and licensed under the MIT.

Usage

This project is available on the Terraform Registry

Include this module in your existing terraform code:

module "backup" {
  source  = "kabisa/backup/aws"
  #Use the latest version from the Terraform Registry
  version = "0.1.0"

  daily_cron = "cron(0 0 * * ? *)" # optional
  daily_delete_after = 35 # optional

  weekly_cron = "cron(0 0 ? * 1 *)" # optional
  weekly_delete_after = 90 # optional

  monthly_cron = "cron(0 0 1 * ? *)" # optional
  monthly_delete_after = 730 # optional
  monthly_cold_storage_after = 90 # optional

  namespace = "my_company"
  name = "my_project_name"
  stage = "staging_production_etc"
  tags = {
    My_custom_tag_1: "my_custom_value_1"
    My_custom_tag_2: "my_custom_value_2"
  }

  backup_resource_ids = [
    "arn_of_my_resource_1",
    "arn_of_my_resource_2"
  ]
}

Makefile Targets

Available targets:

  help                                Help screen
  help/all                            Display help for all targets
  help/short                          This help short screen
  lint                                Lint terraform code

Inputs

Name Description Type Default Required
backup_resource_ids List of resource id's or ARNs you would like to include in the backup list <list> yes
name Solution name, e.g. 'app' or 'jenkins' string - no
namespace Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' string - no
region (no description specified) string - no
stage Stage (e.g. prod, dev, staging) string - no
tags Additional tags (e.g. map(BusinessUnit,XYZ) map(string) <map> no

Outputs

Name Description
key_id ID of the KMS key created to encrypt the backup vault
key_arn ARN of the KMS key created to encrypt the backup vault

Share the Love

Like this project? Please give it a ★ on our GitHub! (it helps us a lot)

Are you using this project or any of our other projects? Consider sharing this project:

Help

Got a question?

File a GitHub issue, or send us an email.

Support

At Kabisa we believe in the power of AWS in combination with Infrastructure as Code. Our DevOps Engineers are AWS certified and as a result of our expertise and experience we are official AWS partner Standard.

Struggling with Terraform our just need an extra hand? Contact us at:

E-Mail

Contributing

Bug Reports & Feature Requests

Please use the issue tracker to report any bugs or file feature requests.

Developing

If you are interested in being a contributor and want to get involved in developing this project or help out with our other projects, we would love to hear from you! Shoot us an email.

In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull Request so that we can review your changes

NOTE: Be sure to merge the latest changes from "upstream" before making a pull request!

Copyright

Copyright © 2019 Kabisa B.V

License

License

See LICENSE for full details.

Trademarks

All other trademarks referenced herein are the property of their respective owners.

About

This project is maintained and funded by Kabisa B.V. Like it? Please let us know by leaving a comment!

Kabisa logo

-backup&body=https://github.com/kabisa/terraform-aws-backup