Skip to content

Commit

Permalink
resource/aws_opsworks_rds_db_instance: Remove deprecated (helper/sche…
Browse files Browse the repository at this point in the history
…ma.ResourceData).Partial() and (helper/schema.ResourceData).SetPartial() (hashicorp#12476)

Reference: hashicorp#12083
Reference: hashicorp#12087

Previously:

```
aws/resource_aws_opsworks_rds_db_instance.go:46:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_opsworks_rds_db_instance.go:48:2: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_opsworks_rds_db_instance.go:55:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_opsworks_rds_db_instance.go:60:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_opsworks_rds_db_instance.go:74:2: R007: deprecated (schema.ResourceData).Partial
```

Output from acceptance testing:

```
--- PASS: TestAccAWSOpsworksRdsDbInstance (971.17s)
```
  • Loading branch information
bflad authored and adamdecaf committed May 28, 2020
1 parent 51ebf95 commit 581b83c
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions aws/resource_aws_opsworks_rds_db_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,16 @@ func resourceAwsOpsworksRdsDbInstance() *schema.Resource {
func resourceAwsOpsworksRdsDbInstanceUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*AWSClient).opsworksconn

d.Partial(true)

d.SetPartial("rds_db_instance_arn")
req := &opsworks.UpdateRdsDbInstanceInput{
RdsDbInstanceArn: aws.String(d.Get("rds_db_instance_arn").(string)),
}

requestUpdate := false
if d.HasChange("db_user") {
d.SetPartial("db_user")
req.DbUser = aws.String(d.Get("db_user").(string))
requestUpdate = true
}
if d.HasChange("db_password") {
d.SetPartial("db_password")
req.DbPassword = aws.String(d.Get("db_password").(string))
requestUpdate = true
}
Expand All @@ -71,8 +66,6 @@ func resourceAwsOpsworksRdsDbInstanceUpdate(d *schema.ResourceData, meta interfa
}
}

d.Partial(false)

return resourceAwsOpsworksRdsDbInstanceRead(d, meta)
}

Expand Down

0 comments on commit 581b83c

Please sign in to comment.