Terraform took different time to delete route53 record resource

Viewed 19

We are beginners in terraform, We are working on terraform route53 module to manage records. One of the use cases is to change the simple record to a weighted record where when it will first try to delete the simple resource and then creates the resource with weighted. During this case, terraform took a different time to delete the simple record every time. If it is able to delete the record in less time then it will create the resource successfully otherwise it will throw an error

module.simple_route.aws_route53_record.this["test11.test.paytmpb.test.paytmpb.io. A"]: Destruction complete after 1m19s
╷
│ Error: [ERR]: Error building changeset: InvalidChangeBatch: [RRSet with DNS name test11.test.paytmpb.test.paytmpb.io., type A, SetIdentifier DC cannot be created as a non-weighted set exists with the same name and type.]
│     status code: 400,

So we need to handle this unusual use case of taking different times to delete the resource and creating again. Do we have any retry or any other technique in the terraform that we can use to manage this?

reference code : https://github.com/terraform-aws-modules/terraform-aws-route53

0 Answers
Related