diff --git a/ci-operator/step-registry/ipi/conf/aws/ipi-conf-aws-commands.sh b/ci-operator/step-registry/ipi/conf/aws/ipi-conf-aws-commands.sh index 8c338711fd7fe..8635905fded20 100755 --- a/ci-operator/step-registry/ipi/conf/aws/ipi-conf-aws-commands.sh +++ b/ci-operator/step-registry/ipi/conf/aws/ipi-conf-aws-commands.sh @@ -8,16 +8,13 @@ CONFIG="${SHARED_DIR}/install-config.yaml" expiration_date=$(date -d '4 hours' --iso=minutes --utc) -case "$((RANDOM % 4))" in -0) aws_region=us-east-1 - zone_1=us-east-1b - zone_2=us-east-1c;; -1) aws_region=us-east-2;; -2) aws_region=us-west-1;; -3) aws_region=us-west-2;; -*) echo >&2 "invalid AWS region index"; exit 1;; +REGION="${LEASED_RESOURCE}" +case "${REGION}" in +us-east-1) + ZONE_1=us-east-1b + ZONE_2=us-east-1c;; esac -echo "AWS region: ${aws_region} (zones: ${zone_1:-${aws_region}a} ${zone_2:-${aws_region}b})" +echo "AWS region: ${REGION} (zones: ${ZONE_1:-${REGION}a} ${ZONE_2:-${REGION}b})" cat >> "${CONFIG}" << EOF baseDomain: origin-ci-int-aws.dev.rhcloud.com @@ -26,19 +23,19 @@ controlPlane: platform: aws: zones: - - ${zone_1:-${aws_region}a} - - ${zone_2:-${aws_region}b} + - ${ZONE1:-${REGION}a} + - ${ZONE2:-${REGION}b} compute: - name: worker platform: aws: type: ${COMPUTE_NODE_TYPE} zones: - - ${zone_1:-${aws_region}a} - - ${zone_2:-${aws_region}b} + - ${ZONE1:-${REGION}a} + - ${ZONE2:-${REGION}b} platform: aws: - region: ${aws_region} + region: ${REGION} userTags: expirationDate: ${expiration_date} EOF