Skip to content

Commit

Permalink
service/docdb: Remove deprecated (helper/schema.ResourceData).Partial…
Browse files Browse the repository at this point in the history
…() and (helper/schema.ResourceData).SetPartial() (hashicorp#12457)

Reference: hashicorp#12083
Reference: hashicorp#12087

Previously:

```
aws/resource_aws_docdb_cluster.go:620:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_docdb_cluster.go:626:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_docdb_cluster.go:672:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_docdb_cluster_instance.go:345:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_docdb_cluster_instance.go:351:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_docdb_cluster_instance.go:357:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_docdb_cluster_instance.go:363:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_docdb_cluster_instance.go:413:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_docdb_cluster_parameter_group.go:185:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_docdb_cluster_parameter_group.go:230:4: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_docdb_cluster_parameter_group.go:241:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_docdb_cluster_parameter_group.go:244:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_docdb_subnet_group.go:179:3: R008: deprecated (schema.ResourceData).SetPartial
```

Output from acceptance testing:

```
--- PASS: TestAccAWSDocDBCluster_backupsUpdate (260.19s)
--- PASS: TestAccAWSDocDBCluster_basic (130.28s)
--- PASS: TestAccAWSDocDBCluster_encrypted (203.87s)
--- PASS: TestAccAWSDocDBCluster_generatedName (130.17s)
--- PASS: TestAccAWSDocDBCluster_kmsKey (233.75s)
--- PASS: TestAccAWSDocDBCluster_missingUserNameCausesError (4.93s)
--- PASS: TestAccAWSDocDBCluster_namePrefix (129.97s)
--- PASS: TestAccAWSDocDBCluster_Port (369.93s)
--- PASS: TestAccAWSDocDBCluster_takeFinalSnapshot (252.47s)
--- PASS: TestAccAWSDocDBCluster_updateCloudwatchLogsExports (227.06s)
--- PASS: TestAccAWSDocDBCluster_updateTags (235.10s)

--- PASS: TestAccAWSDocDBClusterInstance_az (714.97s)
--- PASS: TestAccAWSDocDBClusterInstance_basic (1416.43s)
--- PASS: TestAccAWSDocDBClusterInstance_disappears (748.64s)
--- PASS: TestAccAWSDocDBClusterInstance_generatedName (753.18s)
--- PASS: TestAccAWSDocDBClusterInstance_kmsKey (821.87s)
--- PASS: TestAccAWSDocDBClusterInstance_namePrefix (764.04s)

--- PASS: TestAccAWSDocDBClusterParameterGroup_basic (43.89s)
--- PASS: TestAccAWSDocDBClusterParameterGroup_Description (31.42s)
--- PASS: TestAccAWSDocDBClusterParameterGroup_disappears (13.72s)
--- PASS: TestAccAWSDocDBClusterParameterGroup_generatedName (27.74s)
--- PASS: TestAccAWSDocDBClusterParameterGroup_namePrefix (48.18s)
--- PASS: TestAccAWSDocDBClusterParameterGroup_Parameter (50.36s)
--- PASS: TestAccAWSDocDBClusterParameterGroup_Tags (65.89s)

--- PASS: TestAccAWSDocDBSubnetGroup_basic (57.22s)
--- PASS: TestAccAWSDocDBSubnetGroup_disappears (31.33s)
--- PASS: TestAccAWSDocDBSubnetGroup_generatedName (44.49s)
--- PASS: TestAccAWSDocDBSubnetGroup_namePrefix (46.41s)
--- PASS: TestAccAWSDocDBSubnetGroup_updateDescription (67.20s)
```
  • Loading branch information
bflad authored and adamdecaf committed May 28, 2020
1 parent 37c090e commit 963593a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 17 deletions.
3 changes: 0 additions & 3 deletions aws/resource_aws_docdb_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -617,13 +617,11 @@ func resourceAwsDocDBClusterUpdate(d *schema.ResourceData, meta interface{}) err
}

if d.HasChange("db_cluster_parameter_group_name") {
d.SetPartial("db_cluster_parameter_group_name")
req.DBClusterParameterGroupName = aws.String(d.Get("db_cluster_parameter_group_name").(string))
requestUpdate = true
}

if d.HasChange("enabled_cloudwatch_logs_exports") {
d.SetPartial("enabled_cloudwatch_logs_exports")
req.CloudwatchLogsExportConfiguration = buildDocDBCloudwatchLogsExportConfiguration(d)
requestUpdate = true
}
Expand Down Expand Up @@ -669,7 +667,6 @@ func resourceAwsDocDBClusterUpdate(d *schema.ResourceData, meta interface{}) err
return fmt.Errorf("error updating DocumentDB Cluster (%s) tags: %s", d.Get("arn").(string), err)
}

d.SetPartial("tags")
}

return resourceAwsDocDBClusterRead(d, meta)
Expand Down
5 changes: 0 additions & 5 deletions aws/resource_aws_docdb_cluster_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,25 +342,21 @@ func resourceAwsDocDBClusterInstanceUpdate(d *schema.ResourceData, meta interfac
}

if d.HasChange("preferred_maintenance_window") {
d.SetPartial("preferred_maintenance_window")
req.PreferredMaintenanceWindow = aws.String(d.Get("preferred_maintenance_window").(string))
requestUpdate = true
}

if d.HasChange("auto_minor_version_upgrade") {
d.SetPartial("auto_minor_version_upgrade")
req.AutoMinorVersionUpgrade = aws.Bool(d.Get("auto_minor_version_upgrade").(bool))
requestUpdate = true
}

if d.HasChange("promotion_tier") {
d.SetPartial("promotion_tier")
req.PromotionTier = aws.Int64(int64(d.Get("promotion_tier").(int)))
requestUpdate = true
}

if d.HasChange("ca_cert_identifier") {
d.SetPartial("ca_cert_identifier")
req.CACertificateIdentifier = aws.String(d.Get("ca_cert_identifier").(string))
requestUpdate = true
}
Expand Down Expand Up @@ -410,7 +406,6 @@ func resourceAwsDocDBClusterInstanceUpdate(d *schema.ResourceData, meta interfac
return fmt.Errorf("error updating DocumentDB Cluster Instance (%s) tags: %s", d.Get("arn").(string), err)
}

d.SetPartial("tags")
}

return resourceAwsDocDBClusterInstanceRead(d, meta)
Expand Down
7 changes: 0 additions & 7 deletions aws/resource_aws_docdb_cluster_parameter_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ func resourceAwsDocDBClusterParameterGroupRead(d *schema.ResourceData, meta inte
func resourceAwsDocDBClusterParameterGroupUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).docdbconn

d.Partial(true)

if d.HasChange("parameter") {
o, n := d.GetChange("parameter")
if o == nil {
Expand Down Expand Up @@ -227,7 +225,6 @@ func resourceAwsDocDBClusterParameterGroupUpdate(d *schema.ResourceData, meta in
return fmt.Errorf("Error modifying DocDB Cluster Parameter Group: %s", err)
}
}
d.SetPartial("parameter")
}
}

Expand All @@ -237,12 +234,8 @@ func resourceAwsDocDBClusterParameterGroupUpdate(d *schema.ResourceData, meta in
if err := keyvaluetags.DocdbUpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
return fmt.Errorf("error updating DocumentDB Cluster Parameter Group (%s) tags: %s", d.Get("arn").(string), err)
}

d.SetPartial("tags")
}

d.Partial(false)

return resourceAwsDocDBClusterParameterGroupRead(d, meta)
}

Expand Down
2 changes: 0 additions & 2 deletions aws/resource_aws_docdb_subnet_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ func resourceAwsDocDBSubnetGroupUpdate(d *schema.ResourceData, meta interface{})
if err := keyvaluetags.DocdbUpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
return fmt.Errorf("error updating DocumentDB Subnet Group (%s) tags: %s", d.Get("arn").(string), err)
}

d.SetPartial("tags")
}

return resourceAwsDocDBSubnetGroupRead(d, meta)
Expand Down

0 comments on commit 963593a

Please sign in to comment.