2

I want to generate a git username/password for CodeCommit, I see how to do that from the AWS Web Console , but is there a way to do it via the aws cli?

RubenLaguna
  • 21,435
  • 13
  • 113
  • 151

1 Answers1

2

You can use aws iam create-service-specific-credential, documented here

 aws iam create-service-specific-credential --service-name codecommit.amazonaws.com --user-name xxxxxx
{
    "ServiceSpecificCredential": {
        "CreateDate": "2022-10-28T12:19:19+00:00",
        "ServiceName": "codecommit.amazonaws.com",
        "ServiceUserName": "xxxxxx-at-yyyyyyyyyyyy",
        "ServicePassword": "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ",
        "ServiceSpecificCredentialId": "LLLLLLLLLLLLLLLLLLLLL",
        "UserName": "xxxxxx",
        "Status": "Active"
    }
}

The ServiceUserName can be used as git user and ServicePassword can be used as git password.

RubenLaguna
  • 21,435
  • 13
  • 113
  • 151