Create a code commit repository and then create a new branch where developer can make their changes and can create a pull request
It will ask Shruti.Vij IAM user to review and approve the changes.
- Approve the request
Note - You can not approve your own created PR.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"codecommit:GitPush",
"codecommit:DeleteBranch",
"codecommit:PutFile",
"codecommit:MergeBranchesByFastForward",
"codecommit:MergeBranchesBySquash",
"codecommit:MergeBranchesByThreeWay",
"codecommit:MergePullRequestByFastForward",
"codecommit:MergePullRequestBySquash",
"codecommit:MergePullRequestByThreeWay"
],
"Resource": "<REPO-ARN>",
"Condition": {
"StringEqualsIfExists": {
"codecommit:References": [
"refs/heads/main",
"refs/heads/uat",
"refs/heads/prod"
]
},
"Null": {
"codecommit:References": false
}
}
}
]
}
It will restrict the user to perform these actions.