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

r/aws_route53_record: Ignore InvalidChangeBatch errors on Delete #37850

Merged
merged 3 commits into from
Jun 6, 2024

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Jun 5, 2024

Description

Restore pre-AWS SDK for Go v2 migration behavior.

// Change batch for deleting
changeBatch := &route53.ChangeBatch{
Comment: aws.String("Deleted by Terraform"),
Changes: []*route53.Change{
{
Action: aws.String(route53.ChangeActionDelete),
ResourceRecordSet: rec,
},
},
}
input := &route53.ChangeResourceRecordSetsInput{
ChangeBatch: changeBatch,
HostedZoneId: aws.String(zoneID),
}
respRaw, err := DeleteRecordSet(ctx, conn, input)
if err != nil {
return sdkdiag.AppendErrorf(diags, "deleting Route 53 Record (%s): %s", d.Id(), err)
}
changeInfo := respRaw.(*route53.ChangeResourceRecordSetsOutput).ChangeInfo
if changeInfo == nil {
log.Printf("[INFO] No ChangeInfo Found. Waiting for Sync not required")
return diags
}

func DeleteRecordSet(ctx context.Context, conn *route53.Route53, input *route53.ChangeResourceRecordSetsInput) (interface{}, error) {
out, err := conn.ChangeResourceRecordSetsWithContext(ctx, input)
if tfawserr.ErrCodeEquals(err, route53.ErrCodeInvalidChangeBatch) {
return out, nil
}
return out, err
}

Relations

Closes #37806.
Relates #37510.

Output from Acceptance Testing

% make testacc TESTARGS='-run=TestAccRoute53Record_disappears\|TestAccRoute53Record_Disappears_multipleRecords\|TestAccRoute53Record_basic' PKG=route53        
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 test ./internal/service/route53/... -v -count 1 -parallel 20  -run=TestAccRoute53Record_disappears\|TestAccRoute53Record_Disappears_multipleRecords\|TestAccRoute53Record_basic -timeout 360m
=== RUN   TestAccRoute53Record_basic
=== PAUSE TestAccRoute53Record_basic
=== RUN   TestAccRoute53Record_disappears
=== PAUSE TestAccRoute53Record_disappears
=== RUN   TestAccRoute53Record_Disappears_multipleRecords
=== PAUSE TestAccRoute53Record_Disappears_multipleRecords
=== CONT  TestAccRoute53Record_basic
=== CONT  TestAccRoute53Record_Disappears_multipleRecords
=== CONT  TestAccRoute53Record_disappears
--- PASS: TestAccRoute53Record_disappears (187.60s)
--- PASS: TestAccRoute53Record_basic (203.94s)
--- PASS: TestAccRoute53Record_Disappears_multipleRecords (277.59s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/route53	281.939s

Copy link

github-actions bot commented Jun 5, 2024

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added the service/route53 Issues and PRs that pertain to the route53 service. label Jun 5, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jun 5, 2024
@github-actions github-actions bot added the size/XS Managed by automation to categorize the size of a PR. label Jun 5, 2024
@ewbankkit ewbankkit added the bug Addresses a defect in current functionality. label Jun 5, 2024
@ewbankkit ewbankkit merged commit 5f44370 into main Jun 6, 2024
81 checks passed
@ewbankkit ewbankkit deleted the b-aws_route53_record-InvalidChangeBatch-on-delete branch June 6, 2024 12:27
@github-actions github-actions bot added this to the v5.53.0 milestone Jun 6, 2024
github-actions bot pushed a commit that referenced this pull request Jun 6, 2024
Copy link

github-actions bot commented Jun 7, 2024

This functionality has been released in v5.53.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jun 7, 2024
Copy link

github-actions bot commented Jul 8, 2024

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/route53 Issues and PRs that pertain to the route53 service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
1 participant