Igor L.
Igor L.

Reputation: 3485

Creating a route53 record set via aws cli

I am connecting to an ec2 instance via AWS SSM session manager.

From within this instance I am attempting to create a record set for our domain (to finalise the verification of the domain for AWS Simple Email Service).

AWS CLI command:

[root@ip-XX-XXX-XX-XXX igor]# aws route53 change-resource-record-sets --hosted-zone-id <HOSTED_ZONE_ID> --change-batch ./record-set.json

JSON file:

{
  "Comment": "Add SES record set for this domain",
  "Changes": [
    {
      "Action": "CREATE",
      "ResourceRecordSet": {
        "Name": "_amazonses.domain.something.something.org.",
        "Type": "TXT",
        "Region":"eu-west-1",
        "TTL": 1800,
        "ResourceRecords": [
          {
            "Value": "<generated-verification-id>"
          }
        ]
      }
    }
  ]
}

Problem: As I run the above command, I receive the following error:

[root@ip-XX-XXX-XX-XXX igor]# aws route53 change-resource-record-sets --hosted-zone-id <HOSTED_ZONE_ID> --change-batch "./record-set.json"

Error parsing parameter '--change-batch': Expected: '=', received: 'EOF' for input:
./record-set.json

What is the problem?

Upvotes: 2

Views: 1941

Answers (1)

Igor L.
Igor L.

Reputation: 3485

Fixed using file:// instead of ./ in the file path (not sure how this works)

[root@ip-XX-XXX-XX-XXX igor]# aws route53 change-resource-record-sets --hosted-zone-id --change-batch "file://record-set.json"

Upvotes: 2

Related Questions