From 1e8e9fdd9747b3e68ec19fd71f6c84c05a452ca0 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 19 Mar 2020 04:41:14 -0400 Subject: [PATCH] resource/aws_elasticache_parameter_group: 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_elasticache_parameter_group.go:136:2: R007: deprecated (schema.ResourceData).Partial aws/resource_aws_elasticache_parameter_group.go:310:3: R008: deprecated (schema.ResourceData).SetPartial aws/resource_aws_elasticache_parameter_group.go:313:2: R007: deprecated (schema.ResourceData).Partial aws/resource_aws_elasticache_parameter_group.go:84:2: R007: deprecated (schema.ResourceData).Partial aws/resource_aws_elasticache_parameter_group.go:85:2: R008: deprecated (schema.ResourceData).SetPartial aws/resource_aws_elasticache_parameter_group.go:86:2: R008: deprecated (schema.ResourceData).SetPartial aws/resource_aws_elasticache_parameter_group.go:87:2: R008: deprecated (schema.ResourceData).SetPartial aws/resource_aws_elasticache_parameter_group.go:88:2: R007: deprecated (schema.ResourceData).Partial ``` Output from acceptance testing: ``` --- PASS: TestAccAWSElasticacheParameterGroup_Description (23.39s) --- PASS: TestAccAWSElasticacheParameterGroup_basic (25.25s) --- PASS: TestAccAWSElasticacheParameterGroup_UppercaseName (25.32s) --- PASS: TestAccAWSElasticacheParameterGroup_removeReservedMemoryParameter (42.06s) --- PASS: TestAccAWSElasticacheParameterGroup_removeAllParameters (44.50s) --- PASS: TestAccAWSElasticacheParameterGroup_addParameter (44.70s) --- PASS: TestAccAWSElasticacheParameterGroup_updateReservedMemoryParameter (90.73s) --- PASS: TestAccAWSElasticacheParameterGroup_switchReservedMemoryParameter (91.11s) ``` --- aws/resource_aws_elasticache_parameter_group.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/aws/resource_aws_elasticache_parameter_group.go b/aws/resource_aws_elasticache_parameter_group.go index 5da7b75a078..eb288ef498f 100644 --- a/aws/resource_aws_elasticache_parameter_group.go +++ b/aws/resource_aws_elasticache_parameter_group.go @@ -81,12 +81,6 @@ func resourceAwsElasticacheParameterGroupCreate(d *schema.ResourceData, meta int return fmt.Errorf("Error creating Cache Parameter Group: %s", err) } - d.Partial(true) - d.SetPartial("name") - d.SetPartial("family") - d.SetPartial("description") - d.Partial(false) - d.SetId(*resp.CacheParameterGroup.CacheParameterGroupName) log.Printf("[INFO] Cache Parameter Group ID: %s", d.Id()) @@ -133,8 +127,6 @@ func resourceAwsElasticacheParameterGroupRead(d *schema.ResourceData, meta inter func resourceAwsElasticacheParameterGroupUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).elasticacheconn - d.Partial(true) - if d.HasChange("parameter") { o, n := d.GetChange("parameter") if o == nil { @@ -306,12 +298,8 @@ func resourceAwsElasticacheParameterGroupUpdate(d *schema.ResourceData, meta int return fmt.Errorf("Error modifying Cache Parameter Group: %s", err) } } - - d.SetPartial("parameter") } - d.Partial(false) - return resourceAwsElasticacheParameterGroupRead(d, meta) }