Open palaniswamy opened 1 year ago
As I attempt to dig deeper, I see the following two different credentials.py
1) /opt/homebrew/Cellar/git-remote-codecommit/1.16/libexec/lib/python3.11/site-packages/botocore/credentials.py which is coming from botocore python package.
2) /opt/homebrew/Cellar/awscli/2.9.5/libexec/lib/python3.11/site-packages/awscli/botocore/credentials.py which is embedded in the awscli python package.
As you can see, I have installed awscli as well as git-remote-codecommit using homebrew and they are latest versions.
The upstream botocore seem to support sso-session (https://github.com/boto/botocore/pull/2812). This "git-remote-codecommit" may just need to use the latest botocore to resolve this issue.
Why is all the AWS software so unbelievably incomplete and/or broken? You've even created a PR for this and they are still sleeping their deepest sleep...
I've pinged the CodeCommit team.
@justinmk3 - any update on this issue?
I'm running into the same situation.
I have found that I get the same errors mentioned above by @palaniswamy when using a profile configured through aws configure sso
and activated using aws sso login --profile <profileName>
.
Further, I have set up two remotes to the same repo, one using the codecommit::...
configuration and one using the https://git-codecommit.....
configuration.
After setting up my gitconfig
with a specific credential.https://git-codecommit...helper=!aws codecommit credential-helper --profile... $@
and credential.https://git-codecommit....usehttppath=true
, I CAN access the repo using the https://git-codecommit....
remote.
Any updates on this are appreciated.
When will this be handled?
It works if you use the "legacy" configuration, by not providing a session name to aws configure sso
as described here:
https://docs.aws.amazon.com/cli/latest/userguide/sso-configure-profile-legacy.html
+1
The new AWS CLI v2.9.x creates the following config file:
$]
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
cat ~/.aws/config
[profileFollowing git command fails to recognize the above new AWS Config file format:
$'...
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
git clone codecommit::<region-name>://<profile-name>@<repo-name>
Cloning into '