This repository was archived by the owner on Feb 1, 2019. It is now read-only.
Automatically create snapshots when destroying volumes - #33
Open
ivyleavedtoadflax wants to merge 10 commits into
Open
Automatically create snapshots when destroying volumes#33ivyleavedtoadflax wants to merge 10 commits into
ivyleavedtoadflax wants to merge 10 commits into
Conversation
Currently this needs to be set to '1' or 'true' (in fact any string will do!)
ivyleavedtoadflax
force-pushed
the
feature/create_snapshots
branch
from
January 18, 2018 12:19
e78dc9f to
25d451b
Compare
ivyleavedtoadflax
force-pushed
the
feature/create_snapshots
branch
from
January 18, 2018 17:40
a45b210 to
4650bbf
Compare
|
|
||
| provisioner "local-exec" { | ||
| when = "destroy" | ||
| command = "if [ ${var.create_snapshot} ]; then aws ec2 create-snapshot --volume-id ${aws_ebs_volume.volume.id} --region ${var.aws_region} --profile ${var.profile} ; fi;" |
Contributor
Author
There was a problem hiding this comment.
@andreagrandi this checks whether anything has been assigned to var.create_snapshot, and if there is any string then it executes the command. This still needs you to set ./databox.sh -c 1 down, it would be nice if the 1 was not required and you could simply pass ./databox.sh -c down, but I could not get this to work. Any thoughts?
Contributor
Author
|
@andreagrandi also propose we give this a tag of v0.1.0 (or similar) once this is merged. What do you think? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automatically create a snapshot of the mounted volume prior to destruction by setting the
-cflag to 1:./databox -c 1 downThis executes a "local-exec" provisioner and uses the aws command line to take a snapshot of the volume the moment before it is destroyed.
A json containing the snapshot id will be returned to console. This number should be recorded.