Create EBS-Snapshot and AMI of the Amazon EC2.
Execute recorder ebs
or recorder ami
.
$ recorder ebs -h
NAME:
recorder ebs - Snapshotting for specific instance's volume.
USAGE:
recorder ebs [command options] [arguments...]
OPTIONS:
--self, -s Snapshotting for own volume.
--instance-id value, -i value Set InstanceId. If '--self' option is set, this is ignored.
--region value, -r value Set Region. If '--self' option is set, this is ignored. (default: "ap-northeast-1")
--lifecycle value, -l value Set the number of life cycle for snapshot. (default: 5)
$ recorder ami -h
NAME:
recorder ami - Creating Image for specific instance
USAGE:
recorder ami [command options] [arguments...]
OPTIONS:
--self, -s Creating Image for own.
--instance-id value, -i value Set InstanceId. If '--self' option is set, this is ignored. (default: "i-xxxxxxx")
--region value, -r value Set Region. If '--self' option is set, this is ignored. (default: "ap-northeast-1")
--reboot Reboot instance when create image. (Default-value: false, NOT-Reboot.)
If you wish execute another profile, run $ AWS_DEFAULT_PROFILE='another_profile_name' recorder...
.
- Download binary-file.
$ wget https://github.com/heptagon-inc/recorder/releases/download/v0.4.1/recorder_linux_amd64.zip
$ unzip recorder_linux_amd64.zip -d /usr/local/bin/
- Or to install, use
go get
:
$ go get -d github.com/heptagon-inc/recorder
$ cd $GOPATH/src/github.com/heptagon-inc/recorder
$ make build-local
Set of credentials, or instances roll configuration required.
- Set AWS configuration file.
cat ~/.aws/credentials
[default]
aws_access_key_id = XXXXXXXXXX
aws_secret_access_key = XXXXXXXXXXXXXXX
- Required IAM Policy.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:CreateSnapshot",
"ec2:CreateTags",
"ec2:DeleteSnapshot",
"ec2:DescribeSnapshots",
"ec2:DescribeInstances",
"ec2:CreateImage",
"ec2:DeregisterImage",
"ec2:DescribeImages"
],
"Resource": [
"*"
]
}
]
}
Test does not exist yet.
- Fork (https://github.com/heptagon-inc/recorder/fork)
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Run test suite with the
go test ./...
command and confirm that it passes - Run
gofmt -s
- Create a new Pull Request