Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Error parsing parameter '--change-batch': Invalid JSON: Expecting ',' delimiter #17

Closed
andrejmaya opened this issue Jul 24, 2018 · 3 comments

Comments

@andrejmaya
Copy link

When I execute for example this (like in the README):

./certbot-route53.sh \
  --agree-tos \
  --manual-public-ip-logging-ok \
  --domains example.de,www.example.de \
  --email info@example.com

I get this error:

++ aws route53 change-resource-record-sets --hosted-zone-id /hostedzone/XYZ --query ChangeInfo.Id --output text --change-batch '{
      "Changes": [
        "ResourceRecordSet": {
          "Name": "_acme-challenge.www.example.de.",
          "ResourceRecords": ["Value": "\"qnWBjfJe5sR0LmBzy0dAku0IVljLCTGp_jYMmBVzAy0\""}]
      ]
    }'

Error parsing parameter '--change-batch': Invalid JSON: Expecting ',' delimiter: line 3 column 28 (char 48)
JSON received: {
      "Changes": [
        "ResourceRecordSet": {
          "Name": "_acme-challenge.www.example.de.",
          "ResourceRecords": ["Value": "\"qnWBjfJe5sR0LmBzy0dAku0IVljLCTGp_jYMmBVzAy0\""}]
      ]
    }

Any ideas?

@andrejmaya
Copy link
Author

provisioned an ubuntu ec2 and did it there with a route53 admin role attached. worked out well

@JustinPlute
Copy link

To get this working on Mac, I changed the script to:

  TMPFILE=$(mktemp /tmp/temporary-file.XXXXXXXX)
    cat > ${TMPFILE} << EOF
    {
      "Changes":[
        {
          "Action":"${ACTION}",
          "ResourceRecordSet":{
            "ResourceRecords":[
              {
                "Value": "\"$CERTBOT_VALIDATION\""
              }
            ],
            "Name":"_acme-challenge.${CERTBOT_DOMAIN}.",
            "Type":"TXT",
            "TTL":30
          }
        }
      ]
    }
EOF

  aws route53 wait resource-record-sets-changed --id "$(
    aws route53 change-resource-record-sets \
    --hosted-zone-id "${HOSTED_ZONE_ID}" \
    --query ChangeInfo.Id --output text \
    --change-batch file://"${TMPFILE}"
  )"

  # Clean up
  rm $TMPFILE

@kiithwarrior
Copy link

this fixed it for me on mac

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants