{"id":22477166,"url":"https://github.com/base2services/cfn-backup","last_synced_at":"2025-08-02T13:30:50.166Z","repository":{"id":36946524,"uuid":"231995626","full_name":"base2Services/cfn-backup","owner":"base2Services","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-25T03:23:47.000Z","size":36,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-21T18:14:12.891Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/base2Services.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-06T00:36:54.000Z","updated_at":"2020-03-16T08:33:24.000Z","dependencies_parsed_at":"2023-02-14T04:10:12.667Z","dependency_job_id":null,"html_url":"https://github.com/base2Services/cfn-backup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base2Services%2Fcfn-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base2Services%2Fcfn-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base2Services%2Fcfn-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base2Services%2Fcfn-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/base2Services","download_url":"https://codeload.github.com/base2Services/cfn-backup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228476046,"owners_count":17926134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-06T14:09:42.053Z","updated_at":"2024-12-06T14:09:42.715Z","avatar_url":"https://github.com/base2Services.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CfnBackup\n\nGenerate \u0026 manage configuration for the use of [AWS Backup](https://aws.amazon.com/backup/) to manage backup \u0026 retention of your resources. Deployed using CloudFormation.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'cfn-backup'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install cfn-backup\n\nSetup your [AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) by either setting a profile or exporting them as environment variables.\n\n## Usage\n\n```bash\nCommands:\n  cfn-vpn --version, -v                                                            # Print the version\n  cfn-vpn generate  --stack-name --config                                          # Generate the CloudFormation templates\n  cfn-vpn publish --stack-name --config --source-bucket                            # Generate \u0026 publish the CloudFormation templates to S3\n  cfn-vpn help [COMMAND]                                                           # Describe available commands or one specific command\n```\n\nGlobal Options\n\n```bash\np, [--profile=PROFILE]           # AWS Profile\nr, [--region=REGION]             # AWS Region\n                                 # Default: ENV['AWS_REGION']\n    [--verbose], [--no-verbose]  # Set log level to debug\n```\n\n## How It Works\n\nOnce you have decided upon using the default configuration or you are instead providing your custom configuration, use the generate command to verify the CloudFormation is valid. Then, run the publish command, passing your source bucket to deploy the templates to S3. Ensure you have your AWS credentials and region set up either as environment variables or using the `--profile` flag.\n\nOnce published, you will be given the S3 URL to the master template. Launch this in CloudFormation, and this will create the stack and the nessecary resources.\n\nThis will create the following:\n\n* Backup Vault - A vault to store the backups in\n* Backup Plan - A single backup plan containing the rules and resource selection\n* Backup Rules\n  * Daily Rule\n  * Weekly Rule\n  * Monthly Rule\n  * Yearly Rule\n* Backup Selection - A single backup selection covering the tag key-value pair specified in your default or custom config\n\nSimply ensure any resources you wish to be backed up have the tagged applied correctly and they will be included in the next backup job. You can add/remove tags to resources at any time without altering the CloudFormation to ensure new resources will be picked up. \n\nThe following resources are currently supported by AWS Backup:\n* EFS File Systems\n* DynamoDB Tables\n* EBS Volumes (Tagging EC2 Instances is supported, doing this will backup all volumes attached)\n* RDS Instances\n* Storage Gateway\n\n## Custom Configuration\n\nYou can create a custom config file to override the global defaults by providing the path to a YAML file using the `--config` flag.\nThis will perform a deep merge on the global config, meaning you only need to provide the values you want to override in your custom config. The global config file looks like this:\n\n```yaml\n# Determines what tag key/value the backup selection will look for on resources\ntag_key: cfnbackup:enabled\ntag_value: true\n\n# The default retention values (in days). Follows the Grandfather-father-son backup\ndaily_retention: 14 # 14 Days\nweekly_retention: 56 # 8 Weeks\nmonthly_retention: 365 # 12 Months\nyearly_retention: 3652 # 10 Years\n\n# The default cron expressions for each rule (Space-seperated, AWS friendly)\ndaily_cron: 0 0 * * ? * # At 12:00 AM UTC, every day\nweekly_cron: 0 0 ? * 1 * # At 12:00 AM UTC, only on Sunday\nmonthly_cron: 0 0 1 * ? * # At 12:00 AM UTC, on day 1 of the month\nyearly_cron: 0 0 1 1 ? * # At 12:00 AM UTC, on day 1 of the month, only in January\n```\n\n## Custom Rules\n\nIf there are additional rules outside of the default Daily-Weekly-Monthly-Yearly plan, you can define these within your custom configuration file. You must define all properties specified in the example below:\n\n```yaml\ncustom_rules:\n  hourly: # Alphanumeric name describing the rule\n    cron: 0 0/1 * * ? * # Space-seperated AWS cron expression\n    retention: 3 # Number in days to retain backups taken by this rule\n    tag_key: cfnbackup:custom # A tag key that the service will look for on resources\n    tag_value: hourly # The tag value that must match on the provided tag key\n```\n\nThis will create a new Backup Plan, Backup Rule and Backup Selection per custom rule defined here. None of the regular configuration defaults or custom configuration defined in the previous section will have any impact on custom rules.\n\n**NOTE:** AWS Backup has a limitation where the minimum interval between jobs for a backup rule is 60 minutes. This means the lowest interval rule you can currently create will allow you to create *hourly* backups.\n\n## AWS Backup Pricing\n\nWith AWS Backup, you pay only for the amount of backup storage you use and the amount of backup data you restore in the month. There is no minimum fee and there are no set-up charges. Deploying the CloudFormation is free, and so are the AWS Backup resources.\n\nPricing for backup storage and restore differentiates between regions and resources. Please see the [AWS Backup pricing guide](https://aws.amazon.com/backup/pricing/) for a detailed breakdown per region for each resource.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/base2services/cfn-backup.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbase2services%2Fcfn-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbase2services%2Fcfn-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbase2services%2Fcfn-backup/lists"}