File tree Expand file tree Collapse file tree 4 files changed +48
-28
lines changed Expand file tree Collapse file tree 4 files changed +48
-28
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -200,6 +200,30 @@ else
200
200
echo readonly LOGNAME >> ~ /.bashrc
201
201
fi
202
202
203
+ # Setup Q CLI auth mode
204
+ q_settings_file=" $HOME /.aws/amazon_q/settings.json"
205
+ if [ -f " $q_settings_file " ]; then
206
+ q_auth_mode=$( jq -r ' .auth_mode' < $q_settings_file )
207
+ if [ " $q_auth_mode " == " IAM" ]; then
208
+ export AMAZON_Q_SIGV4=true
209
+ else
210
+ export AMAZON_Q_SIGV4=false
211
+ fi
212
+ else
213
+ export AMAZON_Q_SIGV4=true
214
+ fi
215
+
216
+ if $AMAZON_Q_SIGV4 ; then
217
+ if grep -q " ^export AMAZON_Q_SIGV4=" ~ /.bashrc; then
218
+ echo " AMAZON_Q_SIGV4 is defined in the env"
219
+ else
220
+ echo export AMAZON_Q_SIGV4=$AMAZON_Q_SIGV4 >> ~ /.bashrc
221
+ fi
222
+ else
223
+ # Remove from .bashrc if it exists
224
+ sed -i ' /^export AMAZON_Q_SIGV4=/d' ~ /.bashrc
225
+ fi
226
+
203
227
# Generate sagemaker pysdk intelligent default config
204
228
nohup python /etc/sagemaker/sm_pysdk_default_config.py &
205
229
# Only run the following commands if SAGEMAKER_APP_TYPE_LOWERCASE is jupyterlab
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -200,6 +200,30 @@ else
200
200
echo readonly LOGNAME >> ~ /.bashrc
201
201
fi
202
202
203
+ # Setup Q CLI auth mode
204
+ q_settings_file=" $HOME /.aws/amazon_q/settings.json"
205
+ if [ -f " $q_settings_file " ]; then
206
+ q_auth_mode=$( jq -r ' .auth_mode' < $q_settings_file )
207
+ if [ " $q_auth_mode " == " IAM" ]; then
208
+ export AMAZON_Q_SIGV4=true
209
+ else
210
+ export AMAZON_Q_SIGV4=false
211
+ fi
212
+ else
213
+ export AMAZON_Q_SIGV4=true
214
+ fi
215
+
216
+ if $AMAZON_Q_SIGV4 ; then
217
+ if grep -q " ^export AMAZON_Q_SIGV4=" ~ /.bashrc; then
218
+ echo " AMAZON_Q_SIGV4 is defined in the env"
219
+ else
220
+ echo export AMAZON_Q_SIGV4=$AMAZON_Q_SIGV4 >> ~ /.bashrc
221
+ fi
222
+ else
223
+ # Remove from .bashrc if it exists
224
+ sed -i ' /^export AMAZON_Q_SIGV4=/d' ~ /.bashrc
225
+ fi
226
+
203
227
# Generate sagemaker pysdk intelligent default config
204
228
nohup python /etc/sagemaker/sm_pysdk_default_config.py &
205
229
# Only run the following commands if SAGEMAKER_APP_TYPE_LOWERCASE is jupyterlab
You can’t perform that action at this time.
0 commit comments