File tree 1 file changed +5
-2
lines changed 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,11 @@ mkdir -p "${TEST_DIR}"
22
22
CLUSTER_FILE=${TEST_DIR} /${CLUSTER_NAME} .${CLUSTER_TYPE} .yaml
23
23
KUBECONFIG=${KUBECONFIG:- " ${TEST_DIR} /${CLUSTER_NAME} .${CLUSTER_TYPE} .kubeconfig" }
24
24
25
- export AWS_REGION=${AWS_REGION:- us-west-2}
26
- ZONES=${AWS_AVAILABILITY_ZONES:- us-west-2a,us-west-2b,us-west-2c}
25
+ # Use AWS_REGION as priority, fallback to region from awscli config, fallback to us-west-2
26
+ REGION_FROM_CONFIG=" $( aws configure get region) "
27
+ export AWS_REGION=${AWS_REGION:- ${REGION_FROM_CONFIG:- us-west-2} }
28
+ # If zones are not provided, auto-detect the first 3 AZs that are not opt in
29
+ ZONES=${AWS_AVAILABILITY_ZONES:- $(aws ec2 describe-availability-zones | jq -r ' [.AvailabilityZones[] | select(.OptInStatus == "opt-in-not-required") | .ZoneName][:3] | join(",")' )}
27
30
FIRST_ZONE=$( echo " ${ZONES} " | cut -d, -f1)
28
31
NODE_COUNT=${NODE_COUNT:- 3}
29
32
INSTANCE_TYPE=${INSTANCE_TYPE:- c5.large}
You can’t perform that action at this time.
0 commit comments