From ce4deb98feb1e967353be9a932ab83034b2994e1 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 19 Mar 2020 04:43:23 -0400 Subject: [PATCH] resource/aws_globalaccelerator_accelerator: Remove deprecated (helper/schema.ResourceData).Partial() and (helper/schema.ResourceData).SetPartial() Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/12083 Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/12087 Previously: ``` aws/resource_aws_globalaccelerator_accelerator.go:265:2: R007: deprecated (schema.ResourceData).Partial aws/resource_aws_globalaccelerator_accelerator.go:285:3: R008: deprecated (schema.ResourceData).SetPartial aws/resource_aws_globalaccelerator_accelerator.go:286:3: R008: deprecated (schema.ResourceData).SetPartial aws/resource_aws_globalaccelerator_accelerator.go:287:3: R008: deprecated (schema.ResourceData).SetPartial aws/resource_aws_globalaccelerator_accelerator.go:304:3: R008: deprecated (schema.ResourceData).SetPartial aws/resource_aws_globalaccelerator_accelerator.go:314:3: R008: deprecated (schema.ResourceData).SetPartial aws/resource_aws_globalaccelerator_accelerator.go:317:2: R007: deprecated (schema.ResourceData).Partial ``` Output from acceptance testing: ``` --- PASS: TestAccAwsGlobalAcceleratorAccelerator_basic (55.91s) --- PASS: TestAccAwsGlobalAcceleratorAccelerator_update (84.82s) --- PASS: TestAccAwsGlobalAcceleratorAccelerator_tags (92.89s) --- PASS: TestAccAwsGlobalAcceleratorAccelerator_attributes (97.79s) ``` --- aws/resource_aws_globalaccelerator_accelerator.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/aws/resource_aws_globalaccelerator_accelerator.go b/aws/resource_aws_globalaccelerator_accelerator.go index 80907506078..8a0a96621ea 100644 --- a/aws/resource_aws_globalaccelerator_accelerator.go +++ b/aws/resource_aws_globalaccelerator_accelerator.go @@ -262,8 +262,6 @@ func resourceAwsGlobalAcceleratorAcceleratorRetrieve(conn *globalaccelerator.Glo func resourceAwsGlobalAcceleratorAcceleratorUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).globalacceleratorconn - d.Partial(true) - if d.HasChange("name") || d.HasChange("ip_address_type") || d.HasChange("enabled") { opts := &globalaccelerator.UpdateAcceleratorInput{ AcceleratorArn: aws.String(d.Id()), @@ -282,10 +280,6 @@ func resourceAwsGlobalAcceleratorAcceleratorUpdate(d *schema.ResourceData, meta return fmt.Errorf("Error updating Global Accelerator accelerator: %s", err) } - d.SetPartial("name") - d.SetPartial("ip_address_type") - d.SetPartial("enabled") - err = resourceAwsGlobalAcceleratorAcceleratorWaitForDeployedState(conn, d.Id()) if err != nil { return err @@ -298,10 +292,7 @@ func resourceAwsGlobalAcceleratorAcceleratorUpdate(d *schema.ResourceData, meta if err != nil { return err } - } - - d.SetPartial("attributes") } if d.HasChange("tags") { @@ -310,12 +301,8 @@ func resourceAwsGlobalAcceleratorAcceleratorUpdate(d *schema.ResourceData, meta if err := keyvaluetags.GlobalacceleratorUpdateTags(conn, d.Id(), o, n); err != nil { return fmt.Errorf("error updating Global Accelerator accelerator (%s) tags: %s", d.Id(), err) } - - d.SetPartial("tags") } - d.Partial(false) - return resourceAwsGlobalAcceleratorAcceleratorRead(d, meta) }