Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service/neptune: Remove deprecated (helper/schema.ResourceData).Partial() and (helper/schema.ResourceData).SetPartial() #12458

Merged
merged 1 commit into from
Apr 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions aws/resource_aws_neptune_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,6 @@ func resourceAwsNeptuneClusterUpdate(d *schema.ResourceData, meta interface{}) e
}

if d.HasChange("neptune_cluster_parameter_group_name") {
d.SetPartial("neptune_cluster_parameter_group_name")
req.DBClusterParameterGroupName = aws.String(d.Get("neptune_cluster_parameter_group_name").(string))
requestUpdate = true
}
Expand Down Expand Up @@ -681,7 +680,6 @@ func resourceAwsNeptuneClusterUpdate(d *schema.ResourceData, meta interface{}) e
return fmt.Errorf("error updating Neptune Cluster (%s) tags: %s", d.Get("arn").(string), err)
}

d.SetPartial("tags")
}

return resourceAwsNeptuneClusterRead(d, meta)
Expand Down
6 changes: 0 additions & 6 deletions aws/resource_aws_neptune_cluster_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,25 +381,21 @@ func resourceAwsNeptuneClusterInstanceUpdate(d *schema.ResourceData, meta interf
}

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

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
}
Expand Down Expand Up @@ -447,8 +443,6 @@ func resourceAwsNeptuneClusterInstanceUpdate(d *schema.ResourceData, meta interf
if err := keyvaluetags.NeptuneUpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
return fmt.Errorf("error updating Neptune Cluster Instance (%s) tags: %s", d.Get("arn").(string), err)
}

d.SetPartial("tags")
}

return resourceAwsNeptuneClusterInstanceRead(d, meta)
Expand Down
7 changes: 0 additions & 7 deletions aws/resource_aws_neptune_cluster_parameter_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ func resourceAwsNeptuneClusterParameterGroupRead(d *schema.ResourceData, meta in
func resourceAwsNeptuneClusterParameterGroupUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).neptuneconn

d.Partial(true)

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

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

d.SetPartial("tags")
}

d.Partial(false)

return resourceAwsNeptuneClusterParameterGroupRead(d, meta)
}

Expand Down
10 changes: 0 additions & 10 deletions aws/resource_aws_neptune_event_subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ func resourceAwsNeptuneEventSubscriptionRead(d *schema.ResourceData, meta interf
func resourceAwsNeptuneEventSubscriptionUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).neptuneconn

d.Partial(true)
requestUpdate := false

req := &neptune.ModifyEventSubscriptionInput{
Expand Down Expand Up @@ -262,10 +261,6 @@ func resourceAwsNeptuneEventSubscriptionUpdate(d *schema.ResourceData, meta inte
if err != nil {
return err
}
d.SetPartial("event_categories")
d.SetPartial("enabled")
d.SetPartial("sns_topic_arn")
d.SetPartial("source_type")
}

if d.HasChange("tags") {
Expand All @@ -274,8 +269,6 @@ func resourceAwsNeptuneEventSubscriptionUpdate(d *schema.ResourceData, meta inte
if err := keyvaluetags.NeptuneUpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
return fmt.Errorf("error updating Neptune Cluster Event Subscription (%s) tags: %s", d.Get("arn").(string), err)
}

d.SetPartial("tags")
}

if d.HasChange("source_ids") {
Expand Down Expand Up @@ -317,11 +310,8 @@ func resourceAwsNeptuneEventSubscriptionUpdate(d *schema.ResourceData, meta inte
}
}
}
d.SetPartial("source_ids")
}

d.Partial(false)

return resourceAwsNeptuneEventSubscriptionRead(d, meta)
}

Expand Down
14 changes: 0 additions & 14 deletions aws/resource_aws_neptune_parameter_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,6 @@ func resourceAwsNeptuneParameterGroupCreate(d *schema.ResourceData, meta interfa
return fmt.Errorf("Error creating Neptune Parameter Group: %s", err)
}

d.Partial(true)
d.SetPartial("name")
d.SetPartial("family")
d.SetPartial("description")
d.Partial(false)

d.SetId(*resp.DBParameterGroup.DBParameterGroupName)
d.Set("arn", resp.DBParameterGroup.DBParameterGroupArn)
log.Printf("[INFO] Neptune Parameter Group ID: %s", d.Id())
Expand Down Expand Up @@ -178,8 +172,6 @@ func resourceAwsNeptuneParameterGroupRead(d *schema.ResourceData, meta interface
func resourceAwsNeptuneParameterGroupUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).neptuneconn

d.Partial(true)

if d.HasChange("parameter") {
o, n := d.GetChange("parameter")
if o == nil {
Expand Down Expand Up @@ -255,8 +247,6 @@ func resourceAwsNeptuneParameterGroupUpdate(d *schema.ResourceData, meta interfa
return fmt.Errorf("Error modifying Neptune Parameter Group: %s", err)
}
}

d.SetPartial("parameter")
}

if !d.IsNewResource() && d.HasChange("tags") {
Expand All @@ -265,12 +255,8 @@ func resourceAwsNeptuneParameterGroupUpdate(d *schema.ResourceData, meta interfa
if err := keyvaluetags.NeptuneUpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
return fmt.Errorf("error updating Neptune Parameter Group (%s) tags: %s", d.Get("arn").(string), err)
}

d.SetPartial("tags")
}

d.Partial(false)

return resourceAwsNeptuneParameterGroupRead(d, meta)
}

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

d.SetPartial("tags")
}

return resourceAwsNeptuneSubnetGroupRead(d, meta)
Expand Down