From bea9caba3054b70383cb84607449f5c915a5b1a1 Mon Sep 17 00:00:00 2001 From: Les Aker Date: Fri, 3 Apr 2020 04:04:28 +0000 Subject: [PATCH] fix up magic string --- dnsapi/dns_aws.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/dnsapi/dns_aws.sh b/dnsapi/dns_aws.sh index d412e8ce..c856a89b 100755 --- a/dnsapi/dns_aws.sh +++ b/dnsapi/dns_aws.sh @@ -50,8 +50,8 @@ dns_aws_add() { if [ -n "$AWS_ZONE_ID" ] ; then - _debug "Using provided zone ID: $AWS_ZONE_ID" - _domain_id="$AWS_ZONE_ID" + _debug "Using hardcoded zone ID" + _domain_id="/hostedzone/$AWS_ZONE_ID" else _debug "First detect the root zone" if ! _get_root "$fulldomain"; then @@ -59,8 +59,8 @@ dns_aws_add() { _sleep 1 return 1 fi - _debug _domain_id "$_domain_id" fi + _debug _domain_id "$_domain_id" _info "Getting existing records for $fulldomain" if ! aws_rest GET "2013-04-01$_domain_id/rrset" "name=$fulldomain&type=TXT"; then @@ -114,11 +114,16 @@ dns_aws_rm() { _use_container_role || _use_instance_role fi - _debug "First detect the root zone" - if ! _get_root "$fulldomain"; then - _err "invalid domain" - _sleep 1 - return 1 + if [ -n "$AWS_ZONE_ID" ] ; then + _debug "Using hardcoded zone ID" + _domain_id="/hostedzone/${AWS_ZONE_ID}" + else + _debug "First detect the root zone" + if ! _get_root "$fulldomain"; then + _err "invalid domain" + _sleep 1 + return 1 + fi fi _debug _domain_id "$_domain_id"