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
Add replace field to copy-instance-tags #7888
base: main
Are you sure you want to change the base?
Conversation
|
5f2c88f
to
2021e23
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks reasonable to me, and using replace
feels like a good choice over skip
to avoid potential confusion with the skip-missing
option from copy-related-tag
. Thanks for the contribution, and for making it backward-compatible too 👍
We'll want to make sure checks clear, and add a test for this new behavior before merging.
|
@ajkerrigan 2 Tests have been added to test this behaviour |
Implemented
replace
field incopy-instance-tags
action as an enhancement. Closes #7544Description
The action
copy-instance-tags
copies all the tags mentioned in the policy from an ec2 instance to its ebs volume. If a tag already exists in the ebs volume, it gets replaced. The fieldreplace
is introduced to give users more control over this. If its value is false, the policy skips copying existing tags in the ebs volume.Usage
If the user does not mention this field in the policy, then its default value is set to
true
, making it abackward-compatible
feature.replace : false
: skips the tags that already exist in the ebs volume.replace : true
: replaces the ebs tags with the ec2 tags.Example
EC2 tags
Lets use this EC2 instance with the given tags and their values for the following examples.
Example Policy with
replace: false
Before running the policy
EBS tags
After running the policy
EBS tags
*Notice that the tags
Name
andTechnical:ApplicationName
have not been replaced.Example Policy without
replace
Before running the policy
EBS tags
After running the policy
EBS tags
*Notice that the tags
Name
andTechnical:ApplicationName
have been replaced.