Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Route53 recordset delete Error - values provided do not match the current values

I am trying to delete a failover alias recordset with the following command:

aws route53 change-resource-record-sets \
    --hosted-zone-id <my-zone-id> \
    --change-batch file://file.json

Contents of json:

{
  "Comment": "test-rdc",
  "Changes": [
  {
    "Action": "DELETE",
    "ResourceRecordSet": {
      "Name": "abc.aws-ab-xyz.abcd.com",
      "Type": "A",
      "SetIdentifier": "abc-Secondary",
      "Failover": "SECONDARY" ,
      "AliasTarget": {
        "HostedZoneId": "jashkhakh",
        "DNSName": "hhhkjhkh",
        "EvaluateTargetHealth": false 
      },
      "HealthCheckId": "hhjhkh" 
    }
  }]
}

Error: Tried to delete resource record set [name='abc.aws-ab-xyz.abcd.com.', type='A', set-identifier='abc-Secondary', health check='hhjhkh'] but the values provided do not match the current values

I have verified the entries are correct in my json file.

like image 381
pinocchio Avatar asked Oct 17 '22 21:10

pinocchio


2 Answers

Specify also the TTL.

I had the same problem in a Cloudformation change, and the problem was difference between TTLs.

https://github.com/ansible/ansible-modules-core/issues/551#issuecomment-70481068

like image 141
jgomo3 Avatar answered Oct 21 '22 09:10

jgomo3


I was able to figure this one out myself. I was missing dualstack prefix form the ELB name in my json file. Looks like it expects the ELB name to be exactly same as what is there in the R53 console. Change from :

"DNSName": "hhhkjhkh"

to

"DNSName": "dualstack.hhhkjhkh"
like image 25
pinocchio Avatar answered Oct 21 '22 09:10

pinocchio