Skip to content

Commit

Permalink
resource/aws_elasticache_parameter_group: Remove deprecated (helper/s…
Browse files Browse the repository at this point in the history
…chema.ResourceData).Partial() and (helper/schema.ResourceData).SetPartial() (hashicorp#12471)

Reference: hashicorp#12083
Reference: hashicorp#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)
```
  • Loading branch information
bflad authored and adamdecaf committed May 28, 2020
1 parent 452610d commit c5e3a0b
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions aws/resource_aws_elasticache_parameter_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit c5e3a0b

Please sign in to comment.