File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,11 +11,12 @@ LOCAL_PORT=27017
1111SSM_PID=" "
1212
1313function usage {
14- echo " usage: $( basename " $0 " ) app_name"
14+ echo " usage: $( basename " $0 " ) app_name [db_endpoint:port] "
1515 exit 1
1616}
1717
1818APP_NAME=${1:- }
19+ DB_ENDPOINT_OVERRIDE=${2:- }
1920
2021if [[ -z $APP_NAME ]]; then
2122 usage
@@ -50,9 +51,13 @@ if [[ -z $BASTION_INSTANCE_ID || $BASTION_INSTANCE_ID == "None" ]]; then
5051 exit 1
5152fi
5253
53- DB_ENDPOINT_WITH_PORT=$( aws cloudformation list-exports \
54- --query " Exports[?Name=='${STACK_NAME} -db-cluster-endpoint'].Value" \
55- --output text)
54+ if [[ -n $DB_ENDPOINT_OVERRIDE ]]; then
55+ DB_ENDPOINT_WITH_PORT=$DB_ENDPOINT_OVERRIDE
56+ else
57+ DB_ENDPOINT_WITH_PORT=$( aws cloudformation list-exports \
58+ --query " Exports[?Name=='${STACK_NAME} -db-cluster-endpoint'].Value" \
59+ --output text)
60+ fi
5661
5762if [[ -z $DB_ENDPOINT_WITH_PORT || $DB_ENDPOINT_WITH_PORT == " None" ]]; then
5863 echo " Error: could not find db endpoint export for ${STACK_NAME} " >&2
You can’t perform that action at this time.
0 commit comments