-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Introduce the aws_ec2_tag resource for managing individual tags on EC2 resources #8457
Conversation
Merged in the latest from |
Meek rt tags
… tags if the tag is not yet there
fixing retry logic - DescribeTags returns no err and an empty list of…
Recent updates:
|
FYI, relating to your original problem with tags, you may find the recently released provider-level |
Co-authored-by: Brian Flad <[email protected]>
Co-authored-by: Brian Flad <[email protected]>
Co-authored-by: Brian Flad <[email protected]>
Co-authored-by: Brian Flad <[email protected]>
@bflad it's a great new config option for sure. We still have a need to be able to tag things separately like this and have been running this patch in production for a while now. I'm working with my team to get this PR cleaned up for merge. 👍 |
@bflad I believe the changes I pushed up this morning should cover all of the changes you requested in your comment. the provider level |
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.
Thank you so much 🚀 Going to pull this in with a few minor enhancements such as import and in-place value
update support.
Reference: #8457 Changes: * Use keyvaluetags package where possible * Support import and in-place update of value * Add yellow callout boxes in documentation to disuade usage with parent resources and note lack of ignore_tags usage * Update examples and testing for real-world implementation of EC2 Transit Gateway VPN Attachment tagging Output from acceptance testing: ``` --- PASS: TestAccAWSEc2Tag_Value (489.14s) --- PASS: TestAccAWSEc2Tag_disappears (534.08s) --- PASS: TestAccAWSEc2Tag_basic (538.95s) ```
@joestump, thanks a bunch for taking your time and getting this in! Really great work 💪 |
This has been released in version 2.67.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Adds support for tagging EC2 resources that may or may not be directly managed by Terraform. My team's primary use case is attaching tags to subnets/VPCs that are managed by other teams for EKS. See the docs on VPC and subnet tagging in EKS for more details.
NOTE: This also modifies how
aws_subnet
andaws_vpc
manage thetags
attribute. Basically, iftags
isn't set or hasn't changed, then it's a noop. Otherwise, we end up with tags getting blown away by these resources even when they don't define atags
attribute.Example
Tests