AWS Certified Developer Associate DVA-C02 Practice Question
A development team stores its application source code in an AWS CodeCommit repository named MyRepo. The team must ensure that only senior developers can update the main branch (refs/heads/main). All other developers should submit their changes through pull requests that receive at least one approval from a senior developer before the changes can be merged.
Which approach will meet these requirements?
Enable the Auto-merge feature in CodeCommit and configure it to block direct pushes to the main branch.
Create a CloudWatch Events rule that invokes an AWS Lambda function to delete any commit made directly to the main branch.
Attach an IAM policy with a Deny effect on codecommit:GitPush and merge actions that applies only when codecommit:References equals refs/heads/main to the IAM group for non-senior developers.
Replicate the repository by using AWS CloudFormation StackSets and restrict write permissions on the replicated repository instead of the original repository.
An IAM conditional policy can apply a Deny effect to CodeCommit actions such as codecommit:GitPush and codecommit:MergePullRequest* when the request targets refs/heads/main. By attaching this policy to the IAM roles or groups used by non-senior developers, pushes and merges to the main branch are blocked for them. Senior developers who are not subject to the deny condition can still push directly or merge approved pull requests, and pull-request approval rules can enforce the required review before merges. The other options either operate outside CodeCommit, do not block direct pushes, or introduce unnecessary complexity.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What are branch policies in AWS CodeCommit?
Open an interactive chat with Bash
How do pull requests work in CodeCommit?
Open an interactive chat with Bash
What is the significance of restricting commits to the master branch?
Open an interactive chat with Bash
AWS Certified Developer Associate DVA-C02
Deployment
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access