Skip to content

Commit

Permalink
build(deps): bump github.com/aws/aws-sdk-go from 1.36.19 to 1.36.28 (#…
Browse files Browse the repository at this point in the history
…17155)

* build(deps): bump github.com/aws/aws-sdk-go from 1.36.19 to 1.36.28

Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.36.19 to 1.36.28.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md)
- [Commits](aws/aws-sdk-go@v1.36.19...v1.36.28)

Signed-off-by: dependabot[bot] <support@github.com>

* resource/aws_lightsail_instance: Deprecate ipv6_address attribute and add ipv6_addresses attribute

Reference: https://github.com/aws/aws-sdk-go/pull/3735/files?file-filters%5B%5D=.json#diff-5a6179b4e5f5d9255890a587d6df77227a75e539120b585f57091b3be60a138cL5246-R5268

AWS Go SDK version 1.36.25 introduced a breaking API model change by removing a string `Ipv6Addess` field and replacing it with a list `Ipv6Addresses` field. This offers a best effort replacement for the expected value of the existing attribute by taking the first element of the new list field, while marking it deprecated to nudge practitioners to use the list instead.

Output from acceptance testing:

```
--- PASS: TestAccAWSLightsailInstance_disapear (50.09s)
--- PASS: TestAccAWSLightsailInstance_basic (51.05s)
--- PASS: TestAccAWSLightsailInstance_Tags (76.09s)
--- PASS: TestAccAWSLightsailInstance_Name (122.35s)
```

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Brian Flad <bflad417@gmail.com>
  • Loading branch information
dependabot[bot] and bflad authored Jan 19, 2021
1 parent cfa4114 commit ad52710
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
16 changes: 14 additions & 2 deletions aws/resource_aws_lightsail_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,14 @@ func resourceAwsLightsailInstance() *schema.Resource {
Computed: true,
},
"ipv6_address": {
Type: schema.TypeString,
Type: schema.TypeString,
Computed: true,
Deprecated: "use `ipv6_addresses` attribute instead",
},
"ipv6_addresses": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
"is_static_ip": {
Type: schema.TypeBool,
Expand Down Expand Up @@ -209,7 +215,13 @@ func resourceAwsLightsailInstanceRead(d *schema.ResourceData, meta interface{})
d.Set("created_at", i.CreatedAt.Format(time.RFC3339))
d.Set("cpu_count", i.Hardware.CpuCount)
d.Set("ram_size", i.Hardware.RamSizeInGb)
d.Set("ipv6_address", i.Ipv6Address)

// Deprecated: AWS Go SDK v1.36.25 removed Ipv6Address field
if len(i.Ipv6Addresses) > 0 {
d.Set("ipv6_address", aws.StringValue(i.Ipv6Addresses[0]))
}

d.Set("ipv6_addresses", aws.StringValueSlice(i.Ipv6Addresses))
d.Set("is_static_ip", i.IsStaticIp)
d.Set("private_ip_address", i.PrivateIpAddress)
d.Set("public_ip_address", i.PublicIpAddress)
Expand Down
2 changes: 2 additions & 0 deletions aws/resource_aws_lightsail_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ func TestAccAWSLightsailInstance_basic(t *testing.T) {
resource.TestCheckResourceAttrSet("aws_lightsail_instance.lightsail_instance_test", "availability_zone"),
resource.TestCheckResourceAttrSet("aws_lightsail_instance.lightsail_instance_test", "blueprint_id"),
resource.TestCheckResourceAttrSet("aws_lightsail_instance.lightsail_instance_test", "bundle_id"),
resource.TestMatchResourceAttr("aws_lightsail_instance.lightsail_instance_test", "ipv6_address", regexp.MustCompile(`([a-f0-9]{1,4}:){7}[a-f0-9]{1,4}`)),
resource.TestCheckResourceAttr("aws_lightsail_instance.lightsail_instance_test", "ipv6_addresses.#", "1"),
resource.TestCheckResourceAttrSet("aws_lightsail_instance.lightsail_instance_test", "key_pair_name"),
resource.TestCheckResourceAttr("aws_lightsail_instance.lightsail_instance_test", "tags.%", "0"),
resource.TestMatchResourceAttr("aws_lightsail_instance.lightsail_instance_test", "ram_size", regexp.MustCompile(`\d+(.\d+)?`)),
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/terraform-providers/terraform-provider-aws
go 1.15

require (
github.com/aws/aws-sdk-go v1.36.19
github.com/aws/aws-sdk-go v1.36.28
github.com/beevik/etree v1.1.0
github.com/fatih/color v1.9.0 // indirect
github.com/hashicorp/aws-sdk-go-base v0.7.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY
github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM=
github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.31.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go v1.36.19 h1:zbJZKkxeDiYxUYFjymjWxPye+qa1G2gRVyhIzZrB9zA=
github.com/aws/aws-sdk-go v1.36.19/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
github.com/aws/aws-sdk-go v1.36.28 h1:JVRN7BZgwQ31SQCBwG5QM445+ynJU0ruKu+miFIijYY=
github.com/aws/aws-sdk-go v1.36.28/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs=
github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A=
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas=
Expand Down
7 changes: 2 additions & 5 deletions website/docs/r/lightsail_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,8 @@ In addition to all arguments above, the following attributes are exported:
* `id` - The ARN of the Lightsail instance (matches `arn`).
* `arn` - The ARN of the Lightsail instance (matches `id`).
* `created_at` - The timestamp when the instance was created.
* `availability_zone`
* `blueprint_id`
* `bundle_id`
* `key_pair_name`
* `user_data`
* `ipv6_address` - (**Deprecated**) The first IPv6 address of the Lightsail instance. Use `ipv6_addresses` attribute instead.
* `ipv6_addresses` - List of IPv6 addresses for the Lightsail instance.

## Import

Expand Down

0 comments on commit ad52710

Please sign in to comment.