Created
September 11, 2021 04:33
-
-
Save amith23/fec816419c20c950f04c9bd2f33def9b to your computer and use it in GitHub Desktop.
Sample IAM policy to restrict access to code commit branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Deny", | |
"Action": [ | |
"codecommit:GitPush", | |
"codecommit:DeleteBranch", | |
"codecommit:PutFile", | |
"codecommit:MergePullRequestByFastForward" | |
], | |
"Resource": "arn:aws:codecommit:us-east-2:xxxxxxx:reponame", | |
"Condition": { | |
"StringEqualsIfExists": { | |
"codecommit:References": [ | |
"refs/heads/master" | |
] | |
}, | |
"Null": { | |
"codecommit:References": false | |
} | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment