File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1014,7 +1014,7 @@ def _aws_credentials(session):
1014
1014
"AWS_ACCESS_KEY_ID=%s" % (str (access_key )),
1015
1015
"AWS_SECRET_ACCESS_KEY=%s" % (str (secret_key )),
1016
1016
]
1017
- if not _aws_credentials_available_in_metadata_service ():
1017
+ if _use_short_lived_credentials () or not _aws_credentials_available_in_metadata_service ():
1018
1018
logger .warning (
1019
1019
"Using the short-lived AWS credentials found in session. They might expire while "
1020
1020
"running."
@@ -1052,6 +1052,10 @@ def _aws_credentials_available_in_metadata_service():
1052
1052
return not instance_metadata_provider .load () is None
1053
1053
1054
1054
1055
+ def _use_short_lived_credentials ():
1056
+ return os .environ .get ("USE_SHORT_LIVED_CREDENTIALS" ) == "1"
1057
+
1058
+
1055
1059
def _write_json_file (filename , content ):
1056
1060
"""Write the contents dict as json to the file.
1057
1061
You can’t perform that action at this time.
0 commit comments