Skip to content

git-remote-codecommit fails to recognize the new ~/.aws/config file formats created by AWS CLI v2.9.x #36

@palaniswamy

Description

@palaniswamy

The new AWS CLI v2.9.x creates the following config file:

$ cat ~/.aws/config
[profile ]
sso_session =
sso_account_id =
sso_role_name =
region = us-east-2
[sso-session mac]
sso_start_url =
sso_region =
sso_registration_scopes = sso:account:access

Following git command fails to recognize the above new AWS Config file format:

$ git clone codecommit::<region-name>://<profile-name>@<repo-name>
Cloning into ''...
Traceback (most recent call last):
File "/opt/homebrew/bin/git-remote-codecommit", line 33, in
sys.exit(load_entry_point('git-remote-codecommit==1.16', 'console_scripts', 'git-remote-codecommit')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/git-remote-codecommit/1.16/libexec/lib/python3.11/site-packages/git_remote_codecommit/init.py", line 176, in main
context = Context.from_url(remote_url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/git-remote-codecommit/1.16/libexec/lib/python3.11/site-packages/git_remote_codecommit/init.py", line 148, in from_url
credentials = session.get_credentials()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/git-remote-codecommit/1.16/libexec/lib/python3.11/site-packages/botocore/session.py", line 509, in get_credentials
).load_credentials()
^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/git-remote-codecommit/1.16/libexec/lib/python3.11/site-packages/botocore/credentials.py", line 2095, in load_credentials
creds = provider.load()
^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/git-remote-codecommit/1.16/libexec/lib/python3.11/site-packages/botocore/credentials.py", line 2249, in load
sso_config = self._load_sso_config()
^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/git-remote-codecommit/1.16/libexec/lib/python3.11/site-packages/botocore/credentials.py", line 2239, in _load_sso_config
raise InvalidConfigError(
botocore.exceptions.InvalidConfigError: The profile "" is configured to use SSO but is missing required configuration: sso_start_url, sso_region

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions