Prune EBS snapshots based on a simple backup retention policy
Project description
Prune EBS Snapshots based on a simple backup retention policy
configuration
-------------
This script uses the boto3 library to communicate with AWS. You must configure your AWS credentials using one
of the methods supported by boto3. For full details see:
https://boto3.readthedocs.io/en/latest/guide/configuration.html#guide-configuration
The AWS user must have appropriate permissions. Here is an example AWS policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1422916495000",
"Effect": "Allow",
"Action": [
"ec2:DeleteSnapshot",
"ec2:DescribeSnapshots"
],
"Resource": [
"*"
]
}
]
}
usage
-----
Always use the ``--help`` option to see the most up-to-date options available.
Basic usage is:
prune-ebs-snapshots [options] volume_id tag_name tag_value
``volume_id`` specifies which EBS volume to prune snapshots for
``tag_name`` and ``tag_value`` specify a tag and corresponding value that must be present on all snapshots considered for pruning.
Typically you would configure a backup script to include this particular tag value on all snapshots created for backup purposes.
Snapshots created for other purposes would not have this tag, and therefore would not be deleted by this pruning script, or considered
as part of the backup set for determining which snapshots to delete.
Options are used to specify how many daily, weekly, monthly and yearly snapshots to retain. Use ``--help`` for more details.
configuration
-------------
This script uses the boto3 library to communicate with AWS. You must configure your AWS credentials using one
of the methods supported by boto3. For full details see:
https://boto3.readthedocs.io/en/latest/guide/configuration.html#guide-configuration
The AWS user must have appropriate permissions. Here is an example AWS policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1422916495000",
"Effect": "Allow",
"Action": [
"ec2:DeleteSnapshot",
"ec2:DescribeSnapshots"
],
"Resource": [
"*"
]
}
]
}
usage
-----
Always use the ``--help`` option to see the most up-to-date options available.
Basic usage is:
prune-ebs-snapshots [options] volume_id tag_name tag_value
``volume_id`` specifies which EBS volume to prune snapshots for
``tag_name`` and ``tag_value`` specify a tag and corresponding value that must be present on all snapshots considered for pruning.
Typically you would configure a backup script to include this particular tag value on all snapshots created for backup purposes.
Snapshots created for other purposes would not have this tag, and therefore would not be deleted by this pruning script, or considered
as part of the backup set for determining which snapshots to delete.
Options are used to specify how many daily, weekly, monthly and yearly snapshots to retain. Use ``--help`` for more details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for prune-ebs-snapshots-0.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4a0e5ff8719420f5dfa0b87a98c5a366d528f7148857058011c6374bc467a19 |
|
MD5 | 90a4c314170404727f957ed09ced5705 |
|
BLAKE2b-256 | 6b5b991664a195eb9449ab8e23b227277c117be4fbe6e60dd0a935d4be72bce8 |
Close
Hashes for prune_ebs_snapshots-0.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8d1090800e82a7657b6f3944599630d4a83eb8c3505d81914bf126e4ab72f72 |
|
MD5 | ed73bf180f2ae3e49267f2887ecbcf9b |
|
BLAKE2b-256 | d6927a36920915ab92c813148a93755dc7fd31b247843e9662f13e1157351c4f |