从aws命令行添加多个DNS记录时出现错误(InvalidChangeBatch) [英] Error (InvalidChangeBatch) in adding multiple DNS Records from aws command line

查看:191
本文介绍了从aws命令行添加多个DNS记录时出现错误(InvalidChangeBatch)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用此脚本add_multipleDNSrecord.sh添加多个DNS记录,并且出现此错误

I am trying to add multiple DNS records using this script add_multipleDNSrecord.sh and i am getting this error

A client error (InvalidChangeBatch) occurred when calling the ChangeResourceRecordSets operation: FATAL problem: UnsupportedCharacter (Value contains unsupported characters) encountered with ' '

但是我能够添加单个记录而没有来自aws cli的任何问题.谁能告诉我这个脚本出了什么问题?

But i am able to add single record without any issue from aws cli. can anyone please tell me what went wrong in this script?

#!/bin/bash
# declare STRING variable
STRING="Hello World"
#print variable on a screen
echo $STRING

# Hosted Zone ID
ZONEID="Z24*************"


#Comment
COMMENT="Add new entry to the zone"

# The Time-To-Live of this recordset
TTL=300

# Type
TYPE="A"

# Input File Name
FILENAME=/home/ec2-user/awscli/route53/scripts/test.json



cat >> $FILENAME << EOF
    {
      "Comment":"$COMMENT",
      "Changes":[
        {
          "Action":"CREATE",
          "ResourceRecordSet":{
            "ResourceRecords":[
              {
                "Value":"$IP"
              }
            ],
            "Name":"$RECORDSET",
            "Type":"$TYPE",
            "TTL":$TTL
          }
        }
      ]
    }
EOF

echo $FILENAME

推荐答案

替换空格并使用点代替空格即可解决此问题.

After Replacing the space and using dot instead of space solves the problem.

现在,该脚本可以正常工作,并且能够将多个记录添加到托管区域.

Now,The script works fine and its able to add multiple records to the hosted zone.

这篇关于从aws命令行添加多个DNS记录时出现错误(InvalidChangeBatch)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆