Skip to content

Commit 1d86225

Browse files
committed
Updated Route 53 script to work when the user's default output format isn't JSON
1 parent 77bfb10 commit 1d86225

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hack/update_route_53.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ set -eu
44
zone_name=
55
profile="default"
66

7+
export AWS_DEFAULT_OUTPUT="json"
8+
79
help() {
810
echo "Continually queries Kubernetes for control plane machines and adds their IP address to an Amazon Route 53"
911
echo "recordset. The recordset name will be cp, and it will be created in the specified zone. If a recordset"
@@ -71,6 +73,7 @@ fi
7173

7274
recordset_name="cp.$zone_name"
7375

76+
echo "Getting the zone ID from AWS"
7477
zone_id=$(aws route53 list-hosted-zones --profile "$profile" | jq -r '.HostedZones[] | select(.Name == "'"$zone_name"'").Id | split("/")[2]')
7578
if [[ -n $zone_id ]]
7679
then

0 commit comments

Comments
 (0)