-
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
r/aws_lightsail_instance: Fix crash when encountering key-only tags #12346
Conversation
…Creating tags with an empty string as a value appears to correctly create these key-only tags.
@@ -1782,7 +1782,13 @@ func LightsailKeyValueTags(tags []*lightsail.Tag) KeyValueTags { | |||
m := make(map[string]*string, len(tags)) | |||
|
|||
for _, tag := range tags { | |||
m[aws.StringValue(tag.Key)] = tag.Value | |||
if tag.Value == nil { |
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.
@stefansundin Thanks for this.
This source file is actually generated and will be recreated if make gen
is run.
This behaviour may well be occurring for other AWS services (I will do some spot tests) so should be fixed globally.
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.
Ok. Updated. Let me know if I should make more changes.
@stefansundin I opened an issue to track this. Closes #12368. |
|
Verified acceptance test: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSLightsailInstance_Tags'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSLightsailInstance_Tags -timeout 120m
=== RUN TestAccAWSLightsailInstance_Tags
=== PAUSE TestAccAWSLightsailInstance_Tags
=== CONT TestAccAWSLightsailInstance_Tags
--- PASS: TestAccAWSLightsailInstance_Tags (70.07s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 70.117s |
Hi @stefansundin 👋 Thank you for reporting this and sorry you ran into trouble here. Rather than adjusting all of the generated service functions, we would prefer to fix the underlying If there are other services that are distinguishing between Can you adjust this pull request to just being the |
@bflad Do you want me to pull in master? Edit: Nevermind, I did. |
This reverts commit b4814ae.
…form-provider-aws into lightsail-key-only-tag
@stefansundin thanks so much! I was able to verify this updated test passes after #13868.
We should expect to see the fix land in the next week or so. |
This has been released in version 3.5.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
Fixes this crash:
Creating tags with an empty string as a value appears to correctly create these key-only tags.
Documentation:
Release note for CHANGELOG:
Output from acceptance testing: