Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some alternative.. #5

Open
cravendy opened this issue Jun 3, 2018 · 4 comments
Open

some alternative.. #5

cravendy opened this issue Jun 3, 2018 · 4 comments

Comments

@cravendy
Copy link

cravendy commented Jun 3, 2018

https://github.com/aws-samples/aws-step-functions-ebs-snapshot-mgmt/blob/master/TagSnapshots.js

Line 64
Name: "tag-key"

The alternative syntax can be changed to Name: "tag:key". Then, users can tag their volumes with 'key' and desire value if they would like to specify what volumes should be applied for the solution

Volume tag example:

tag KEY tag VALUE
key [whatever defined in Lambda function or specified when deployed via the CFN]

Then, we can change the value of the tag value to another value to turn off backup copy to DR region. The originally way need to rename the tag key or remove the tag completely in order to turn off.

@chriszrc
Copy link

chriszrc commented Jul 19, 2018

Seems like it's actually setup just fine, the docs here:

https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/EC2.html#describeVolumes-property

Indicate that the "tag-key" filter just looks for a tag with the supplied name, so for a specific volume, you can set "tagKeyValue" to something like "Backup_Enabled" and create a tag with the name "Backup_Enabled" on the volume, and give it whatever value you want (perhaps "true") and it will all work-

@cravendy
Copy link
Author

cravendy commented Jul 19, 2018

Hello chriszrc, thanks for the reply.

You are correct. Sorry for misunderstanding for the creator's meaning. Author is only to looking for the tag key and not care about the tag value.

However, if line 64 changed to Name: "tag:key" can also be used to specify what key and value to search for.

For example:
tag key: key
tag value: StepFunctionTarget

This will have StepFunction to look for tag key="key" and tag value="StepFunctionTarget" which is also working. Sounds stupid, but, however, it can be configured further at line 64 to "tag:BackupEnabled". Then the effect will be like:

tag key: BackupEnabled
tag value: true (assigned when deploying then cloudformation stack)

Then, we can change the value of the tag anytime to false(as long as it's not true) to turn off backup copy to DR region. The originally way need to rename the tag key or remove the tag completely in order to turn off. Does my thought make sense? maybe a little? lol...

Anyway, my thoughts may cause confusion to people who is watching this. To anyone whom may read the message, please stay to the author's method if you did not understand about the effect between 'tag-key' and 'tag:key'. I don't intend to cause confusion, sorry.

@chriszrc
Copy link

chriszrc commented Jul 19, 2018

Hi, yes that makes sense, it's true that your approach would allow you to turn off the snapshotting based on the value of the key, rather than having to change the key name or delete the key entirely.

But for someone just starting with this repo, and who isn't familiar with the nuances of the different filters, there's no need to ask them to change the source code, since the example will work fine-

@cravendy cravendy changed the title Code needs to be updated.... some alternative.. Jul 19, 2018
@cravendy
Copy link
Author

yes, you're correct. Therefore, I change the title to "some alternative" just for reference. Thank you for reminding.

cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants