AWS Certified Developer – Associate (DVA-C02) — Question 424
A developer is working on an application that will be deployed on AWS. The developer needs to test and debug the code locally. The code is packaged and stored in an Amazon S3 bucket.
How can the developer test and debug the code locally with the LEAST amount of configuration?
Answer options
- A. Create an application and a deployment group in AWS CodeDeploy. For the compute platform, specify the local machine as the individual instance for the deployment. For the repository type, specify that the application is stored in Amazon S3. Start the deployment to test on the local machine.
- B. Create a repository in AWS CodeArtifact. Publish the application code package to the repository. Before deployment, create an upstream repository to test and validate the code.
- C. Create a build project in AWS CodeBuild. In AWS CodePipeline, add a CodeBuild test action by adding a stage and an action. For the action provider, specify a CodeBuild test and the build project. View the build log to see the test results.
- D. Install the AWS CodeDeploy agent locally to validate the deployment package. Run the codedeploy-local command. Specify the S3 bucket where the code package is located by using the --bundle-location option.
Correct answer: D
Explanation
The codedeploy-local tool allows developers to test and debug deployments locally without configuring full deployment groups, pipelines, or registering the local machine as an on-premises instance in the AWS Management Console. By installing the CodeDeploy agent and executing the codedeploy-local command with the --bundle-location option, the developer can directly pull and test the S3-hosted package with minimal overhead. Other options either require extensive cloud-side configuration or do not support direct local execution and debugging.