ef-labs / stash-hook-mirror

An Atlassian Stash repository hook for mirroring to one or more remote git repositories.
MIT License
77 stars 58 forks source link

Feature: Mirror to CodeCommit. #41

Closed brettswift closed 4 years ago

brettswift commented 7 years ago

Mirroring to CodeCommit on AWS would be nice. It's a bit more complicated and would require some configuration, however I think it would be doable.

An alternative but less desireable method would be to zip the repo up and ship it to S3, more specifically a URL - like API Gateway. However with repos that get a lot of use it might be best to stick with CodeCommit.

adrianluisgonzalez commented 7 years ago

What changes would be required for CodeCommit?

It looks like it supports https and ssh with granular IAM control: http://docs.aws.amazon.com/codecommit/latest/userguide/getting-started.html#getting-started-permissions

bradleybensmith commented 7 years ago

I just did this myself. You have to use an IAM user. Create or edit an existing IAM user and at the bottom of the "Security credentials" tab, there's a section called "HTTPS Git credentials for AWS CodeCommit" to generate a username/password for HTTPS access. You can also use SSH by uploading a public key and then it generates an "SSH key ID" which you use as the username.

You'll have to attach a policy that grants access to the repo ARN. See the IAM docs for that.

See http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-without-cli.html for more information.