@@ -5,24 +5,31 @@ if [[ -z $SSM_ROOT_PATH ]]; then
55 exit 1
66fi
77
8- ssmval=$( aws ssm get-parameter --name ${SSM_ROOT_PATH} cloud/nodes/wasabi-accessKey --with-decryption --query Parameter.Value --output text || echo not_applicable)
8+ if [[ " OPS_MODE" == " readwrite" ]]
9+ then
10+ OPSMODE_PARAM=" cloud"
11+ else
12+ OPSMODE_PARAM=" cloud-readonly"
13+ fi
14+
15+ ssmval=$( aws ssm get-parameter --name ${SSM_ROOT_PATH}${OPSMODE_PARAM} /nodes/wasabi-accessKey --with-decryption --query Parameter.Value --output text || echo not_applicable)
916sed -i -e " s|TEMPLATE_WASABI_ACCESS_KEY_ID|$ssmval |" /root/.aws/credentials
10- ssmval=$( aws ssm get-parameter --name ${SSM_ROOT_PATH} cloud /nodes/wasabi-secretKey --with-decryption --query Parameter.Value --output text || echo not_applicable)
17+ ssmval=$( aws ssm get-parameter --name ${SSM_ROOT_PATH}${OPSMODE_PARAM} /nodes/wasabi-secretKey --with-decryption --query Parameter.Value --output text || echo not_applicable)
1118sed -i -e " s|TEMPLATE_WASABI_SECRET_ACCESS_KEY|$ssmval |" /root/.aws/credentials
1219ssmval=$( aws ssm get-parameter --name ${SSM_ROOT_PATH} cloud/nodes/wasabi-endpoint --query Parameter.Value --output text || echo not_applicable)
1320sed -i -e " s|TEMPLATE_WASABI_ENDPOINT_URL|$ssmval |" /root/.aws/config
1421
15- ssmval=$( aws ssm get-parameter --name ${SSM_ROOT_PATH} cloud /nodes/sdsc-accessKey --with-decryption --query Parameter.Value --output text || echo not_applicable)
22+ ssmval=$( aws ssm get-parameter --name ${SSM_ROOT_PATH}${OPSMODE_PARAM} /nodes/sdsc-accessKey --with-decryption --query Parameter.Value --output text || echo not_applicable)
1623sed -i -e " s|TEMPLATE_SDSC_ACCESS_KEY_ID|$ssmval |" /root/.aws/credentials
17- ssmval=$( aws ssm get-parameter --name ${SSM_ROOT_PATH} cloud /nodes/sdsc-secretKey --with-decryption --query Parameter.Value --output text || echo not_applicable)
24+ ssmval=$( aws ssm get-parameter --name ${SSM_ROOT_PATH}${OPSMODE_PARAM} /nodes/sdsc-secretKey --with-decryption --query Parameter.Value --output text || echo not_applicable)
1825sed -i -e " s|TEMPLATE_SDSC_SECRET_ACCESS_KEY|$ssmval |" /root/.aws/credentials
1926ssmval=$( aws ssm get-parameter --name ${SSM_ROOT_PATH} cloud/nodes/sdsc-endpoint --query Parameter.Value --output text || echo not_applicable)
2027sed -i -e " s|TEMPLATE_SDSC_ENDPOINT_URL|$ssmval |" /root/.aws/config
2128
2229# Note that these credential only exist in stage and prod... no dev keys exist
23- ssmval=$( aws ssm get-parameter --name ${SSM_ROOT_PATH} cloud /nodes/sdsc-s3-accessKey --with-decryption --query Parameter.Value --output text || echo not_applicable)
30+ ssmval=$( aws ssm get-parameter --name ${SSM_ROOT_PATH}${OPSMODE_PARAM} /nodes/sdsc-s3-accessKey --with-decryption --query Parameter.Value --output text || echo not_applicable)
2431sed -i -e " s|TEMPLATE_SDSC_S3_ACCESS_KEY_ID|$ssmval |" /root/.aws/credentials
25- ssmval=$( aws ssm get-parameter --name ${SSM_ROOT_PATH} cloud /nodes/sdsc-s3-secretKey --with-decryption --query Parameter.Value --output text || echo not_applicable)
32+ ssmval=$( aws ssm get-parameter --name ${SSM_ROOT_PATH}${OPSMODE_PARAM} /nodes/sdsc-s3-secretKey --with-decryption --query Parameter.Value --output text || echo not_applicable)
2633sed -i -e " s|TEMPLATE_SDSC_S3_SECRET_ACCESS_KEY|$ssmval |" /root/.aws/credentials
2734ssmval=$( aws ssm get-parameter --name ${SSM_ROOT_PATH} cloud/nodes/sdsc-s3-endpoint --query Parameter.Value --output text || echo not_applicable)
2835sed -i -e " s|TEMPLATE_SDSC_S3_ENDPOINT_URL|$ssmval |" /root/.aws/config
0 commit comments