Reputation: 33
Good afternoon,
Im searching for hours and didnt find anything, its possible to disable some users to push on master in AWS Codecommit?
Best regards, Fellipe M.
Upvotes: 2
Views: 3324
Reputation: 1
Currently branch level permissions are not available in AWS CodeCommit.
Upvotes: 0
Reputation: 101
On the 16th of May 2018 AWS announced "CodeCommit now enables you to restrict who can commit changes to the master branch or any branch of your choosing"
You will need to create a IAM policy and attach it to the restricted group or user. Below is the example IAM policy. Update "Resource" with the desired arn or *
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"codecommit:GitPush",
"codecommit:DeleteBranch",
"codecommit:PutFile",
"codecommit:MergePullRequestByFastForward"
],
"Resource": "arn:aws:codecommit:us-east-2:80398EXAMPLE:MyDemoRepo",
"Condition": {
"StringEqualsIfExists": {
"codecommit:References": [
"refs/heads/master"
]
},
"Null": {
"codecommit:References": false
}
}
}
]
}
Below is the link to the original blog post https://aws.amazon.com/blogs/devops/refining-access-to-branches-in-aws-codecommit/
Upvotes: 2