0

I am getting below error while creating TXT record in Route53 using AWS CLI. Please let me know where I am doing mistake.

Error:

[Invalid Resource Record: 'FATAL problem: InvalidCharacterString (Value should be enclosed in quotation marks) encountered with '376ae6f4-8cf5-4d91-9246-fd3d6069ebf8'']

Code:

{
        "Comment": "Create a recored",
        "Changes": [{
        "Action": "CREATE",
                "ResourceRecordSet":{
                        "Name": "profpoint-verification",
                        "Type": "TXT",
                        "TTL": 300,
                        "ResourceRecords": [{"Value":"3766f4-8cf5-4d91-9246-fd3d699ebf8"}]
                }
        }]
}

I referred to Create a simple resource record set in Amazon Route 53 using the AWS CLI to create the above code.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470

1 Answers1

0

I was able to resolve this problem by adding escape quotation marks:

{
    "Comment": "proofpoint-verification",
    "Changes": [{
        "Action": "CREATE",
        "ResourceRecordSet": {
            "Name": "proofpoint-verification.mydomain",
            "Type": "TXT",
            "TTL": 300,
            "ResourceRecords": [{
                "Value": "\"3766f4-8cf5-4d91-9246-fd3d699ebf8\""
            }]
        }
    }]
}

Here is a detailed explanation

Alex Chadyuk
  • 1,421
  • 2
  • 10
  • I want to add same record with multiple zone. can you suggest any script? – Ratkal-Guru Feb 23 '23 at 12:36
  • Glad that it worked! It would be better to create a separate question about cycling through the bash script commands, because that would be definitely outside of scope of your original question. Could you please upvote this response and close it as a resolution to this question and create a new question (with the reference to this one if you want to mention the json file). – Alex Chadyuk Feb 23 '23 at 14:43