Giter Club home page Giter Club logo

docker-offsite-rds-snapshots's Introduction

docker-offsite-rds-snapshots

This is a docker image to make an RDS DB snapshot and then make a Cross Region and/or a Cross Account replica.

Usage :

Use the following envars and then add those below to activate crr and/or car :

Name Description
SRC_RDS_DATABASE Required : Name of the database or cluster to snapshot (ex "my-db-1")
SRC_RDS_DATABASE_REGION Required : AWS region of the database or cluster to snapshot (ex "eu-west-1")
CREDENTIAL_SRC Optional : Where the aws CLI get its credentials, see aws-credential_source (default: "EcsContainer")
DEBUG Optional : If set to true print all operations on stdout (default: none)
KMS_KEY_ARN Optional : If not empty use the ARN key to copy encrypted snapshot (default: none)
RDS_ENGINE Optional : If set to "aurora" perform cluster snaphot instead of database (default: none)
SNAPSHOTS_WAIT_PERIODS Optional : Number of period to wait for the snaphots to be available, each period is 30 minutes (default: 6)

Cross region replication (CRR) :

This will copy the snapshot to an other region of the same account, launch the container with following envars :

  • CRR_REGION : ex "eu-central-1"

Cross account region replication (CAR) :

This will share the snapshot to an other AWS account and copy it to the chosen region, launch the container with following envars :

  • CAR_ACCOUNT_ID : ex "012345678910" (destination account id)
  • CAR_REGION : ex "eu-west-3"
  • CAR_ROLE_ARN : ex "arn:aws:iam::012345678910:role/allow-copy-snapshot"

The IAM role must exist in the destination account, with the source account as a trusted entity and the following permissions :

      {
            "Action": [
                "rds:CopyDBSnapshot",
                "rds:AddTagsToResource",
                "rds:DescribeDBSnapshots"
            ],
            "Effect": "Allow",
            "Resource": "*",
            "Sid": "AllowSnapshotsCopy"
        },
        {
            "Action": [
                "rds:CopyDBClusterSnapshot",
                "rds:AddTagsToResource",
                "rds:DescribeDBClusterSnapshots",
                "rds:DeleteDBClusterSnapshot"
            ],
            "Effect": "Allow",
            "Resource": "*",
            "Sid": "AllowAuroraSnapshotsCopy"
        },

If KMS_KEY_ARN is set the role will also need KMS permissions, see Sharing encrypted snapshots

docker-offsite-rds-snapshots's People

Contributors

lconsuegra avatar hbollon avatar

Watchers

Christian Kaenzig avatar Yves Jacolin avatar James Cloos avatar Alexandre Fayolle avatar Yannick Payot avatar Maurer Luc avatar Julien Acroute avatar  avatar  avatar  avatar Maeva Londero avatar

Forkers

hbollon

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.