@@ -6,15 +6,15 @@ import_tmp_credential() {
66}
77
88zip_tmp_credential () {
9- cd $tmp_credentials
9+ cd $tmp_credentials > /dev/null
1010 echo " Encrypt temporary credential for assume-role ${ASSUME_ROLE} at ${tmp_credentials} /${ASSUME_ROLE} .zip"
1111
1212 if [ -f " ${tmp_credentials} /${ASSUME_ROLE} .zip" ]; then
1313 rm -rf ${tmp_credentials} /${ASSUME_ROLE} .zip
1414 fi
1515
1616 zip -q -P $assume_role_password_encrypted $ASSUME_ROLE .zip $ASSUME_ROLE && rm -rf $ASSUME_ROLE
17- cd -
17+ cd - > /dev/null
1818}
1919
2020aws_assume_role_reset () {
@@ -42,12 +42,12 @@ aws_assume_role_re_use_current() {
4242}
4343
4444aws_assume_role_unzip_tmp_credential () {
45- cd $tmp_credentials
45+ cd $tmp_credentials > /dev/null
4646 assume_role_name=$1
4747 rm -rf ${assume_role_name}
4848 unzip -P $assume_role_password_encrypted ${assume_role_name} .zip
4949 echo " You credential is save here ${tmp_credentials} /${assume_role_name} "
50- cd -
50+ cd - > /dev/null
5151}
5252
5353aws_assume_role_remove_tmp_credential () {
@@ -145,7 +145,7 @@ aws_assume_role_set_name() {
145145 # cd ${aws_cli_results}
146146
147147 if [ " ${aws_assume_role_print_account_info} " = " true" ]; then
148- aws_account_infos
148+ aws_account_info
149149 fi
150150 else
151151 echo " Please try again, the assume role action was not complete"
@@ -178,7 +178,7 @@ aws_assume_role_set_name_with_hint_peco() {
178178
179179}
180180
181- aws_account_infos () {
181+ aws_account_info () {
182182 get-account-alias
183183
184184 local aws_account_id=$( aws_run_commandline_with_retry ' aws sts get-caller-identity --query "Account" --output text' " true" )
@@ -187,3 +187,11 @@ aws_account_infos() {
187187
188188 echo AWS Region ${AWS_REGION:? " The AWS_REGION is unset or empty" }
189189}
190+
191+ aws_assume_role_get_tmp_credentials_for_new_members () {
192+ local tmp_credentials_file=" ${tmp_credentials} /${ASSUME_ROLE} "
193+ aws_assume_role_set_name_with_hint
194+ aws_assume_role_unzip_tmp_credential $assume_role
195+ cat ${tmp_credentials_file} && rm -rf ${tmp_credentials_file}
196+
197+ }
0 commit comments