Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hiroakis/ebs-snapshot
Create EBS snapshot and delete old snapshot on AWS
https://github.com/hiroakis/ebs-snapshot
Last synced: 14 days ago
JSON representation
Create EBS snapshot and delete old snapshot on AWS
- Host: GitHub
- URL: https://github.com/hiroakis/ebs-snapshot
- Owner: hiroakis
- Created: 2015-09-02T06:57:13.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-02T14:04:31.000Z (about 9 years ago)
- Last Synced: 2023-03-22T15:58:02.697Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 91.8 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ebs-snapshot
Making EBS snapshot script written in Python.
## Installation
Just download `ebs_snapshot.py` on your AWS instance and set its permission to 755.
### AmazonLinux
On Amazonlinux, modules are installed by default.
If you don't use system Python, install `boto` and `requests` on your Python environment.### Ubuntu
Use apt-get(modules will be installed on system Python) or install `boto` and `requests` by yourself.
```
apt-get update
apt-get install awscli python-pip python-boto
```## AWS Credentials
Set AWS credential by environment variable or create `~/.boto`.
* environment variable
```
export AWS_ACCESS_KEY_ID=xxxxx
export AWS_SECRET_ACCESS_KEY=xxxxx
```* ~/.boto
```
[Credentials]
aws_access_key_id=xxxxx
aws_secret_access_key=xxxxx
```Note: the credential need some IAM policies. The following is example.
* IAM policy example
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:Describe*",
"ec2:CreateSnapshot",
"ec2:DeleteSnapshot"
],
"Resource": "*"
}
]
}
```## Usage
Execute `ebs_snapshot.py` on the instance which you would like to create EBS snapshot.
* options
- -h: show helps
- -n: The number of snapshot generations. default: 3
- -l: The log file path. default: /tmp/ebs_snapshot.log## License
MIT