Skip to content

Commit

Permalink
service/route53resolver: Remove deprecated (helper/schema.ResourceDat…
Browse files Browse the repository at this point in the history
…a).Partial() and (helper/schema.ResourceData).SetPartial() (#12460)

Reference: #12083
Reference: #12087

Previously:

```
aws/resource_aws_route53_resolver_endpoint.go:199:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_route53_resolver_endpoint.go:219:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_route53_resolver_endpoint.go:264:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_route53_resolver_endpoint.go:272:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_route53_resolver_endpoint.go:275:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_route53_resolver_rule.go:191:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_route53_resolver_rule.go:220:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_route53_resolver_rule.go:221:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_route53_resolver_rule.go:222:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_route53_resolver_rule.go:230:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_route53_resolver_rule.go:233:2: R007: deprecated (schema.ResourceData).Partial
```

Output from acceptance testing:

```
--- PASS: TestAccAwsRoute53ResolverEndpoint_basicInbound (102.08s)
--- PASS: TestAccAwsRoute53ResolverEndpoint_updateOutbound (446.81s)
--- PASS: TestAccAwsRoute53ResolverRule_basic (39.84s)
--- PASS: TestAccAwsRoute53ResolverRule_forward (316.33s)
--- PASS: TestAccAwsRoute53ResolverRule_forwardEndpointRecreate (448.03s)
--- PASS: TestAccAwsRoute53ResolverRule_tags (66.35s)
--- PASS: TestAccAwsRoute53ResolverRule_updateName (62.64s)
```
  • Loading branch information
bflad authored Apr 1, 2020
1 parent c467831 commit 21f1ff5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
7 changes: 0 additions & 7 deletions aws/resource_aws_route53_resolver_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ func resourceAwsRoute53ResolverEndpointRead(d *schema.ResourceData, meta interfa
func resourceAwsRoute53ResolverEndpointUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).route53resolverconn

d.Partial(true)
if d.HasChange("name") {
req := &route53resolver.UpdateResolverEndpointInput{
ResolverEndpointId: aws.String(d.Id()),
Expand All @@ -215,8 +214,6 @@ func resourceAwsRoute53ResolverEndpointUpdate(d *schema.ResourceData, meta inter
if err != nil {
return err
}

d.SetPartial("name")
}

if d.HasChange("ip_address") {
Expand Down Expand Up @@ -260,19 +257,15 @@ func resourceAwsRoute53ResolverEndpointUpdate(d *schema.ResourceData, meta inter
return err
}
}

d.SetPartial("ip_address")
}

if d.HasChange("tags") {
o, n := d.GetChange("tags")
if err := keyvaluetags.Route53resolverUpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
return fmt.Errorf("error updating Route53 Resolver endpoint (%s) tags: %s", d.Get("arn").(string), err)
}
d.SetPartial("tags")
}

d.Partial(false)
return resourceAwsRoute53ResolverEndpointRead(d, meta)
}

Expand Down
7 changes: 0 additions & 7 deletions aws/resource_aws_route53_resolver_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ func resourceAwsRoute53ResolverRuleRead(d *schema.ResourceData, meta interface{}
func resourceAwsRoute53ResolverRuleUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).route53resolverconn

d.Partial(true)
if d.HasChange("name") || d.HasChange("resolver_endpoint_id") || d.HasChange("target_ip") {
req := &route53resolver.UpdateResolverRuleInput{
ResolverRuleId: aws.String(d.Id()),
Expand Down Expand Up @@ -216,21 +215,15 @@ func resourceAwsRoute53ResolverRuleUpdate(d *schema.ResourceData, meta interface
if err != nil {
return err
}

d.SetPartial("name")
d.SetPartial("resolver_endpoint_id")
d.SetPartial("target_ip")
}

if d.HasChange("tags") {
o, n := d.GetChange("tags")
if err := keyvaluetags.Route53resolverUpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
return fmt.Errorf("error updating Route53 Resolver rule (%s) tags: %s", d.Get("arn").(string), err)
}
d.SetPartial("tags")
}

d.Partial(false)
return resourceAwsRoute53ResolverRuleRead(d, meta)
}

Expand Down

0 comments on commit 21f1ff5

Please sign in to comment.