Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSO auth failure if AWS_DEFAULT_PROFILE != AWS_PROFILE #3891

Open
Peter-Darton-i2 opened this issue Oct 10, 2023 · 5 comments
Open

SSO auth failure if AWS_DEFAULT_PROFILE != AWS_PROFILE #3891

Peter-Darton-i2 opened this issue Oct 10, 2023 · 5 comments
Assignees
Labels
bug This issue is a confirmed bug. credentials needs-major-version Can only be considered for the next major release p2 This is a standard priority issue

Comments

@Peter-Darton-i2
Copy link

Peter-Darton-i2 commented Oct 10, 2023

Describe the bug

Summary: boto3 seems to use $AWS_DEFAULT_PROFILE in preference to $AWS_PROFILE, which is the opposite to the aws cli's behavior.

Details:
I'm using SSO.
I've got a ~/.aws/config file containing multiple profiles, including [profile foo] and [profile bar].
I've set AWS_DEFAULT_PROFILE=foo and AWS_PROFILE=bar.
I'm logged in - the aws cli is working and accessing stuff in "bar" (as expected).
I've got a python script that gets a session by calling boto3.Session()
...but client calls fail unless I unset AWS_DEFAULT_PROFILE.

Expected Behavior

I expected boto3.Session() to use the profile from $AWS_PROFILE and to ignore $AWS_DEFAULT_PROFILE (because $AWS_PROFILE takes precedence and it was set).

i.e. the default should be ignored if a non-default value is provided.

Current Behavior

Traceback (most recent call last):
  File "~/test.py", line 5, in <module>
    cw.describe_alarms(AlarmNamePrefix="i2o-uk-test-pre-prod")
  File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 535, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 963, in _make_api_call
    http, parsed_response = self._make_request(
  File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 986, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/usr/local/lib/python3.9/site-packages/botocore/endpoint.py", line 119, in make_request
    return self._send_request(request_dict, operation_model)
  File "/usr/local/lib/python3.9/site-packages/botocore/endpoint.py", line 198, in _send_request
    request = self.create_request(request_dict, operation_model)
  File "/usr/local/lib/python3.9/site-packages/botocore/endpoint.py", line 134, in create_request
    self._event_emitter.emit(
  File "/usr/local/lib/python3.9/site-packages/botocore/hooks.py", line 412, in emit
    return self._emitter.emit(aliased_event_name, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/botocore/hooks.py", line 256, in emit
    return self._emit(event_name, kwargs)
  File "/usr/local/lib/python3.9/site-packages/botocore/hooks.py", line 239, in _emit
    response = handler(**kwargs)
  File "/usr/local/lib/python3.9/site-packages/botocore/signers.py", line 105, in handler
    return self.sign(operation_name, request)
  File "/usr/local/lib/python3.9/site-packages/botocore/signers.py", line 180, in sign
    auth = self.get_auth_instance(**kwargs)
  File "/usr/local/lib/python3.9/site-packages/botocore/signers.py", line 284, in get_auth_instance
    frozen_credentials = self._credentials.get_frozen_credentials()
  File "/usr/local/lib/python3.9/site-packages/botocore/credentials.py", line 611, in get_frozen_credentials
    self._refresh()
  File "/usr/local/lib/python3.9/site-packages/botocore/credentials.py", line 499, in _refresh
    self._protected_refresh(is_mandatory=is_mandatory_refresh)
  File "/usr/local/lib/python3.9/site-packages/botocore/credentials.py", line 515, in _protected_refresh
    metadata = self._refresh_using()
  File "/usr/local/lib/python3.9/site-packages/botocore/credentials.py", line 662, in fetch_credentials
    return self._get_cached_credentials()
  File "/usr/local/lib/python3.9/site-packages/botocore/credentials.py", line 672, in _get_cached_credentials
    response = self._get_credentials()
  File "/usr/local/lib/python3.9/site-packages/botocore/credentials.py", line 2117, in _get_credentials
    token = self._token_loader(self._start_url)['accessToken']
  File "/usr/local/lib/python3.9/site-packages/botocore/utils.py", line 3164, in __call__
    raise SSOTokenLoadError(error_msg=error_msg)
botocore.exceptions.SSOTokenLoadError: Error loading SSO Token: Token for https://d-12345abcde.awsapps.com/start#/ does not exist

Reproduction Steps

set AWS_DEFAULT_PROFILE=foo and AWS_PROFILE=bar, where foo and bar are valid aws profiles described in ~/.aws/config
Login to aws by doing aws sso login
Check aws cli is working; it should be accessing stuff in "bar".

Run a python script:

#!/usr/bin/python 
import boto3
session = boto3.Session()
cw = session.client('cloudwatch')
cw.describe_alarms(AlarmNamePrefix="something-that-exists-in-foo")

... then instead of getting alarms read (which this script doesn't output), we get an exception thrown:
botocore.exceptions.SSOTokenLoadError: Error loading SSO Token: Token for https://d-12345abcde.awsapps.com/start#/ does not exist

If I unset AWS_DEFAULT_PROFILE or if I set AWS_DEFAULT_PROFILE to be == $AWS_PROFILE then things work again.
Similarly, if I change the code to say session = boto3.Session(profile_name='bar') then it all works.

Possible Solution

I suspect that some (if not all) of the code is looking at AWS_DEFAULT_PROFILE when it should be looking at "AWS_PROFILE if that's set, otherwise use AWS_DEFAULT_PROFILE".
I found that if I did export AWS_DEFAULT_PROFILE=$AWS_PROFILE or I unset AWS_DEFAULT_PROFILE then boto3 was happy again ... but "in an ideal world" these workarounds shouldn't be necessary.

Additional Information/Context

As an end user, having different AWS technologies use different authentication controls & requirements is confusing. I want them all to work the same way, so as the aws cli uses AWS_PROFILE if it's set but defaulting to AWS_DEFAULT_PROFILE (if AWS_PROFILE isn't set) then that's the behaviour I expect from boto3.

It might be that this issue was the underlying cause of the confusion reported in #913, although these two scenarios are significantly different.


Environment details:

I'm using a docker container running under Windows WSL2 & docker desktop (layers in layers in layers...) but the short version is that "it's basically linux".

python --version reports Python 3.9.16

pip show boto3 reports:

Name: boto3
Version: 1.28.57
Summary: The AWS SDK for Python
Home-page: https://github.com/boto/boto3
Author: Amazon Web Services
Author-email: 
License: Apache License 2.0
Location: /usr/local/lib/python3.9/site-packages
Requires: jmespath, botocore, s3transfer
Required-by: aws-sam-translator

...and pip show botocore tells me it's Version: 1.31.57

SDK version used

boto3 version 1.28.57

Environment details (OS name and version, etc.)

Linux 752a5f9ee677 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux with python 3.9.16

@Peter-Darton-i2 Peter-Darton-i2 added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Oct 10, 2023
@RyanFitzSimmonsAK RyanFitzSimmonsAK self-assigned this Oct 10, 2023
@RyanFitzSimmonsAK RyanFitzSimmonsAK added credentials investigating This issue is being investigated and/or work is in progress to resolve the issue. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Oct 10, 2023
@RyanFitzSimmonsAK
Copy link
Contributor

RyanFitzSimmonsAK commented Oct 10, 2023

Hi @Peter-Darton-i2, thanks for reaching out. I had some trouble reproducing this behavior; could you provide debug logs for both AWS CLI (--debug) and Boto3 (boto3.set_stream_logger(''). Remember to redact any sensitive information. Thanks!

@RyanFitzSimmonsAK RyanFitzSimmonsAK added response-requested Waiting on additional information or feedback. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. bug This issue is a confirmed bug. labels Oct 10, 2023
@github-actions
Copy link

Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Oct 16, 2023
@Peter-Darton-i2
Copy link
Author

OK, to make things a little simpler, I did this from my "vanilla" WSL2 environment (rather than a docker container inside WSL2) but the results are much the same.

$ env | grep AWS_
AWS_PROFILE=dev-AdministratorAccess
AWS_DEFAULT_PROFILE=cicd-admin

Both profiles are in ~/.aws/config.

First, we do aws sso login --debug which says:

2023-10-17 09:53:34,859 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20
2023-10-17 09:53:34,860 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['sso', 'login', '--debug']
2023-10-17 09:53:35,072 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_s3 at 0x7f6c76190310>
2023-10-17 09:53:35,073 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_ddb at 0x7f6c7636a280>
2023-10-17 09:53:35,073 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method BasicCommand.add_command of <class 'awscli.customizations.configure.configure.ConfigureCommand'>>
2023-10-17 09:53:35,073 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function change_name at 0x7f6c7638d670>
2023-10-17 09:53:35,073 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function change_name at 0x7f6c76397790>
2023-10-17 09:53:35,073 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function alias_opsworks_cm at 0x7f6c761a1ca0>
2023-10-17 09:53:35,073 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_history_commands at 0x7f6c76331dc0>
2023-10-17 09:53:35,073 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method BasicCommand.add_command of <class 'awscli.customizations.devcommands.CLIDevCommand'>>
2023-10-17 09:53:35,073 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_waiters at 0x7f6c76197ee0>
2023-10-17 09:53:35,075 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.6.2/dist/awscli/data/cli.json
2023-10-17 09:53:35,079 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_types at 0x7f6c76262ca0>
2023-10-17 09:53:35,079 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function no_sign_request at 0x7f6c76263820>
2023-10-17 09:53:35,080 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_verify_ssl at 0x7f6c76263790>
2023-10-17 09:53:35,080 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_cli_read_timeout at 0x7f6c76263940>
2023-10-17 09:53:35,080 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_cli_connect_timeout at 0x7f6c762638b0>
2023-10-17 09:53:35,080 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <built-in method update of dict object at 0x7f6c760c1500>
2023-10-17 09:53:35,082 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off
2023-10-17 09:53:35,082 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['sso', 'login', '--debug']
2023-10-17 09:53:35,082 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_timestamp_parser at 0x7f6c76190940>
2023-10-17 09:53:35,082 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function register_uri_param_handler at 0x7f6c76bcf820>
2023-10-17 09:53:35,083 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_binary_formatter at 0x7f6c76104160>
2023-10-17 09:53:35,083 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function no_pager_handler at 0x7f6c76bcbc10>
2023-10-17 09:53:35,083 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_assume_role_provider_cache at 0x7f6c76bc3670>
2023-10-17 09:53:35,088 - MainThread - botocore.utils - DEBUG - IMDS ENDPOINT: http://169.254.169.254/
2023-10-17 09:53:35,090 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function attach_history_handler at 0x7f6c76331ca0>
2023-10-17 09:53:35,090 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_json_file_cache at 0x7f6c76368160>
2023-10-17 09:53:35,100 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.6.2/dist/awscli/botocore/data/sso/2019-06-10/service-2.json
2023-10-17 09:53:35,101 - MainThread - botocore.hooks - DEBUG - Event building-command-table.sso: calling handler <function add_sso_commands at 0x7f6c76362b80>
2023-10-17 09:53:35,102 - MainThread - botocore.hooks - DEBUG - Event building-command-table.sso: calling handler <function add_waiters at 0x7f6c76197ee0>
2023-10-17 09:53:35,113 - MainThread - botocore.hooks - DEBUG - Event building-command-table.sso_login: calling handler <function add_waiters at 0x7f6c76197ee0>
2023-10-17 09:53:35,114 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.login.no-browser: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f6c7588afa0>
2023-10-17 09:53:35,114 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.login: calling handler <awscli.argprocess.ParamShorthandParser object at 0x7f6c76bf5520>
2023-10-17 09:53:35,130 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.6.2/dist/awscli/botocore/data/endpoints.json
2023-10-17 09:53:35,140 - MainThread - botocore.hooks - DEBUG - Event choose-service-name: calling handler <function handle_service_name_alias at 0x7f6c7877a040>
2023-10-17 09:53:35,142 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.6.2/dist/awscli/botocore/data/sso-oidc/2019-06-10/service-2.json
2023-10-17 09:53:35,143 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.sso-oidc: calling handler <function add_generate_presigned_url at 0x7f6c787f3820>
2023-10-17 09:53:35,146 - MainThread - botocore.endpoint - DEBUG - Setting oidc timeout as (60, 60)
2023-10-17 09:53:35,146 - MainThread - botocore.hooks - DEBUG - Event provide-client-params.sso-oidc.StartDeviceAuthorization: calling handler <function base64_decode_input_blobs at 0x7f6c761048b0>
2023-10-17 09:53:35,147 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.sso-oidc.StartDeviceAuthorization: calling handler <function generate_idempotent_uuid at 0x7f6c7878b040>
2023-10-17 09:53:35,147 - MainThread - botocore.hooks - DEBUG - Event before-call.sso-oidc.StartDeviceAuthorization: calling handler <function inject_api_version_header_if_needed at 0x7f6c7878a8b0>
2023-10-17 09:53:35,148 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=StartDeviceAuthorization) with params: {'url_path': '/device_authorization', 'query_string': {}, 'method': 'POST', 'headers': {'Content-Type': 'application/json', 'User-Agent': 'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login'}, 'body': b'{"clientId": REDACTED, "clientSecret": REDACTED, "startUrl": "https://REDACTED.awsapps.com/start/"}', 'url': 'https://oidc.eu-west-2.amazonaws.com/device_authorization', 'context': {'client_region': 'eu-west-2', 'client_config': <botocore.config.Config object at 0x7f6c7583f730>, 'has_streaming_input': False, 'auth_type': 'none'}}
2023-10-17 09:53:35,148 - MainThread - botocore.hooks - DEBUG - Event request-created.sso-oidc.StartDeviceAuthorization: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f6c7583f700>>
2023-10-17 09:53:35,148 - MainThread - botocore.hooks - DEBUG - Event choose-signer.sso-oidc.StartDeviceAuthorization: calling handler <function set_operation_specific_signer at 0x7f6c78787ee0>
2023-10-17 09:53:35,149 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://oidc.eu-west-2.amazonaws.com/device_authorization, headers={'Content-Type': b'application/json', 'User-Agent': b'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login', 'Content-Length': '1542'}>
2023-10-17 09:53:35,149 - MainThread - botocore.httpsession - DEBUG - Certificate path: /usr/local/aws-cli/v2/2.6.2/dist/awscli/botocore/cacert.pem
2023-10-17 09:53:35,150 - MainThread - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): oidc.eu-west-2.amazonaws.com:443
2023-10-17 09:53:35,350 - MainThread - urllib3.connectionpool - DEBUG - https://oidc.eu-west-2.amazonaws.com:443 "POST /device_authorization HTTP/1.1" 200 311
2023-10-17 09:53:35,352 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Tue, 17 Oct 2023 08:53:35 GMT', 'Content-Type': 'application/json', 'Content-Length': '311', 'Connection': 'keep-alive', 'x-amzn-RequestId': '232d2589-c7ef-47c0-987a-67afdc623172'}
2023-10-17 09:53:35,352 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"deviceCode":REDACTED,"expiresIn":600,"interval":1,"userCode":"DKFN-BHPP","verificationUri":"https://device.sso.eu-west-2.amazonaws.com/","verificationUriComplete":"https://device.sso.eu-west-2.amazonaws.com/?user_code=DKFN-BHPP"}'
2023-10-17 09:53:35,353 - MainThread - botocore.hooks - DEBUG - Event needs-retry.sso-oidc.StartDeviceAuthorization: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x7f6c754760a0>>
2023-10-17 09:53:35,353 - MainThread - botocore.retries.standard - DEBUG - Not retrying request.
2023-10-17 09:53:35,353 - MainThread - botocore.hooks - DEBUG - Event after-call.sso-oidc.StartDeviceAuthorization: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x7f6c7583faf0>>
Attempting to automatically open the SSO authorization page in your default browser.
If the browser does not open or you wish to use a different device to authorize this request, open the following URL:

https://device.sso.eu-west-2.amazonaws.com/

Then enter the code:

DKFN-BHPP
2023-10-17 09:53:37,714 - MainThread - botocore.hooks - DEBUG - Event provide-client-params.sso-oidc.CreateToken: calling handler <function base64_decode_input_blobs at 0x7f6c761048b0>
2023-10-17 09:53:37,715 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.sso-oidc.CreateToken: calling handler <function generate_idempotent_uuid at 0x7f6c7878b040>
2023-10-17 09:53:37,716 - MainThread - botocore.hooks - DEBUG - Event before-call.sso-oidc.CreateToken: calling handler <function inject_api_version_header_if_needed at 0x7f6c7878a8b0>
2023-10-17 09:53:37,716 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=CreateToken) with params: {'url_path': '/token', 'query_string': {}, 'method': 'POST', 'headers': {'Content-Type': 'application/json', 'User-Agent': 'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login'}, 'body': b'{"grantType": "urn:ietf:params:oauth:grant-type:device_code", "clientId": REDACTED, "clientSecret": REDACTED, "deviceCode": REDACTED}', 'url': 'https://oidc.eu-west-2.amazonaws.com/token', 'context': {'client_region': 'eu-west-2', 'client_config': <botocore.config.Config object at 0x7f6c7583f730>, 'has_streaming_input': False, 'auth_type': 'none'}}
2023-10-17 09:53:37,716 - MainThread - botocore.hooks - DEBUG - Event request-created.sso-oidc.CreateToken: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f6c7583f700>>
2023-10-17 09:53:37,717 - MainThread - botocore.hooks - DEBUG - Event choose-signer.sso-oidc.CreateToken: calling handler <function set_operation_specific_signer at 0x7f6c78787ee0>
2023-10-17 09:53:37,717 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://oidc.eu-west-2.amazonaws.com/token, headers={'Content-Type': b'application/json', 'User-Agent': b'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login', 'Content-Length': '1652'}>
2023-10-17 09:53:37,718 - MainThread - botocore.httpsession - DEBUG - Certificate path: /usr/local/aws-cli/v2/2.6.2/dist/awscli/botocore/cacert.pem
2023-10-17 09:53:37,753 - MainThread - urllib3.connectionpool - DEBUG - https://oidc.eu-west-2.amazonaws.com:443 "POST /token HTTP/1.1" 400 86
2023-10-17 09:53:37,753 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Tue, 17 Oct 2023 08:53:38 GMT', 'Content-Type': 'application/json', 'Content-Length': '86', 'Connection': 'keep-alive', 'x-amzn-RequestId': '1c0608b3-721b-4321-b8ce-309a64b29b08', 'x-amzn-ErrorType': 'AuthorizationPendingException:http://internal.amazon.com/coral/com.amazonaws.sso.oidc/'}
2023-10-17 09:53:37,753 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"error":"authorization_pending","error_description":"Authorization is still pending"}'
2023-10-17 09:53:37,754 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Tue, 17 Oct 2023 08:53:38 GMT', 'Content-Type': 'application/json', 'Content-Length': '86', 'Connection': 'keep-alive', 'x-amzn-RequestId': '1c0608b3-721b-4321-b8ce-309a64b29b08', 'x-amzn-ErrorType': 'AuthorizationPendingException:http://internal.amazon.com/coral/com.amazonaws.sso.oidc/'}
2023-10-17 09:53:37,754 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"error":"authorization_pending","error_description":"Authorization is still pending"}'
2023-10-17 09:53:37,754 - MainThread - botocore.hooks - DEBUG - Event needs-retry.sso-oidc.CreateToken: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x7f6c754760a0>>
2023-10-17 09:53:37,754 - MainThread - botocore.retries.standard - DEBUG - Not retrying request.
2023-10-17 09:53:37,754 - MainThread - botocore.hooks - DEBUG - Event after-call.sso-oidc.CreateToken: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x7f6c7583faf0>>
2023-10-17 09:53:38,756 - MainThread - botocore.hooks - DEBUG - Event provide-client-params.sso-oidc.CreateToken: calling handler <function base64_decode_input_blobs at 0x7f6c761048b0>
2023-10-17 09:53:38,756 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.sso-oidc.CreateToken: calling handler <function generate_idempotent_uuid at 0x7f6c7878b040>
2023-10-17 09:53:38,756 - MainThread - botocore.hooks - DEBUG - Event before-call.sso-oidc.CreateToken: calling handler <function inject_api_version_header_if_needed at 0x7f6c7878a8b0>
2023-10-17 09:53:38,756 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=CreateToken) with params: {'url_path': '/token', 'query_string': {}, 'method': 'POST', 'headers': {'Content-Type': 'application/json', 'User-Agent': 'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login'}, 'body': b'{"grantType": "urn:ietf:params:oauth:grant-type:device_code", "clientId": REDACTED, "clientSecret": REDACTED, "deviceCode": REDACTED}', 'url': 'https://oidc.eu-west-2.amazonaws.com/token', 'context': {'client_region': 'eu-west-2', 'client_config': <botocore.config.Config object at 0x7f6c7583f730>, 'has_streaming_input': False, 'auth_type': 'none'}}
2023-10-17 09:53:38,756 - MainThread - botocore.hooks - DEBUG - Event request-created.sso-oidc.CreateToken: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f6c7583f700>>
2023-10-17 09:53:38,756 - MainThread - botocore.hooks - DEBUG - Event choose-signer.sso-oidc.CreateToken: calling handler <function set_operation_specific_signer at 0x7f6c78787ee0>
2023-10-17 09:53:38,757 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://oidc.eu-west-2.amazonaws.com/token, headers={'Content-Type': b'application/json', 'User-Agent': b'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login', 'Content-Length': '1652'}>
2023-10-17 09:53:38,757 - MainThread - botocore.httpsession - DEBUG - Certificate path: /usr/local/aws-cli/v2/2.6.2/dist/awscli/botocore/cacert.pem
2023-10-17 09:53:38,786 - MainThread - urllib3.connectionpool - DEBUG - https://oidc.eu-west-2.amazonaws.com:443 "POST /token HTTP/1.1" 400 86
2023-10-17 09:53:38,787 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Tue, 17 Oct 2023 08:53:39 GMT', 'Content-Type': 'application/json', 'Content-Length': '86', 'Connection': 'keep-alive', 'x-amzn-RequestId': 'dbed108d-1f14-44f8-9ec7-aefbb83a7060', 'x-amzn-ErrorType': 'AuthorizationPendingException:http://internal.amazon.com/coral/com.amazonaws.sso.oidc/'}
2023-10-17 09:53:38,787 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"error":"authorization_pending","error_description":"Authorization is still pending"}'
2023-10-17 09:53:38,787 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Tue, 17 Oct 2023 08:53:39 GMT', 'Content-Type': 'application/json', 'Content-Length': '86', 'Connection': 'keep-alive', 'x-amzn-RequestId': 'dbed108d-1f14-44f8-9ec7-aefbb83a7060', 'x-amzn-ErrorType': 'AuthorizationPendingException:http://internal.amazon.com/coral/com.amazonaws.sso.oidc/'}
2023-10-17 09:53:38,787 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"error":"authorization_pending","error_description":"Authorization is still pending"}'
2023-10-17 09:53:38,788 - MainThread - botocore.hooks - DEBUG - Event needs-retry.sso-oidc.CreateToken: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x7f6c754760a0>>
2023-10-17 09:53:38,788 - MainThread - botocore.retries.standard - DEBUG - Not retrying request.
2023-10-17 09:53:38,788 - MainThread - botocore.hooks - DEBUG - Event after-call.sso-oidc.CreateToken: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x7f6c7583faf0>>
2023-10-17 09:53:39,790 - MainThread - botocore.hooks - DEBUG - Event provide-client-params.sso-oidc.CreateToken: calling handler <function base64_decode_input_blobs at 0x7f6c761048b0>
2023-10-17 09:53:39,790 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.sso-oidc.CreateToken: calling handler <function generate_idempotent_uuid at 0x7f6c7878b040>
2023-10-17 09:53:39,792 - MainThread - botocore.hooks - DEBUG - Event before-call.sso-oidc.CreateToken: calling handler <function inject_api_version_header_if_needed at 0x7f6c7878a8b0>
2023-10-17 09:53:39,792 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=CreateToken) with params: {'url_path': '/token', 'query_string': {}, 'method': 'POST', 'headers': {'Content-Type': 'application/json', 'User-Agent': 'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login'}, 'body': b'{"grantType": "urn:ietf:params:oauth:grant-type:device_code", "clientId": REDACTED, "clientSecret": REDACTED, "deviceCode": REDACTED}', 'url': 'https://oidc.eu-west-2.amazonaws.com/token', 'context': {'client_region': 'eu-west-2', 'client_config': <botocore.config.Config object at 0x7f6c7583f730>, 'has_streaming_input': False, 'auth_type': 'none'}}
2023-10-17 09:53:39,793 - MainThread - botocore.hooks - DEBUG - Event request-created.sso-oidc.CreateToken: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f6c7583f700>>
2023-10-17 09:53:39,793 - MainThread - botocore.hooks - DEBUG - Event choose-signer.sso-oidc.CreateToken: calling handler <function set_operation_specific_signer at 0x7f6c78787ee0>
2023-10-17 09:53:39,794 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://oidc.eu-west-2.amazonaws.com/token, headers={'Content-Type': b'application/json', 'User-Agent': b'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login', 'Content-Length': '1652'}>
2023-10-17 09:53:39,795 - MainThread - botocore.httpsession - DEBUG - Certificate path: /usr/local/aws-cli/v2/2.6.2/dist/awscli/botocore/cacert.pem
2023-10-17 09:53:39,831 - MainThread - urllib3.connectionpool - DEBUG - https://oidc.eu-west-2.amazonaws.com:443 "POST /token HTTP/1.1" 400 86
2023-10-17 09:53:39,832 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Tue, 17 Oct 2023 08:53:40 GMT', 'Content-Type': 'application/json', 'Content-Length': '86', 'Connection': 'keep-alive', 'x-amzn-RequestId': 'cae01284-5080-455c-9dff-372d5702e2b4', 'x-amzn-ErrorType': 'AuthorizationPendingException:http://internal.amazon.com/coral/com.amazonaws.sso.oidc/'}
2023-10-17 09:53:39,832 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"error":"authorization_pending","error_description":"Authorization is still pending"}'
2023-10-17 09:53:39,832 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Tue, 17 Oct 2023 08:53:40 GMT', 'Content-Type': 'application/json', 'Content-Length': '86', 'Connection': 'keep-alive', 'x-amzn-RequestId': 'cae01284-5080-455c-9dff-372d5702e2b4', 'x-amzn-ErrorType': 'AuthorizationPendingException:http://internal.amazon.com/coral/com.amazonaws.sso.oidc/'}
2023-10-17 09:53:39,832 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"error":"authorization_pending","error_description":"Authorization is still pending"}'
2023-10-17 09:53:39,833 - MainThread - botocore.hooks - DEBUG - Event needs-retry.sso-oidc.CreateToken: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x7f6c754760a0>>
2023-10-17 09:53:39,833 - MainThread - botocore.retries.standard - DEBUG - Not retrying request.
2023-10-17 09:53:39,833 - MainThread - botocore.hooks - DEBUG - Event after-call.sso-oidc.CreateToken: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x7f6c7583faf0>>
2023-10-17 09:53:40,834 - MainThread - botocore.hooks - DEBUG - Event provide-client-params.sso-oidc.CreateToken: calling handler <function base64_decode_input_blobs at 0x7f6c761048b0>
2023-10-17 09:53:40,835 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.sso-oidc.CreateToken: calling handler <function generate_idempotent_uuid at 0x7f6c7878b040>
2023-10-17 09:53:40,835 - MainThread - botocore.hooks - DEBUG - Event before-call.sso-oidc.CreateToken: calling handler <function inject_api_version_header_if_needed at 0x7f6c7878a8b0>
2023-10-17 09:53:40,835 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=CreateToken) with params: {'url_path': '/token', 'query_string': {}, 'method': 'POST', 'headers': {'Content-Type': 'application/json', 'User-Agent': 'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login'}, 'body': b'{"grantType": "urn:ietf:params:oauth:grant-type:device_code", "clientId": REDACTED, "clientSecret": REDACTED, "deviceCode": REDACTED}', 'url': 'https://oidc.eu-west-2.amazonaws.com/token', 'context': {'client_region': 'eu-west-2', 'client_config': <botocore.config.Config object at 0x7f6c7583f730>, 'has_streaming_input': False, 'auth_type': 'none'}}
2023-10-17 09:53:40,835 - MainThread - botocore.hooks - DEBUG - Event request-created.sso-oidc.CreateToken: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f6c7583f700>>
2023-10-17 09:53:40,835 - MainThread - botocore.hooks - DEBUG - Event choose-signer.sso-oidc.CreateToken: calling handler <function set_operation_specific_signer at 0x7f6c78787ee0>
2023-10-17 09:53:40,835 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://oidc.eu-west-2.amazonaws.com/token, headers={'Content-Type': b'application/json', 'User-Agent': b'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login', 'Content-Length': '1652'}>
2023-10-17 09:53:40,836 - MainThread - botocore.httpsession - DEBUG - Certificate path: /usr/local/aws-cli/v2/2.6.2/dist/awscli/botocore/cacert.pem
2023-10-17 09:53:40,859 - MainThread - urllib3.connectionpool - DEBUG - https://oidc.eu-west-2.amazonaws.com:443 "POST /token HTTP/1.1" 400 86
2023-10-17 09:53:40,859 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Tue, 17 Oct 2023 08:53:41 GMT', 'Content-Type': 'application/json', 'Content-Length': '86', 'Connection': 'keep-alive', 'x-amzn-RequestId': '029ea795-4ca5-478c-baed-6a0fc7f39cea', 'x-amzn-ErrorType': 'AuthorizationPendingException:http://internal.amazon.com/coral/com.amazonaws.sso.oidc/'}
2023-10-17 09:53:40,859 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"error":"authorization_pending","error_description":"Authorization is still pending"}'
2023-10-17 09:53:40,860 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Tue, 17 Oct 2023 08:53:41 GMT', 'Content-Type': 'application/json', 'Content-Length': '86', 'Connection': 'keep-alive', 'x-amzn-RequestId': '029ea795-4ca5-478c-baed-6a0fc7f39cea', 'x-amzn-ErrorType': 'AuthorizationPendingException:http://internal.amazon.com/coral/com.amazonaws.sso.oidc/'}
2023-10-17 09:53:40,860 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"error":"authorization_pending","error_description":"Authorization is still pending"}'
2023-10-17 09:53:40,860 - MainThread - botocore.hooks - DEBUG - Event needs-retry.sso-oidc.CreateToken: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x7f6c754760a0>>
2023-10-17 09:53:40,860 - MainThread - botocore.retries.standard - DEBUG - Not retrying request.
2023-10-17 09:53:40,860 - MainThread - botocore.hooks - DEBUG - Event after-call.sso-oidc.CreateToken: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x7f6c7583faf0>>
2023-10-17 09:53:41,862 - MainThread - botocore.hooks - DEBUG - Event provide-client-params.sso-oidc.CreateToken: calling handler <function base64_decode_input_blobs at 0x7f6c761048b0>
2023-10-17 09:53:41,862 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.sso-oidc.CreateToken: calling handler <function generate_idempotent_uuid at 0x7f6c7878b040>
2023-10-17 09:53:41,864 - MainThread - botocore.hooks - DEBUG - Event before-call.sso-oidc.CreateToken: calling handler <function inject_api_version_header_if_needed at 0x7f6c7878a8b0>
2023-10-17 09:53:41,864 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=CreateToken) with params: {'url_path': '/token', 'query_string': {}, 'method': 'POST', 'headers': {'Content-Type': 'application/json', 'User-Agent': 'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login'}, 'body': b'{"grantType": "urn:ietf:params:oauth:grant-type:device_code", "clientId": REDACTED, "clientSecret": REDACTED, "deviceCode": REDACTED}', 'url': 'https://oidc.eu-west-2.amazonaws.com/token', 'context': {'client_region': 'eu-west-2', 'client_config': <botocore.config.Config object at 0x7f6c7583f730>, 'has_streaming_input': False, 'auth_type': 'none'}}
2023-10-17 09:53:41,865 - MainThread - botocore.hooks - DEBUG - Event request-created.sso-oidc.CreateToken: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f6c7583f700>>
2023-10-17 09:53:41,865 - MainThread - botocore.hooks - DEBUG - Event choose-signer.sso-oidc.CreateToken: calling handler <function set_operation_specific_signer at 0x7f6c78787ee0>
2023-10-17 09:53:41,866 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://oidc.eu-west-2.amazonaws.com/token, headers={'Content-Type': b'application/json', 'User-Agent': b'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login', 'Content-Length': '1652'}>
2023-10-17 09:53:41,868 - MainThread - botocore.httpsession - DEBUG - Certificate path: /usr/local/aws-cli/v2/2.6.2/dist/awscli/botocore/cacert.pem
2023-10-17 09:53:41,898 - MainThread - urllib3.connectionpool - DEBUG - https://oidc.eu-west-2.amazonaws.com:443 "POST /token HTTP/1.1" 400 86
2023-10-17 09:53:41,899 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Tue, 17 Oct 2023 08:53:42 GMT', 'Content-Type': 'application/json', 'Content-Length': '86', 'Connection': 'keep-alive', 'x-amzn-RequestId': '67592f1d-a92d-4ddf-b519-a8d38107787e', 'x-amzn-ErrorType': 'AuthorizationPendingException:http://internal.amazon.com/coral/com.amazonaws.sso.oidc/'}
2023-10-17 09:53:41,899 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"error":"authorization_pending","error_description":"Authorization is still pending"}'
2023-10-17 09:53:41,899 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Tue, 17 Oct 2023 08:53:42 GMT', 'Content-Type': 'application/json', 'Content-Length': '86', 'Connection': 'keep-alive', 'x-amzn-RequestId': '67592f1d-a92d-4ddf-b519-a8d38107787e', 'x-amzn-ErrorType': 'AuthorizationPendingException:http://internal.amazon.com/coral/com.amazonaws.sso.oidc/'}
2023-10-17 09:53:41,899 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"error":"authorization_pending","error_description":"Authorization is still pending"}'
2023-10-17 09:53:41,899 - MainThread - botocore.hooks - DEBUG - Event needs-retry.sso-oidc.CreateToken: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x7f6c754760a0>>
2023-10-17 09:53:41,899 - MainThread - botocore.retries.standard - DEBUG - Not retrying request.
2023-10-17 09:53:41,899 - MainThread - botocore.hooks - DEBUG - Event after-call.sso-oidc.CreateToken: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x7f6c7583faf0>>
2023-10-17 09:53:42,901 - MainThread - botocore.hooks - DEBUG - Event provide-client-params.sso-oidc.CreateToken: calling handler <function base64_decode_input_blobs at 0x7f6c761048b0>
2023-10-17 09:53:42,901 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.sso-oidc.CreateToken: calling handler <function generate_idempotent_uuid at 0x7f6c7878b040>
2023-10-17 09:53:42,901 - MainThread - botocore.hooks - DEBUG - Event before-call.sso-oidc.CreateToken: calling handler <function inject_api_version_header_if_needed at 0x7f6c7878a8b0>
2023-10-17 09:53:42,901 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=CreateToken) with params: {'url_path': '/token', 'query_string': {}, 'method': 'POST', 'headers': {'Content-Type': 'application/json', 'User-Agent': 'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login'}, 'body': b'{"grantType": "urn:ietf:params:oauth:grant-type:device_code", "clientId": REDACTED, "clientSecret": REDACTED, "deviceCode": REDACTED}', 'url': 'https://oidc.eu-west-2.amazonaws.com/token', 'context': {'client_region': 'eu-west-2', 'client_config': <botocore.config.Config object at 0x7f6c7583f730>, 'has_streaming_input': False, 'auth_type': 'none'}}
2023-10-17 09:53:42,901 - MainThread - botocore.hooks - DEBUG - Event request-created.sso-oidc.CreateToken: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f6c7583f700>>
2023-10-17 09:53:42,902 - MainThread - botocore.hooks - DEBUG - Event choose-signer.sso-oidc.CreateToken: calling handler <function set_operation_specific_signer at 0x7f6c78787ee0>
2023-10-17 09:53:42,902 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://oidc.eu-west-2.amazonaws.com/token, headers={'Content-Type': b'application/json', 'User-Agent': b'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login', 'Content-Length': '1652'}>
2023-10-17 09:53:42,902 - MainThread - botocore.httpsession - DEBUG - Certificate path: /usr/local/aws-cli/v2/2.6.2/dist/awscli/botocore/cacert.pem
2023-10-17 09:53:42,939 - MainThread - urllib3.connectionpool - DEBUG - https://oidc.eu-west-2.amazonaws.com:443 "POST /token HTTP/1.1" 400 86
2023-10-17 09:53:42,939 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Tue, 17 Oct 2023 08:53:43 GMT', 'Content-Type': 'application/json', 'Content-Length': '86', 'Connection': 'keep-alive', 'x-amzn-RequestId': 'afbd1371-c55e-474d-9cb8-0c912c83f086', 'x-amzn-ErrorType': 'AuthorizationPendingException:http://internal.amazon.com/coral/com.amazonaws.sso.oidc/'}
2023-10-17 09:53:42,939 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"error":"authorization_pending","error_description":"Authorization is still pending"}'
2023-10-17 09:53:42,940 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Tue, 17 Oct 2023 08:53:43 GMT', 'Content-Type': 'application/json', 'Content-Length': '86', 'Connection': 'keep-alive', 'x-amzn-RequestId': 'afbd1371-c55e-474d-9cb8-0c912c83f086', 'x-amzn-ErrorType': 'AuthorizationPendingException:http://internal.amazon.com/coral/com.amazonaws.sso.oidc/'}
2023-10-17 09:53:42,940 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"error":"authorization_pending","error_description":"Authorization is still pending"}'
2023-10-17 09:53:42,940 - MainThread - botocore.hooks - DEBUG - Event needs-retry.sso-oidc.CreateToken: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x7f6c754760a0>>
2023-10-17 09:53:42,940 - MainThread - botocore.retries.standard - DEBUG - Not retrying request.
2023-10-17 09:53:42,941 - MainThread - botocore.hooks - DEBUG - Event after-call.sso-oidc.CreateToken: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x7f6c7583faf0>>
2023-10-17 09:53:43,942 - MainThread - botocore.hooks - DEBUG - Event provide-client-params.sso-oidc.CreateToken: calling handler <function base64_decode_input_blobs at 0x7f6c761048b0>
2023-10-17 09:53:43,942 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.sso-oidc.CreateToken: calling handler <function generate_idempotent_uuid at 0x7f6c7878b040>
2023-10-17 09:53:43,943 - MainThread - botocore.hooks - DEBUG - Event before-call.sso-oidc.CreateToken: calling handler <function inject_api_version_header_if_needed at 0x7f6c7878a8b0>
2023-10-17 09:53:43,943 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=CreateToken) with params: {'url_path': '/token', 'query_string': {}, 'method': 'POST', 'headers': {'Content-Type': 'application/json', 'User-Agent': 'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login'}, 'body': b'{"grantType": "urn:ietf:params:oauth:grant-type:device_code", "clientId": REDACTED, "clientSecret": REDACTED, "deviceCode": REDACTED}', 'url': 'https://oidc.eu-west-2.amazonaws.com/token', 'context': {'client_region': 'eu-west-2', 'client_config': <botocore.config.Config object at 0x7f6c7583f730>, 'has_streaming_input': False, 'auth_type': 'none'}}
2023-10-17 09:53:43,943 - MainThread - botocore.hooks - DEBUG - Event request-created.sso-oidc.CreateToken: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f6c7583f700>>
2023-10-17 09:53:43,943 - MainThread - botocore.hooks - DEBUG - Event choose-signer.sso-oidc.CreateToken: calling handler <function set_operation_specific_signer at 0x7f6c78787ee0>
2023-10-17 09:53:43,944 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://oidc.eu-west-2.amazonaws.com/token, headers={'Content-Type': b'application/json', 'User-Agent': b'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login', 'Content-Length': '1652'}>
2023-10-17 09:53:43,944 - MainThread - botocore.httpsession - DEBUG - Certificate path: /usr/local/aws-cli/v2/2.6.2/dist/awscli/botocore/cacert.pem
2023-10-17 09:53:43,976 - MainThread - urllib3.connectionpool - DEBUG - https://oidc.eu-west-2.amazonaws.com:443 "POST /token HTTP/1.1" 400 86
2023-10-17 09:53:43,977 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Tue, 17 Oct 2023 08:53:44 GMT', 'Content-Type': 'application/json', 'Content-Length': '86', 'Connection': 'keep-alive', 'x-amzn-RequestId': 'acd53db4-22f2-4e95-80fc-b356088b4281', 'x-amzn-ErrorType': 'AuthorizationPendingException:http://internal.amazon.com/coral/com.amazonaws.sso.oidc/'}
2023-10-17 09:53:43,977 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"error":"authorization_pending","error_description":"Authorization is still pending"}'
2023-10-17 09:53:43,977 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Tue, 17 Oct 2023 08:53:44 GMT', 'Content-Type': 'application/json', 'Content-Length': '86', 'Connection': 'keep-alive', 'x-amzn-RequestId': 'acd53db4-22f2-4e95-80fc-b356088b4281', 'x-amzn-ErrorType': 'AuthorizationPendingException:http://internal.amazon.com/coral/com.amazonaws.sso.oidc/'}
2023-10-17 09:53:43,978 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"error":"authorization_pending","error_description":"Authorization is still pending"}'
2023-10-17 09:53:43,978 - MainThread - botocore.hooks - DEBUG - Event needs-retry.sso-oidc.CreateToken: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x7f6c754760a0>>
2023-10-17 09:53:43,978 - MainThread - botocore.retries.standard - DEBUG - Not retrying request.
2023-10-17 09:53:43,978 - MainThread - botocore.hooks - DEBUG - Event after-call.sso-oidc.CreateToken: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x7f6c7583faf0>>
2023-10-17 09:53:44,980 - MainThread - botocore.hooks - DEBUG - Event provide-client-params.sso-oidc.CreateToken: calling handler <function base64_decode_input_blobs at 0x7f6c761048b0>
2023-10-17 09:53:44,980 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.sso-oidc.CreateToken: calling handler <function generate_idempotent_uuid at 0x7f6c7878b040>
2023-10-17 09:53:44,981 - MainThread - botocore.hooks - DEBUG - Event before-call.sso-oidc.CreateToken: calling handler <function inject_api_version_header_if_needed at 0x7f6c7878a8b0>
2023-10-17 09:53:44,981 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=CreateToken) with params: {'url_path': '/token', 'query_string': {}, 'method': 'POST', 'headers': {'Content-Type': 'application/json', 'User-Agent': 'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login'}, 'body': b'{"grantType": "urn:ietf:params:oauth:grant-type:device_code", "clientId": REDACTED, "clientSecret": REDACTED, "deviceCode": REDACTED}', 'url': 'https://oidc.eu-west-2.amazonaws.com/token', 'context': {'client_region': 'eu-west-2', 'client_config': <botocore.config.Config object at 0x7f6c7583f730>, 'has_streaming_input': False, 'auth_type': 'none'}}
2023-10-17 09:53:44,981 - MainThread - botocore.hooks - DEBUG - Event request-created.sso-oidc.CreateToken: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f6c7583f700>>
2023-10-17 09:53:44,981 - MainThread - botocore.hooks - DEBUG - Event choose-signer.sso-oidc.CreateToken: calling handler <function set_operation_specific_signer at 0x7f6c78787ee0>
2023-10-17 09:53:44,982 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://oidc.eu-west-2.amazonaws.com/token, headers={'Content-Type': b'application/json', 'User-Agent': b'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login', 'Content-Length': '1652'}>
2023-10-17 09:53:44,982 - MainThread - botocore.httpsession - DEBUG - Certificate path: /usr/local/aws-cli/v2/2.6.2/dist/awscli/botocore/cacert.pem
2023-10-17 09:53:45,008 - MainThread - urllib3.connectionpool - DEBUG - https://oidc.eu-west-2.amazonaws.com:443 "POST /token HTTP/1.1" 400 86
2023-10-17 09:53:45,008 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Tue, 17 Oct 2023 08:53:45 GMT', 'Content-Type': 'application/json', 'Content-Length': '86', 'Connection': 'keep-alive', 'x-amzn-RequestId': 'e7745d33-cd5b-44f3-a97a-77eafde16db2', 'x-amzn-ErrorType': 'AuthorizationPendingException:http://internal.amazon.com/coral/com.amazonaws.sso.oidc/'}
2023-10-17 09:53:45,008 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"error":"authorization_pending","error_description":"Authorization is still pending"}'
2023-10-17 09:53:45,009 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Tue, 17 Oct 2023 08:53:45 GMT', 'Content-Type': 'application/json', 'Content-Length': '86', 'Connection': 'keep-alive', 'x-amzn-RequestId': 'e7745d33-cd5b-44f3-a97a-77eafde16db2', 'x-amzn-ErrorType': 'AuthorizationPendingException:http://internal.amazon.com/coral/com.amazonaws.sso.oidc/'}
2023-10-17 09:53:45,009 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"error":"authorization_pending","error_description":"Authorization is still pending"}'
2023-10-17 09:53:45,009 - MainThread - botocore.hooks - DEBUG - Event needs-retry.sso-oidc.CreateToken: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x7f6c754760a0>>
2023-10-17 09:53:45,009 - MainThread - botocore.retries.standard - DEBUG - Not retrying request.
2023-10-17 09:53:45,009 - MainThread - botocore.hooks - DEBUG - Event after-call.sso-oidc.CreateToken: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x7f6c7583faf0>>
2023-10-17 09:53:46,011 - MainThread - botocore.hooks - DEBUG - Event provide-client-params.sso-oidc.CreateToken: calling handler <function base64_decode_input_blobs at 0x7f6c761048b0>
2023-10-17 09:53:46,011 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.sso-oidc.CreateToken: calling handler <function generate_idempotent_uuid at 0x7f6c7878b040>
2023-10-17 09:53:46,012 - MainThread - botocore.hooks - DEBUG - Event before-call.sso-oidc.CreateToken: calling handler <function inject_api_version_header_if_needed at 0x7f6c7878a8b0>
2023-10-17 09:53:46,012 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=CreateToken) with params: {'url_path': '/token', 'query_string': {}, 'method': 'POST', 'headers': {'Content-Type': 'application/json', 'User-Agent': 'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login'}, 'body': b'{"grantType": "urn:ietf:params:oauth:grant-type:device_code", "clientId": REDACTED, "clientSecret": REDACTED, "deviceCode": REDACTED}', 'url': 'https://oidc.eu-west-2.amazonaws.com/token', 'context': {'client_region': 'eu-west-2', 'client_config': <botocore.config.Config object at 0x7f6c7583f730>, 'has_streaming_input': False, 'auth_type': 'none'}}
2023-10-17 09:53:46,012 - MainThread - botocore.hooks - DEBUG - Event request-created.sso-oidc.CreateToken: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f6c7583f700>>
2023-10-17 09:53:46,012 - MainThread - botocore.hooks - DEBUG - Event choose-signer.sso-oidc.CreateToken: calling handler <function set_operation_specific_signer at 0x7f6c78787ee0>
2023-10-17 09:53:46,012 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://oidc.eu-west-2.amazonaws.com/token, headers={'Content-Type': b'application/json', 'User-Agent': b'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login', 'Content-Length': '1652'}>
2023-10-17 09:53:46,013 - MainThread - botocore.httpsession - DEBUG - Certificate path: /usr/local/aws-cli/v2/2.6.2/dist/awscli/botocore/cacert.pem
2023-10-17 09:53:46,042 - MainThread - urllib3.connectionpool - DEBUG - https://oidc.eu-west-2.amazonaws.com:443 "POST /token HTTP/1.1" 400 86
2023-10-17 09:53:46,042 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Tue, 17 Oct 2023 08:53:46 GMT', 'Content-Type': 'application/json', 'Content-Length': '86', 'Connection': 'keep-alive', 'x-amzn-RequestId': '8c952908-9a24-4bbb-9fe1-5f93006a4f22', 'x-amzn-ErrorType': 'AuthorizationPendingException:http://internal.amazon.com/coral/com.amazonaws.sso.oidc/'}
2023-10-17 09:53:46,042 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"error":"authorization_pending","error_description":"Authorization is still pending"}'
2023-10-17 09:53:46,043 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Tue, 17 Oct 2023 08:53:46 GMT', 'Content-Type': 'application/json', 'Content-Length': '86', 'Connection': 'keep-alive', 'x-amzn-RequestId': '8c952908-9a24-4bbb-9fe1-5f93006a4f22', 'x-amzn-ErrorType': 'AuthorizationPendingException:http://internal.amazon.com/coral/com.amazonaws.sso.oidc/'}
2023-10-17 09:53:46,043 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"error":"authorization_pending","error_description":"Authorization is still pending"}'
2023-10-17 09:53:46,043 - MainThread - botocore.hooks - DEBUG - Event needs-retry.sso-oidc.CreateToken: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x7f6c754760a0>>
2023-10-17 09:53:46,043 - MainThread - botocore.retries.standard - DEBUG - Not retrying request.
2023-10-17 09:53:46,043 - MainThread - botocore.hooks - DEBUG - Event after-call.sso-oidc.CreateToken: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x7f6c7583faf0>>
2023-10-17 09:53:47,045 - MainThread - botocore.hooks - DEBUG - Event provide-client-params.sso-oidc.CreateToken: calling handler <function base64_decode_input_blobs at 0x7f6c761048b0>
2023-10-17 09:53:47,045 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.sso-oidc.CreateToken: calling handler <function generate_idempotent_uuid at 0x7f6c7878b040>
2023-10-17 09:53:47,046 - MainThread - botocore.hooks - DEBUG - Event before-call.sso-oidc.CreateToken: calling handler <function inject_api_version_header_if_needed at 0x7f6c7878a8b0>
2023-10-17 09:53:47,046 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=CreateToken) with params: {'url_path': '/token', 'query_string': {}, 'method': 'POST', 'headers': {'Content-Type': 'application/json', 'User-Agent': 'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login'}, 'body': b'{"grantType": "urn:ietf:params:oauth:grant-type:device_code", "clientId": REDACTED, "clientSecret": REDACTED, "deviceCode": REDACTED}', 'url': 'https://oidc.eu-west-2.amazonaws.com/token', 'context': {'client_region': 'eu-west-2', 'client_config': <botocore.config.Config object at 0x7f6c7583f730>, 'has_streaming_input': False, 'auth_type': 'none'}}
2023-10-17 09:53:47,047 - MainThread - botocore.hooks - DEBUG - Event request-created.sso-oidc.CreateToken: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f6c7583f700>>
2023-10-17 09:53:47,047 - MainThread - botocore.hooks - DEBUG - Event choose-signer.sso-oidc.CreateToken: calling handler <function set_operation_specific_signer at 0x7f6c78787ee0>
2023-10-17 09:53:47,048 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://oidc.eu-west-2.amazonaws.com/token, headers={'Content-Type': b'application/json', 'User-Agent': b'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/sso.login', 'Content-Length': '1652'}>
2023-10-17 09:53:47,048 - MainThread - botocore.httpsession - DEBUG - Certificate path: /usr/local/aws-cli/v2/2.6.2/dist/awscli/botocore/cacert.pem
2023-10-17 09:53:47,153 - MainThread - urllib3.connectionpool - DEBUG - https://oidc.eu-west-2.amazonaws.com:443 "POST /token HTTP/1.1" 200 400
2023-10-17 09:53:47,154 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Tue, 17 Oct 2023 08:53:47 GMT', 'Content-Type': 'application/json', 'Content-Length': '400', 'Connection': 'keep-alive', 'x-amzn-RequestId': 'c3359eb3-439c-48fc-8a43-adff3befa989'}
2023-10-17 09:53:47,154 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"accessToken":REDACTED,"aws_sso_app_session_id":null,"expiresIn":28796,"idToken":null,"issuedTokenType":null,"originSessionId":null,"refreshToken":null,"tokenType":"Bearer"}'
2023-10-17 09:53:47,155 - MainThread - botocore.hooks - DEBUG - Event needs-retry.sso-oidc.CreateToken: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x7f6c754760a0>>
2023-10-17 09:53:47,155 - MainThread - botocore.retries.standard - DEBUG - Not retrying request.
2023-10-17 09:53:47,156 - MainThread - botocore.hooks - DEBUG - Event after-call.sso-oidc.CreateToken: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x7f6c7583faf0>>
Successfully logged into Start URL: https://REDACTED.awsapps.com/start/

Then we use aws sts get-caller-identity to confirm that we're logged in as AWS_PROFILE=dev-AdministratorAccess:

$ aws sts get-caller-identity
{
    "UserId": "REDACTED:REDACTED@i2group.com",
    "Account": "REDACTED",
    "Arn": "arn:aws:sts::REDACTED:assumed-role/AWSReservedSSO_AdministratorAccess_REDACTED/REDACTED@i2group.com"
}

Then we use the AWS CLI to do "describe alarms" (there aren't any right now):

$ aws cloudwatch describe-alarms --debug
2023-10-17 10:36:32,340 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20
2023-10-17 10:36:32,340 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['cloudwatch', 'describe-alarms', '--debug']
2023-10-17 10:36:32,351 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_s3 at 0x7f8fd2c80310>
2023-10-17 10:36:32,351 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_ddb at 0x7f8fd2e5a280>
2023-10-17 10:36:32,351 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method BasicCommand.add_command of <class 'awscli.customizations.configure.configure.ConfigureCommand'>>
2023-10-17 10:36:32,351 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function change_name at 0x7f8fd2e7d670>
2023-10-17 10:36:32,351 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function change_name at 0x7f8fd2e87790>
2023-10-17 10:36:32,351 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function alias_opsworks_cm at 0x7f8fd2c91ca0>
2023-10-17 10:36:32,351 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_history_commands at 0x7f8fd2e21dc0>
2023-10-17 10:36:32,351 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method BasicCommand.add_command of <class 'awscli.customizations.devcommands.CLIDevCommand'>>
2023-10-17 10:36:32,351 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_waiters at 0x7f8fd2c87ee0>
2023-10-17 10:36:32,352 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.6.2/dist/awscli/data/cli.json
2023-10-17 10:36:32,355 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_types at 0x7f8fd2d52ca0>
2023-10-17 10:36:32,355 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function no_sign_request at 0x7f8fd2d53820>
2023-10-17 10:36:32,355 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_verify_ssl at 0x7f8fd2d53790>
2023-10-17 10:36:32,356 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_cli_read_timeout at 0x7f8fd2d53940>
2023-10-17 10:36:32,356 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_cli_connect_timeout at 0x7f8fd2d538b0>
2023-10-17 10:36:32,356 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <built-in method update of dict object at 0x7f8fd2bb1640>
2023-10-17 10:36:32,357 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off
2023-10-17 10:36:32,357 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['cloudwatch', 'describe-alarms', '--debug']
2023-10-17 10:36:32,357 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_timestamp_parser at 0x7f8fd2c80940>
2023-10-17 10:36:32,357 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function register_uri_param_handler at 0x7f8fd36bf820>
2023-10-17 10:36:32,357 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_binary_formatter at 0x7f8fd2bf4160>
2023-10-17 10:36:32,357 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function no_pager_handler at 0x7f8fd36bbc10>
2023-10-17 10:36:32,358 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_assume_role_provider_cache at 0x7f8fd36b3670>
2023-10-17 10:36:32,358 - MainThread - botocore.utils - DEBUG - IMDS ENDPOINT: http://169.254.169.254/
2023-10-17 10:36:32,360 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function attach_history_handler at 0x7f8fd2e21ca0>
2023-10-17 10:36:32,360 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_json_file_cache at 0x7f8fd2e58160>
2023-10-17 10:36:32,368 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.6.2/dist/awscli/botocore/data/cloudwatch/2010-08-01/service-2.json
2023-10-17 10:36:32,373 - MainThread - botocore.hooks - DEBUG - Event building-command-table.cloudwatch: calling handler <function add_waiters at 0x7f8fd2c87ee0>
2023-10-17 10:36:32,382 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.6.2/dist/awscli/botocore/data/cloudwatch/2010-08-01/waiters-2.json
2023-10-17 10:36:32,383 - MainThread - awscli.clidriver - DEBUG - OrderedDict([('alarm-names', <awscli.arguments.ListArgument object at 0x7f8fd22e45e0>), ('alarm-name-prefix', <awscli.arguments.CLIArgument object at 0x7f8fd22e45b0>), ('alarm-types', <awscli.arguments.ListArgument object at 0x7f8fd22e47c0>), ('children-of-alarm-name', <awscli.arguments.CLIArgument object at 0x7f8fd22e47f0>), ('parents-of-alarm-name', <awscli.arguments.CLIArgument object at 0x7f8fd22e4850>), ('state-value', <awscli.arguments.CLIArgument object at 0x7f8fd22e4880>), ('action-prefix', <awscli.arguments.CLIArgument object at 0x7f8fd22e4820>), ('max-records', <awscli.arguments.CLIArgument object at 0x7f8fd22e48b0>), ('next-token', <awscli.arguments.CLIArgument object at 0x7f8fd22e48e0>)])
2023-10-17 10:36:32,383 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.cloudwatch.describe-alarms: calling handler <function add_streaming_output_arg at 0x7f8fd2c80c10>
2023-10-17 10:36:32,383 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.cloudwatch.describe-alarms: calling handler <function add_cli_input_json at 0x7f8fd36b3e50>
2023-10-17 10:36:32,384 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.cloudwatch.describe-alarms: calling handler <function add_cli_input_yaml at 0x7f8fd363d0d0>
2023-10-17 10:36:32,384 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.cloudwatch.describe-alarms: calling handler <function unify_paging_params at 0x7f8fd2e5a790>
2023-10-17 10:36:32,393 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.6.2/dist/awscli/botocore/data/cloudwatch/2010-08-01/paginators-1.json
2023-10-17 10:36:32,393 - MainThread - awscli.customizations.paginate - DEBUG - Modifying paging parameters for operation: DescribeAlarms
2023-10-17 10:36:32,394 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.cloudwatch.describe-alarms: calling handler <function add_generate_skeleton at 0x7f8fd2d52280>
2023-10-17 10:36:32,394 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.cloudwatch.describe-alarms: calling handler <bound method OverrideRequiredArgsArgument.override_required_args of <awscli.customizations.cliinput.CliInputJSONArgument object at 0x7f8fd22e49d0>>
2023-10-17 10:36:32,394 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.cloudwatch.describe-alarms: calling handler <bound method OverrideRequiredArgsArgument.override_required_args of <awscli.customizations.cliinput.CliInputYAMLArgument object at 0x7f8fd22e4a00>>
2023-10-17 10:36:32,394 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.cloudwatch.describe-alarms: calling handler <bound method GenerateCliSkeletonArgument.override_required_args of <awscli.customizations.generatecliskeleton.GenerateCliSkeletonArgument object at 0x7f8fd22e4b80>>
2023-10-17 10:36:32,396 - MainThread - botocore.hooks - DEBUG - Event operation-args-parsed.cloudwatch.describe-alarms: calling handler functools.partial(<function check_should_enable_pagination at 0x7f8fd2e5a8b0>, ['next-token', 'max-records'], {}, OrderedDict([('alarm-names', <awscli.arguments.ListArgument object at 0x7f8fd22e45e0>), ('alarm-name-prefix', <awscli.arguments.CLIArgument object at 0x7f8fd22e45b0>), ('alarm-types', <awscli.arguments.ListArgument object at 0x7f8fd22e47c0>), ('children-of-alarm-name', <awscli.arguments.CLIArgument object at 0x7f8fd22e47f0>), ('parents-of-alarm-name', <awscli.arguments.CLIArgument object at 0x7f8fd22e4850>), ('state-value', <awscli.arguments.CLIArgument object at 0x7f8fd22e4880>), ('action-prefix', <awscli.arguments.CLIArgument object at 0x7f8fd22e4820>), ('max-records', <awscli.arguments.CLIArgument object at 0x7f8fd22e48b0>), ('next-token', <awscli.arguments.CLIArgument object at 0x7f8fd22e48e0>), ('cli-input-json', <awscli.customizations.cliinput.CliInputJSONArgument object at 0x7f8fd22e49d0>), ('cli-input-yaml', <awscli.customizations.cliinput.CliInputYAMLArgument object at 0x7f8fd22e4a00>), ('starting-token', <awscli.customizations.paginate.PageArgument object at 0x7f8fd22e4a90>), ('page-size', <awscli.customizations.paginate.PageArgument object at 0x7f8fd22e44c0>), ('max-items', <awscli.customizations.paginate.PageArgument object at 0x7f8fd22e4b50>), ('generate-cli-skeleton', <awscli.customizations.generatecliskeleton.GenerateCliSkeletonArgument object at 0x7f8fd22e4b80>)]))
2023-10-17 10:36:32,396 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.monitoring.describe-alarms.alarm-names: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f8fd237afa0>
2023-10-17 10:36:32,396 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.monitoring.describe-alarms.alarm-name-prefix: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f8fd237afa0>
2023-10-17 10:36:32,396 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.monitoring.describe-alarms.alarm-types: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f8fd237afa0>
2023-10-17 10:36:32,396 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.monitoring.describe-alarms.children-of-alarm-name: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f8fd237afa0>
2023-10-17 10:36:32,396 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.monitoring.describe-alarms.parents-of-alarm-name: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f8fd237afa0>
2023-10-17 10:36:32,396 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.monitoring.describe-alarms.state-value: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f8fd237afa0>
2023-10-17 10:36:32,396 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.monitoring.describe-alarms.action-prefix: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f8fd237afa0>
2023-10-17 10:36:32,396 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.monitoring.describe-alarms.max-records: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f8fd237afa0>
2023-10-17 10:36:32,397 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.monitoring.describe-alarms.next-token: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f8fd237afa0>
2023-10-17 10:36:32,397 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.monitoring.describe-alarms.cli-input-json: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f8fd237afa0>
2023-10-17 10:36:32,397 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.monitoring.describe-alarms.cli-input-yaml: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f8fd237afa0>
2023-10-17 10:36:32,397 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.monitoring.describe-alarms.starting-token: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f8fd237afa0>
2023-10-17 10:36:32,397 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.monitoring.describe-alarms.page-size: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f8fd237afa0>
2023-10-17 10:36:32,397 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.monitoring.describe-alarms.max-items: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f8fd237afa0>
2023-10-17 10:36:32,397 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.monitoring.describe-alarms.generate-cli-skeleton: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f8fd237afa0>
2023-10-17 10:36:32,397 - MainThread - botocore.hooks - DEBUG - Event calling-command.cloudwatch.describe-alarms: calling handler <bound method CliInputArgument.add_to_call_parameters of <awscli.customizations.cliinput.CliInputJSONArgument object at 0x7f8fd22e49d0>>
2023-10-17 10:36:32,397 - MainThread - botocore.hooks - DEBUG - Event calling-command.cloudwatch.describe-alarms: calling handler <bound method CliInputArgument.add_to_call_parameters of <awscli.customizations.cliinput.CliInputYAMLArgument object at 0x7f8fd22e4a00>>
2023-10-17 10:36:32,397 - MainThread - botocore.hooks - DEBUG - Event calling-command.cloudwatch.describe-alarms: calling handler <bound method GenerateCliSkeletonArgument.generate_skeleton of <awscli.customizations.generatecliskeleton.GenerateCliSkeletonArgument object at 0x7f8fd22e4b80>>
2023-10-17 10:36:32,397 - MainThread - botocore.hooks - DEBUG - Event calling-command.cloudwatch.describe-alarms: calling handler functools.partial(<function check_should_enable_pagination_call_parameters at 0x7f8fd2e5aca0>, ['NextToken', 'MaxRecords'])
2023-10-17 10:36:32,398 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: env
2023-10-17 10:36:32,398 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role
2023-10-17 10:36:32,398 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role-with-web-identity
2023-10-17 10:36:32,398 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: sso
2023-10-17 10:36:32,399 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.6.2/dist/awscli/botocore/data/endpoints.json
2023-10-17 10:36:32,407 - MainThread - botocore.hooks - DEBUG - Event choose-service-name: calling handler <function handle_service_name_alias at 0x7f8fd526a040>
2023-10-17 10:36:32,409 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.cloudwatch: calling handler <function add_generate_presigned_url at 0x7f8fd52e3820>
2023-10-17 10:36:32,412 - MainThread - botocore.endpoint - DEBUG - Setting monitoring timeout as (60, 60)
2023-10-17 10:36:32,413 - MainThread - botocore.hooks - DEBUG - Event provide-client-params.cloudwatch.DescribeAlarms: calling handler <function base64_decode_input_blobs at 0x7f8fd2bf48b0>
2023-10-17 10:36:32,414 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.cloudwatch.DescribeAlarms: calling handler <function generate_idempotent_uuid at 0x7f8fd527b040>
2023-10-17 10:36:32,414 - MainThread - botocore.hooks - DEBUG - Event before-call.cloudwatch.DescribeAlarms: calling handler <function inject_api_version_header_if_needed at 0x7f8fd527c8b0>
2023-10-17 10:36:32,414 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=DescribeAlarms) with params: {'url_path': '/', 'query_string': '', 'method': 'POST', 'headers': {'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8', 'User-Agent': 'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/cloudwatch.describe-alarms'}, 'body': {'Action': 'DescribeAlarms', 'Version': '2010-08-01'}, 'url': 'https://monitoring.eu-west-2.amazonaws.com/', 'context': {'client_region': 'eu-west-2', 'client_config': <botocore.config.Config object at 0x7f8fd1ed8ee0>, 'has_streaming_input': False, 'auth_type': None}}
2023-10-17 10:36:32,414 - MainThread - botocore.hooks - DEBUG - Event request-created.cloudwatch.DescribeAlarms: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f8fd1ed8f40>>
2023-10-17 10:36:32,414 - MainThread - botocore.hooks - DEBUG - Event choose-signer.cloudwatch.DescribeAlarms: calling handler <function set_operation_specific_signer at 0x7f8fd5277ee0>
2023-10-17 10:36:32,421 - MainThread - botocore.credentials - DEBUG - Credentials for role retrieved from cache.
2023-10-17 10:36:32,421 - MainThread - botocore.credentials - DEBUG - Retrieved credentials will expire at: 2023-10-17 17:04:38+00:00
2023-10-17 10:36:32,421 - MainThread - botocore.auth - DEBUG - Calculating signature using v4 auth.
2023-10-17 10:36:32,422 - MainThread - botocore.auth - DEBUG - CanonicalRequest:
POST
/

content-type:application/x-www-form-urlencoded; charset=utf-8
host:monitoring.eu-west-2.amazonaws.com
x-amz-date:20231017T093632Z
x-amz-security-token:REDACTED

content-type;host;x-amz-date;x-amz-security-token
REDACTED
2023-10-17 10:36:32,422 - MainThread - botocore.auth - DEBUG - StringToSign:
AWS4-HMAC-SHA256
20231017T093632Z
20231017/eu-west-2/monitoring/aws4_request
REDACTED
2023-10-17 10:36:32,422 - MainThread - botocore.auth - DEBUG - Signature:
REDACTED
2023-10-17 10:36:32,422 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://monitoring.eu-west-2.amazonaws.com/, headers={'Content-Type': b'application/x-www-form-urlencoded; charset=utf-8', 'User-Agent': b'aws-cli/2.6.2 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off command/cloudwatch.describe-alarms', 'X-Amz-Date': b'20231017T093632Z', 'X-Amz-Security-Token': b'REDACTED', 'Authorization': b'AWS4-HMAC-SHA256 Credential=REDACTED/20231017/eu-west-2/monitoring/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-security-token, Signature=REDACTED', 'Content-Length': '40'}>
2023-10-17 10:36:32,422 - MainThread - botocore.httpsession - DEBUG - Certificate path: /usr/local/aws-cli/v2/2.6.2/dist/awscli/botocore/cacert.pem
2023-10-17 10:36:32,423 - MainThread - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): monitoring.eu-west-2.amazonaws.com:443
2023-10-17 10:36:32,671 - MainThread - urllib3.connectionpool - DEBUG - https://monitoring.eu-west-2.amazonaws.com:443 "POST / HTTP/1.1" 200 308
2023-10-17 10:36:32,672 - MainThread - botocore.parsers - DEBUG - Response headers: {'x-amzn-RequestId': 'c9a3d72f-2320-4b8e-b1d4-f05aaff157b0', 'Content-Type': 'text/xml', 'Content-Length': '308', 'Date': 'Tue, 17 Oct 2023 09:36:32 GMT'}
2023-10-17 10:36:32,673 - MainThread - botocore.parsers - DEBUG - Response body:
b'<DescribeAlarmsResponse xmlns="http://monitoring.amazonaws.com/doc/2010-08-01/">\n  <DescribeAlarmsResult>\n    <CompositeAlarms/>\n    <MetricAlarms/>\n  </DescribeAlarmsResult>\n  <ResponseMetadata>\n    <RequestId>c9a3d72f-2320-4b8e-b1d4-f05aaff157b0</RequestId>\n  </ResponseMetadata>\n</DescribeAlarmsResponse>\n'
2023-10-17 10:36:32,674 - MainThread - botocore.hooks - DEBUG - Event needs-retry.cloudwatch.DescribeAlarms: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x7f8fd1ee0a30>>
2023-10-17 10:36:32,675 - MainThread - botocore.retries.standard - DEBUG - Not retrying request.
2023-10-17 10:36:32,675 - MainThread - botocore.hooks - DEBUG - Event after-call.cloudwatch.DescribeAlarms: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x7f8fd1ee05e0>>
{
    "MetricAlarms": [],
    "CompositeAlarms": []
}

Next, to show the problem, we do clear ; (set -x ; python3 --version ; cat test.py; python3 test.py ) and we get a number of exceptions:

+ python3 --version
Python 3.8.10
+ cat test.py
#!/usr/bin/python
import boto3

boto3.set_stream_logger('')

session = boto3.Session()

cw = session.client('cloudwatch')
cw.describe_alarms()
+ python3 test.py
2023-10-17 10:38:59,540 botocore.hooks [DEBUG] Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2023-10-17 10:38:59,541 botocore.hooks [DEBUG] Changing event name from before-call.apigateway to before-call.api-gateway
2023-10-17 10:38:59,542 botocore.hooks [DEBUG] Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2023-10-17 10:38:59,542 botocore.hooks [DEBUG] Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2023-10-17 10:38:59,542 botocore.hooks [DEBUG] Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2023-10-17 10:38:59,543 botocore.hooks [DEBUG] Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2023-10-17 10:38:59,543 botocore.hooks [DEBUG] Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2023-10-17 10:38:59,545 botocore.hooks [DEBUG] Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2023-10-17 10:38:59,545 botocore.hooks [DEBUG] Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2023-10-17 10:38:59,545 botocore.hooks [DEBUG] Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2023-10-17 10:38:59,545 botocore.hooks [DEBUG] Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2023-10-17 10:38:59,555 botocore.utils [DEBUG] IMDS ENDPOINT: http://169.254.169.254/
2023-10-17 10:38:59,556 botocore.credentials [DEBUG] Looking for credentials via: env
2023-10-17 10:38:59,556 botocore.credentials [DEBUG] Looking for credentials via: assume-role
2023-10-17 10:38:59,556 botocore.credentials [DEBUG] Looking for credentials via: assume-role-with-web-identity
2023-10-17 10:38:59,556 botocore.credentials [DEBUG] Looking for credentials via: sso
2023-10-17 10:38:59,557 botocore.loaders [DEBUG] Loading JSON file: /usr/local/lib/python3.8/dist-packages/botocore/data/endpoints.json
2023-10-17 10:38:59,565 botocore.loaders [DEBUG] Loading JSON file: /usr/local/lib/python3.8/dist-packages/botocore/data/sdk-default-configuration.json
2023-10-17 10:38:59,565 botocore.hooks [DEBUG] Event choose-service-name: calling handler <function handle_service_name_alias at 0x7f3cb2b6ed30>
2023-10-17 10:38:59,571 botocore.loaders [DEBUG] Loading JSON file: /usr/local/lib/python3.8/dist-packages/botocore/data/cloudwatch/2010-08-01/service-2.json
2023-10-17 10:38:59,574 botocore.hooks [DEBUG] Event creating-client-class.cloudwatch: calling handler <function add_generate_presigned_url at 0x7f3cb2bcd280>
2023-10-17 10:38:59,575 botocore.endpoint [DEBUG] Setting monitoring timeout as (60, 60)
2023-10-17 10:38:59,576 botocore.loaders [DEBUG] Loading JSON file: /usr/local/lib/python3.8/dist-packages/botocore/data/_retry.json
2023-10-17 10:38:59,576 botocore.client [DEBUG] Registering retry handlers for service: cloudwatch
2023-10-17 10:38:59,577 botocore.hooks [DEBUG] Event before-parameter-build.cloudwatch.DescribeAlarms: calling handler <function generate_idempotent_uuid at 0x7f3cb2b0b820>
2023-10-17 10:38:59,577 botocore.hooks [DEBUG] Event before-call.cloudwatch.DescribeAlarms: calling handler <function add_recursion_detection_header at 0x7f3cb2b0b4c0>
2023-10-17 10:38:59,577 botocore.hooks [DEBUG] Event before-call.cloudwatch.DescribeAlarms: calling handler <function inject_api_version_header_if_needed at 0x7f3cb2b140d0>
2023-10-17 10:38:59,577 botocore.endpoint [DEBUG] Making request for OperationModel(name=DescribeAlarms) with params: {'url_path': '/', 'query_string': '', 'method': 'POST', 'headers': {'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8', 'User-Agent': 'Boto3/1.22.8 Python/3.8.10 Linux/5.10.102.1-microsoft-standard-WSL2 Botocore/1.25.8'}, 'body': {'Action': 'DescribeAlarms', 'Version': '2010-08-01'}, 'url': 'https://monitoring.eu-west-2.amazonaws.com/', 'context': {'client_region': 'eu-west-2', 'client_config': <botocore.config.Config object at 0x7f3cb25e1d30>, 'has_streaming_input': False, 'auth_type': None}}
2023-10-17 10:38:59,577 botocore.hooks [DEBUG] Event request-created.cloudwatch.DescribeAlarms: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f3cb25e1c10>>
2023-10-17 10:38:59,578 botocore.hooks [DEBUG] Event choose-signer.cloudwatch.DescribeAlarms: calling handler <function set_operation_specific_signer at 0x7f3cb2b0b700>
2023-10-17 10:38:59,578 botocore.hooks [DEBUG] Event choose-service-name: calling handler <function handle_service_name_alias at 0x7f3cb2b6ed30>
2023-10-17 10:38:59,578 botocore.loaders [DEBUG] Loading JSON file: /usr/local/lib/python3.8/dist-packages/botocore/data/sso/2019-06-10/service-2.json
2023-10-17 10:38:59,579 botocore.hooks [DEBUG] Event creating-client-class.sso: calling handler <function add_generate_presigned_url at 0x7f3cb2bcd280>
2023-10-17 10:38:59,580 botocore.endpoint [DEBUG] Setting portal.sso timeout as (60, 60)
2023-10-17 10:38:59,581 botocore.client [DEBUG] Registering retry handlers for service: sso
2023-10-17 10:38:59,582 botocore.utils [DEBUG] Failed to load SSO token:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/botocore/credentials.py", line 313, in __getitem__
    with open(actual_key) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/pjd/.aws/sso/cache/da2c179bbf7eb8607985ed57f0e266c9633de16e.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/botocore/utils.py", line 2679, in __call__
    token = self._cache[cache_key]
  File "/usr/local/lib/python3.8/dist-packages/botocore/credentials.py", line 316, in __getitem__
    raise KeyError(cache_key)
KeyError: 'da2c179bbf7eb8607985ed57f0e266c9633de16e'
2023-10-17 10:38:59,583 botocore.credentials [WARNING] Refreshing temporary credentials failed during mandatory refresh period.
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/botocore/credentials.py", line 313, in __getitem__
    with open(actual_key) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/pjd/.aws/sso/cache/da2c179bbf7eb8607985ed57f0e266c9633de16e.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/botocore/utils.py", line 2679, in __call__
    token = self._cache[cache_key]
  File "/usr/local/lib/python3.8/dist-packages/botocore/credentials.py", line 316, in __getitem__
    raise KeyError(cache_key)
KeyError: 'da2c179bbf7eb8607985ed57f0e266c9633de16e'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/botocore/credentials.py", line 549, in _protected_refresh
    metadata = self._refresh_using()
  File "/usr/local/lib/python3.8/dist-packages/botocore/credentials.py", line 690, in fetch_credentials
    return self._get_cached_credentials()
  File "/usr/local/lib/python3.8/dist-packages/botocore/credentials.py", line 700, in _get_cached_credentials
    response = self._get_credentials()
  File "/usr/local/lib/python3.8/dist-packages/botocore/credentials.py", line 2059, in _get_credentials
    'accessToken': self._token_loader(self._start_url),
  File "/usr/local/lib/python3.8/dist-packages/botocore/utils.py", line 2687, in __call__
    raise SSOTokenLoadError(error_msg=error_msg)
botocore.exceptions.SSOTokenLoadError: Error loading SSO Token: The SSO access token has either expired or is otherwise invalid.
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/botocore/credentials.py", line 313, in __getitem__
    with open(actual_key) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/pjd/.aws/sso/cache/da2c179bbf7eb8607985ed57f0e266c9633de16e.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/botocore/utils.py", line 2679, in __call__
    token = self._cache[cache_key]
  File "/usr/local/lib/python3.8/dist-packages/botocore/credentials.py", line 316, in __getitem__
    raise KeyError(cache_key)
KeyError: 'da2c179bbf7eb8607985ed57f0e266c9633de16e'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test.py", line 9, in <module>
    cw.describe_alarms()
  File "/usr/local/lib/python3.8/dist-packages/botocore/client.py", line 415, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/local/lib/python3.8/dist-packages/botocore/client.py", line 731, in _make_api_call
    http, parsed_response = self._make_request(
  File "/usr/local/lib/python3.8/dist-packages/botocore/client.py", line 751, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/usr/local/lib/python3.8/dist-packages/botocore/endpoint.py", line 107, in make_request
    return self._send_request(request_dict, operation_model)
  File "/usr/local/lib/python3.8/dist-packages/botocore/endpoint.py", line 180, in _send_request
    request = self.create_request(request_dict, operation_model)
  File "/usr/local/lib/python3.8/dist-packages/botocore/endpoint.py", line 120, in create_request
    self._event_emitter.emit(event_name, request=request,
  File "/usr/local/lib/python3.8/dist-packages/botocore/hooks.py", line 358, in emit
    return self._emitter.emit(aliased_event_name, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/botocore/hooks.py", line 229, in emit
    return self._emit(event_name, kwargs)
  File "/usr/local/lib/python3.8/dist-packages/botocore/hooks.py", line 212, in _emit
    response = handler(**kwargs)
  File "/usr/local/lib/python3.8/dist-packages/botocore/signers.py", line 95, in handler
    return self.sign(operation_name, request)
  File "/usr/local/lib/python3.8/dist-packages/botocore/signers.py", line 159, in sign
    auth = self.get_auth_instance(**kwargs)
  File "/usr/local/lib/python3.8/dist-packages/botocore/signers.py", line 239, in get_auth_instance
    frozen_credentials = self._credentials.get_frozen_credentials()
  File "/usr/local/lib/python3.8/dist-packages/botocore/credentials.py", line 638, in get_frozen_credentials
    self._refresh()
  File "/usr/local/lib/python3.8/dist-packages/botocore/credentials.py", line 533, in _refresh
    self._protected_refresh(is_mandatory=is_mandatory_refresh)
  File "/usr/local/lib/python3.8/dist-packages/botocore/credentials.py", line 549, in _protected_refresh
    metadata = self._refresh_using()
  File "/usr/local/lib/python3.8/dist-packages/botocore/credentials.py", line 690, in fetch_credentials
    return self._get_cached_credentials()
  File "/usr/local/lib/python3.8/dist-packages/botocore/credentials.py", line 700, in _get_cached_credentials
    response = self._get_credentials()
  File "/usr/local/lib/python3.8/dist-packages/botocore/credentials.py", line 2059, in _get_credentials
    'accessToken': self._token_loader(self._start_url),
  File "/usr/local/lib/python3.8/dist-packages/botocore/utils.py", line 2687, in __call__
    raise SSOTokenLoadError(error_msg=error_msg)
botocore.exceptions.SSOTokenLoadError: Error loading SSO Token: The SSO access token has either expired or is otherwise invalid.

However, if we edit the command and instead do clear ; (set -x ; unset AWS_DEFAULT_PROFILE ; python3 --version ; cat test.py; python3 test.py ) then we get:

+ unset AWS_DEFAULT_PROFILE
+ python3 --version
Python 3.8.10
+ cat test.py
#!/usr/bin/python
import boto3

boto3.set_stream_logger('')

session = boto3.Session()

cw = session.client('cloudwatch')
cw.describe_alarms()
+ python3 test.py
2023-10-17 10:54:13,288 botocore.hooks [DEBUG] Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2023-10-17 10:54:13,290 botocore.hooks [DEBUG] Changing event name from before-call.apigateway to before-call.api-gateway
2023-10-17 10:54:13,290 botocore.hooks [DEBUG] Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2023-10-17 10:54:13,291 botocore.hooks [DEBUG] Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2023-10-17 10:54:13,291 botocore.hooks [DEBUG] Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2023-10-17 10:54:13,292 botocore.hooks [DEBUG] Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2023-10-17 10:54:13,292 botocore.hooks [DEBUG] Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2023-10-17 10:54:13,294 botocore.hooks [DEBUG] Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2023-10-17 10:54:13,294 botocore.hooks [DEBUG] Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2023-10-17 10:54:13,294 botocore.hooks [DEBUG] Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2023-10-17 10:54:13,294 botocore.hooks [DEBUG] Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2023-10-17 10:54:13,304 botocore.utils [DEBUG] IMDS ENDPOINT: http://169.254.169.254/
2023-10-17 10:54:13,305 botocore.credentials [DEBUG] Looking for credentials via: env
2023-10-17 10:54:13,305 botocore.credentials [DEBUG] Looking for credentials via: assume-role
2023-10-17 10:54:13,305 botocore.credentials [DEBUG] Looking for credentials via: assume-role-with-web-identity
2023-10-17 10:54:13,305 botocore.credentials [DEBUG] Looking for credentials via: sso
2023-10-17 10:54:13,306 botocore.loaders [DEBUG] Loading JSON file: /usr/local/lib/python3.8/dist-packages/botocore/data/endpoints.json
2023-10-17 10:54:13,315 botocore.loaders [DEBUG] Loading JSON file: /usr/local/lib/python3.8/dist-packages/botocore/data/sdk-default-configuration.json
2023-10-17 10:54:13,315 botocore.hooks [DEBUG] Event choose-service-name: calling handler <function handle_service_name_alias at 0x7fba7210fd30>
2023-10-17 10:54:13,323 botocore.loaders [DEBUG] Loading JSON file: /usr/local/lib/python3.8/dist-packages/botocore/data/cloudwatch/2010-08-01/service-2.json
2023-10-17 10:54:13,326 botocore.hooks [DEBUG] Event creating-client-class.cloudwatch: calling handler <function add_generate_presigned_url at 0x7fba7216d280>
2023-10-17 10:54:13,327 botocore.endpoint [DEBUG] Setting monitoring timeout as (60, 60)
2023-10-17 10:54:13,329 botocore.loaders [DEBUG] Loading JSON file: /usr/local/lib/python3.8/dist-packages/botocore/data/_retry.json
2023-10-17 10:54:13,329 botocore.client [DEBUG] Registering retry handlers for service: cloudwatch
2023-10-17 10:54:13,330 botocore.hooks [DEBUG] Event before-parameter-build.cloudwatch.DescribeAlarms: calling handler <function generate_idempotent_uuid at 0x7fba720ac820>
2023-10-17 10:54:13,330 botocore.hooks [DEBUG] Event before-call.cloudwatch.DescribeAlarms: calling handler <function add_recursion_detection_header at 0x7fba720ac4c0>
2023-10-17 10:54:13,330 botocore.hooks [DEBUG] Event before-call.cloudwatch.DescribeAlarms: calling handler <function inject_api_version_header_if_needed at 0x7fba720b50d0>
2023-10-17 10:54:13,330 botocore.endpoint [DEBUG] Making request for OperationModel(name=DescribeAlarms) with params: {'url_path': '/', 'query_string': '', 'method': 'POST', 'headers': {'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8', 'User-Agent': 'Boto3/1.22.8 Python/3.8.10 Linux/5.10.102.1-microsoft-standard-WSL2 Botocore/1.25.8'}, 'body': {'Action': 'DescribeAlarms', 'Version': '2010-08-01'}, 'url': 'https://monitoring.eu-west-2.amazonaws.com/', 'context': {'client_region': 'eu-west-2', 'client_config': <botocore.config.Config object at 0x7fba71b82d00>, 'has_streaming_input': False, 'auth_type': None}}
2023-10-17 10:54:13,331 botocore.hooks [DEBUG] Event request-created.cloudwatch.DescribeAlarms: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7fba71b82be0>>
2023-10-17 10:54:13,331 botocore.hooks [DEBUG] Event choose-signer.cloudwatch.DescribeAlarms: calling handler <function set_operation_specific_signer at 0x7fba720ac700>
2023-10-17 10:54:13,331 botocore.hooks [DEBUG] Event choose-service-name: calling handler <function handle_service_name_alias at 0x7fba7210fd30>
2023-10-17 10:54:13,332 botocore.loaders [DEBUG] Loading JSON file: /usr/local/lib/python3.8/dist-packages/botocore/data/sso/2019-06-10/service-2.json
2023-10-17 10:54:13,333 botocore.hooks [DEBUG] Event creating-client-class.sso: calling handler <function add_generate_presigned_url at 0x7fba7216d280>
2023-10-17 10:54:13,334 botocore.endpoint [DEBUG] Setting portal.sso timeout as (60, 60)
2023-10-17 10:54:13,335 botocore.client [DEBUG] Registering retry handlers for service: sso
2023-10-17 10:54:13,338 botocore.hooks [DEBUG] Event before-parameter-build.sso.GetRoleCredentials: calling handler <function generate_idempotent_uuid at 0x7fba720ac820>
2023-10-17 10:54:13,339 botocore.hooks [DEBUG] Event before-call.sso.GetRoleCredentials: calling handler <function add_recursion_detection_header at 0x7fba720ac4c0>
2023-10-17 10:54:13,339 botocore.hooks [DEBUG] Event before-call.sso.GetRoleCredentials: calling handler <function inject_api_version_header_if_needed at 0x7fba720b50d0>
2023-10-17 10:54:13,339 botocore.endpoint [DEBUG] Making request for OperationModel(name=GetRoleCredentials) with params: {'url_path': '/federation/credentials', 'query_string': {'role_name': 'AdministratorAccess', 'account_id': REDACTED}, 'method': 'GET', 'headers': {'x-amz-sso_bearer_token': REDACTED, 'User-Agent': 'Boto3/1.22.8 Python/3.8.10 Linux/5.10.102.1-microsoft-standard-WSL2 Botocore/1.25.8'}, 'body': b'', 'url': 'https://portal.sso.eu-west-2.amazonaws.com/federation/credentials?role_name=AdministratorAccess&account_id=REDACTED', 'context': {'client_region': 'eu-west-2', 'client_config': <botocore.config.Config object at 0x7fba71b23fd0>, 'has_streaming_input': False, 'auth_type': 'none'}}
2023-10-17 10:54:13,339 botocore.hooks [DEBUG] Event request-created.sso.GetRoleCredentials: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7fba71b23f40>>
2023-10-17 10:54:13,339 botocore.hooks [DEBUG] Event choose-signer.sso.GetRoleCredentials: calling handler <function set_operation_specific_signer at 0x7fba720ac700>
2023-10-17 10:54:13,339 botocore.hooks [DEBUG] Event request-created.sso.GetRoleCredentials: calling handler <function add_retry_headers at 0x7fba720b5790>
2023-10-17 10:54:13,339 botocore.endpoint [DEBUG] Sending http request: <AWSPreparedRequest stream_output=False, method=GET, url=https://portal.sso.eu-west-2.amazonaws.com/federation/credentials?role_name=AdministratorAccess&account_id=REDACTED, headers={'x-amz-sso_bearer_token': bREDACTED, 'User-Agent': b'Boto3/1.22.8 Python/3.8.10 Linux/5.10.102.1-microsoft-standard-WSL2 Botocore/1.25.8', 'amz-sdk-invocation-id': b'26427a35-7f93-4fa3-b358-7bbc028ee1da', 'amz-sdk-request': b'attempt=1'}>
2023-10-17 10:54:13,348 botocore.httpsession [DEBUG] Certificate path: /etc/ssl/certs/ca-certificates.crt
2023-10-17 10:54:13,348 urllib3.connectionpool [DEBUG] Starting new HTTPS connection (1): portal.sso.eu-west-2.amazonaws.com:443
2023-10-17 10:54:13,884 urllib3.connectionpool [DEBUG] https://portal.sso.eu-west-2.amazonaws.com:443 "GET /federation/credentials?role_name=AdministratorAccess&account_id=REDACTED HTTP/1.1" 200 1092
2023-10-17 10:54:13,893 botocore.parsers [DEBUG] Response headers: {'Date': 'Tue, 17 Oct 2023 09:54:14 GMT', 'Content-Type': 'application/json', 'Content-Length': '1092', 'Connection': 'keep-alive', 'Access-Control-Expose-Headers': 'RequestId, x-amzn-RequestId', 'Cache-Control': 'no-cache', 'RequestId': '503f59ab-64e4-4865-9e42-74df802935c1', 'Server': 'AWS SSO', 'x-amzn-RequestId': '503f59ab-64e4-4865-9e42-74df802935c1'}
2023-10-17 10:54:13,894 botocore.parsers [DEBUG] Response body:
b'{"roleCredentials":{"accessKeyId":REDACTED,"secretAccessKey":REDACTED,"sessionToken":REDACTED,"expiration":1697565253000}}'
2023-10-17 10:54:13,894 botocore.hooks [DEBUG] Event needs-retry.sso.GetRoleCredentials: calling handler <botocore.retryhandler.RetryHandler object at 0x7fba71af69a0>
2023-10-17 10:54:13,894 botocore.retryhandler [DEBUG] No retry needed.
2023-10-17 10:54:13,896 botocore.credentials [DEBUG] Retrieved credentials will expire at: 2023-10-17 17:54:13+00:00
2023-10-17 10:54:13,898 botocore.auth [DEBUG] Calculating signature using v4 auth.
2023-10-17 10:54:13,898 botocore.auth [DEBUG] CanonicalRequest:
POST
/

content-type:application/x-www-form-urlencoded; charset=utf-8
host:monitoring.eu-west-2.amazonaws.com
x-amz-date:20231017T095413Z
x-amz-security-token:REDACTED

content-type;host;x-amz-date;x-amz-security-token
REDACTED
2023-10-17 10:54:13,898 botocore.auth [DEBUG] StringToSign:
AWS4-HMAC-SHA256
20231017T095413Z
20231017/eu-west-2/monitoring/aws4_request
REDACTED
2023-10-17 10:54:13,898 botocore.auth [DEBUG] Signature:
REDACTED
2023-10-17 10:54:13,898 botocore.hooks [DEBUG] Event request-created.cloudwatch.DescribeAlarms: calling handler <function add_retry_headers at 0x7fba720b5790>
2023-10-17 10:54:13,898 botocore.endpoint [DEBUG] Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://monitoring.eu-west-2.amazonaws.com/, headers={'Content-Type': b'application/x-www-form-urlencoded; charset=utf-8', 'User-Agent': b'Boto3/1.22.8 Python/3.8.10 Linux/5.10.102.1-microsoft-standard-WSL2 Botocore/1.25.8', 'X-Amz-Date': b'20231017T095413Z', 'X-Amz-Security-Token': b'REDACTED', 'Authorization': b'AWS4-HMAC-SHA256 Credential=REDACTED/20231017/eu-west-2/monitoring/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-security-token, Signature=REDACTED', 'amz-sdk-invocation-id': b'REDACTED', 'amz-sdk-request': b'attempt=1', 'Content-Length': '40'}>
2023-10-17 10:54:13,899 botocore.httpsession [DEBUG] Certificate path: /etc/ssl/certs/ca-certificates.crt
2023-10-17 10:54:13,899 urllib3.connectionpool [DEBUG] Starting new HTTPS connection (1): monitoring.eu-west-2.amazonaws.com:443
2023-10-17 10:54:14,090 urllib3.connectionpool [DEBUG] https://monitoring.eu-west-2.amazonaws.com:443 "POST / HTTP/1.1" 200 308
2023-10-17 10:54:14,092 botocore.parsers [DEBUG] Response headers: {'x-amzn-RequestId': '9bc5c2bd-caf2-4508-a620-f1b7051687dd', 'Content-Type': 'text/xml', 'Content-Length': '308', 'Date': 'Tue, 17 Oct 2023 09:54:13 GMT'}
2023-10-17 10:54:14,092 botocore.parsers [DEBUG] Response body:
b'<DescribeAlarmsResponse xmlns="http://monitoring.amazonaws.com/doc/2010-08-01/">\n  <DescribeAlarmsResult>\n    <CompositeAlarms/>\n    <MetricAlarms/>\n  </DescribeAlarmsResult>\n  <ResponseMetadata>\n    <RequestId>9bc5c2bd-caf2-4508-a620-f1b7051687dd</RequestId>\n  </ResponseMetadata>\n</DescribeAlarmsResponse>\n'
2023-10-17 10:54:14,108 botocore.hooks [DEBUG] Event needs-retry.cloudwatch.DescribeAlarms: calling handler <botocore.retryhandler.RetryHandler object at 0x7fba71b23670>
2023-10-17 10:54:14,108 botocore.retryhandler [DEBUG] No retry needed.

TL;DR: unset AWS_DFAULT_PROFILE makes it work ... but AWS_DEFAULT_PROFILE should be ignored because AWS_PROFILE is set.

@github-actions github-actions bot removed closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional information or feedback. labels Oct 18, 2023
@RyanFitzSimmonsAK
Copy link
Contributor

Thanks for following up. The team is aware of this behavior, but fixing it would be considered a breaking change. It is worth noting that AWS_PROFILE is intended to replace AWS_DEFAULT_PROFILE, rather than work simultaneously. I'm going to mark this issue as needing major version and leaving it open for tracking purposes.

@RyanFitzSimmonsAK RyanFitzSimmonsAK added the needs-major-version Can only be considered for the next major release label Oct 24, 2023
@Peter-Darton-i2
Copy link
Author

I understand that changing the actual behaviour would, technically, be a breaking change ... but from my point of view, the existing behaviour is a violation of "the principal of least surprise" (in that I was expecting this to work "just like the AWS cli").
FYI it took me "quite a while" to track down why my python code wasn't working when "the AWS cli worked just fine" - it's really not intuitive as-is.

I wonder if, in the interim, we could have a difficult-to-miss warning telling folks something like "WARNING: Problem exists between keyboard and chair: You've set both AWS_PROFILE and AWS_DEFAULT_PROFILE, and set them to different values. Things are not going to work the way you might expect".

...or, perhaps, introduce a new way (so not a breaking change, just an addition) of getting a boto3.Session that will "behave exactly like the AWS cli" so that folks can write code that calls upon boto3 in a way that it will authenticate "just like the AWS cli" (and then this new way can be made the default behaviour as a needs-major-version breaking change some time in the future).

Basically, I'd like to ensure that my users can't get confused by my (boto3 based) python code behaving differently to the AWS cli. So, if I can't have the default functionality of boto3 changed, I'd either like an easy-to-code workaround, or a warning that users can't miss.

@RyanFitzSimmonsAK RyanFitzSimmonsAK added the bug This issue is a confirmed bug. label Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a confirmed bug. credentials needs-major-version Can only be considered for the next major release p2 This is a standard priority issue
2 participants