I set up SSH access to CodeCommit and tested the connection:
You have successfully authenticated over SSH. You can use Git to interact with AWS CodeCommit. Interactive shells are not supported.Connection to git-codecommit.us-east-1.amazonaws.com closed by remote host.
When I attempt to clone or push, I see this error:
Access denied: User: arn:aws:iam::##########:user/[email protected] is not authorized to perform: codecommit:GitPull on resource: arn:aws:codecommit:us-east-1:##########:my-repo
Even after adding a policy to my user to access all operations on this repo, I cannot clone or push.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"codecommit:*"
],
"Resource": [
"arn:aws:codecommit:us-east-1:##########:my-repo"
]
}
]
}
What gives? Is anyone else having trouble with this?
In my case I had a policy that attempted to require MFA login for most things other than setting up MFA in AWS. I ended up adding codecommit as an exemption to the MFA required policy so I didn't have to do anything extra in our developer's environments to handle MFA login for git access to codecommit.
A few things could cause this:
If there are any group permissions denying access to CodeCommit
If you are using multi factor authentication, that will not work with SSH (http://docs.aws.amazon.com/codecommit/latest/userguide/temporary-access.html)
An IAM policy denying access to KMS
If you post this on the AWS forums, we can use your account ID to help you troubleshoot your issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With