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

r/aws_lightsail_instance: Fix crash when encountering key-only tags #12346

Merged
merged 7 commits into from
Sep 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion aws/internal/keyvaluetags/service_tags_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions aws/resource_aws_lightsail_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func TestAccAWSLightsailInstance_Tags(t *testing.T) {
resource.TestCheckResourceAttrSet("aws_lightsail_instance.lightsail_instance_test", "blueprint_id"),
resource.TestCheckResourceAttrSet("aws_lightsail_instance.lightsail_instance_test", "bundle_id"),
resource.TestCheckResourceAttrSet("aws_lightsail_instance.lightsail_instance_test", "key_pair_name"),
resource.TestCheckResourceAttr("aws_lightsail_instance.lightsail_instance_test", "tags.%", "1"),
resource.TestCheckResourceAttr("aws_lightsail_instance.lightsail_instance_test", "tags.%", "2"),
),
},
{
Expand All @@ -171,7 +171,7 @@ func TestAccAWSLightsailInstance_Tags(t *testing.T) {
resource.TestCheckResourceAttrSet("aws_lightsail_instance.lightsail_instance_test", "blueprint_id"),
resource.TestCheckResourceAttrSet("aws_lightsail_instance.lightsail_instance_test", "bundle_id"),
resource.TestCheckResourceAttrSet("aws_lightsail_instance.lightsail_instance_test", "key_pair_name"),
resource.TestCheckResourceAttr("aws_lightsail_instance.lightsail_instance_test", "tags.%", "2"),
resource.TestCheckResourceAttr("aws_lightsail_instance.lightsail_instance_test", "tags.%", "3"),
),
},
},
Expand Down Expand Up @@ -320,6 +320,7 @@ resource "aws_lightsail_instance" "lightsail_instance_test" {
bundle_id = "nano_1_0"
tags = {
Name = "tf-test"
KeyOnlyTag = ""
}
}
`, lightsailName)
Expand All @@ -338,6 +339,7 @@ resource "aws_lightsail_instance" "lightsail_instance_test" {
bundle_id = "nano_1_0"
tags = {
Name = "tf-test",
KeyOnlyTag = ""
ExtraName = "tf-test"
}
}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/lightsail_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ instance (see list below)
* `key_pair_name` - (Optional) The name of your key pair. Created in the
Lightsail console (cannot use `aws_key_pair` at this time)
* `user_data` - (Optional) launch script to configure server with additional user data
* `tags` - (Optional) A mapping of tags to assign to the resource.
* `tags` - (Optional) A mapping of tags to assign to the resource. To create key-only tags, use an empty string as a value.

## Availability Zones
Lightsail currently supports the following Availability Zones (e.g. `us-east-1a`):
Expand Down