Refining Access to Branches in AWS CodeCommit | AWS DevOps Blog

PHOTO EMBED

Wed Aug 26 2020 15:53:02 GMT+0000 (Coordinated Universal Time)

Saved by @kevin.riste@fjorgedigital.com #json

{
    "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
                }
            }
        }
    ]
}
content_copyCOPY

https://aws.amazon.com/blogs/devops/refining-access-to-branches-in-aws-codecommit/