-
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
fix: Fix crash during read due to key-only tags in aws_lightsail_instance #37587
fix: Fix crash during read due to key-only tags in aws_lightsail_instance #37587
Conversation
Community NoteVoting for Prioritization
For Submitters
|
dcb82b0
to
1697542
Compare
1697542
to
b6ca210
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.
LGTM 🚀
% TF_AWS_LIGHTSAIL_AVAILABILITY_ZONE=us-east-1a make testacc TESTARGS='-run=TestAccLightsailInstance_' PKG=lightsail
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 test ./internal/service/lightsail/... -v -count 1 -parallel 20 -run=TestAccLightsailInstance_ -timeout 360m
--- PASS: TestAccLightsailInstance_availabilityZone (3.02s)
--- PASS: TestAccLightsailInstance_disappears (47.23s)
--- PASS: TestAccLightsailInstance_basic (47.42s)
--- PASS: TestAccLightsailInstance_tags (60.22s)
--- PASS: TestAccLightsailInstance_keyOnlyTags (61.11s)
--- PASS: TestAccLightsailInstance_IPAddressType (66.20s)
--- PASS: TestAccLightsailInstance_name (133.61s)
--- PASS: TestAccLightsailInstance_addOn (239.02s)
PASS
ok [github.com/hashicorp/terraform-provider-aws/internal/service/lightsail](http://github.com/hashicorp/terraform-provider-aws/internal/service/lightsail) 244.274s
@acwwat thank you for the contribution! 🎉 |
This functionality has been released in v5.52.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. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Description
This PR is to fix a crash with the
aws_lightsail_instance
resource when it reads a Lightsail instance that has a key-only tag (i.e. it has no value). This issue also affects other operations such as import and update.Updated: Thanks to @johnsonaj's help, the issue mentioned below is now fixed.
It looks like somehow these key-only tags are not mapped to a
TagData
with a nil value, but rather nil itself. By adding a nil check in theResolveDuplicates
function the problem seems to be fixed however. However, the provider seems to be reading the instance before the tag updates when there is a key-only tag, so the state is always one update behind. I have having trouble figuring out why there's a difference in sequence at the moment.Relations
Closes #37470
Closes #35727
Closes #32430
References
n/a
Output from Acceptance Testing