Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 11 additions & 15 deletions k8s/scope/networking/dns/route53/manage_route
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,16 @@ fi

echo "Found load balancer DNS: $ELB_DNS_NAME"

if [ "$SCOPE_VISIBILITY" = "public" ]; then
HOSTED_ZONES=("$HOSTED_PUBLIC_ZONE_ID")
else
HOSTED_ZONES=()

if [[ -n "$HOSTED_PRIVATE_ZONE_ID" ]] && [[ "$HOSTED_PRIVATE_ZONE_ID" != "null" ]]; then
HOSTED_ZONES+=("$HOSTED_PRIVATE_ZONE_ID")
fi

if [[ -n "$HOSTED_PUBLIC_ZONE_ID" ]] && [[ "$HOSTED_PUBLIC_ZONE_ID" != "null" ]]; then
if [[ "$HOSTED_PUBLIC_ZONE_ID" != "$HOSTED_PRIVATE_ZONE_ID" ]]; then
HOSTED_ZONES+=("$HOSTED_PUBLIC_ZONE_ID")
echo "Will create records in both public and private zones"
fi
HOSTED_ZONES=()

if [[ -n "$HOSTED_PRIVATE_ZONE_ID" ]] && [[ "$HOSTED_PRIVATE_ZONE_ID" != "null" ]]; then
HOSTED_ZONES+=("$HOSTED_PRIVATE_ZONE_ID")
fi

if [[ -n "$HOSTED_PUBLIC_ZONE_ID" ]] && [[ "$HOSTED_PUBLIC_ZONE_ID" != "null" ]]; then
if [[ "$HOSTED_PUBLIC_ZONE_ID" != "$HOSTED_PRIVATE_ZONE_ID" ]]; then
HOSTED_ZONES+=("$HOSTED_PUBLIC_ZONE_ID")
echo "Will create records in both public and private zones"
fi
fi

Expand Down Expand Up @@ -88,4 +84,4 @@ for ZONE_ID in "${HOSTED_ZONES[@]}"; do
}

echo "Successfully $ACTION Route53 record"
done
done