AWS Certified Developer – Associate (DVA-C02) practice questions

208 free questions with answers and explanations.

Practice test
  1. 1.A security-conscious development team needs to deploy an AWS Lambda function that processes sensitive customer data. The function must only be invoked by a specific Amazon SQS queue in the same AWS account and region, and no other service or user should be able to trigger it. How should the developer configure the Lambda function's permissions to meet this requirement?Deployment
  2. 2.A developer is configuring an AWS CloudFormation template to deploy an application consisting of an Amazon RDS database and an Auto Scaling Group of EC2 instances. They want to ensure that the database is fully provisioned and ready to accept connections before the EC2 instances, which depend on the database, are launched. How can this dependency be expressed in the CloudFormation template?Deployment
  3. 3.A developer is configuring an AWS CodeBuild project for a large application. The build process involves downloading many external dependencies that rarely change, which significantly increases build times. The team wants to optimize build performance by caching these dependencies. The CodeBuild project is used by multiple pipelines, and the cache needs to be persistent and accessible across different build runs and projects. Which caching mechanism should be implemented?Deployment
  4. 4.A development team is deploying a new version of their web application to Amazon EC2 instances. They want to ensure that the new application version is rolled out gradually to a small subset of instances first, and if no issues are detected, it is then deployed to the remaining instances. Which AWS CodeDeploy deployment type should they choose to achieve this strategy?Deployment
  5. 5.A developer is configuring an AWS CodeBuild project for a large application that has many dependencies. The build times are consistently long due to repeated downloading and installation of these dependencies in every build. The developer wants to optimize build times by caching these dependencies. Which CodeBuild feature should they implement to achieve this?Deployment
  6. 6.A development team is using AWS CodePipeline to automate their software release process. They have multiple environments (Dev, Test, Prod) and require a manual approval step before deploying to the Production environment. How can they implement this manual approval within CodePipeline?Deployment
  7. 7.A company is using AWS CodePipeline to deploy a serverless application consisting of AWS Lambda functions. They want to implement a deployment strategy that gradually shifts traffic to the new Lambda function version and automatically rolls back if errors are detected. They also need to ensure that the new version is tested with a small percentage of production traffic before full cutover. Which deployment type in CodeDeploy for Lambda should they configure?Deployment
  8. 8.A developer is configuring an AWS CodeBuild project to build a containerized application. The build process requires pulling a base image from a private Amazon ECR repository and then pushing the final built image to another ECR repository. What IAM permissions are essential for the CodeBuild service role to successfully perform these actions?Deployment
  9. 9.A company is using AWS CodePipeline to automate its software release process. They have a stage that deploys an application to Amazon EC2 instances using AWS CodeDeploy. After deployment, they need to run a series of integration tests. Where should the commands for these integration tests be specified within the CodeDeploy deployment lifecycle?Deployment
  10. 10.A company is using AWS CodePipeline to deploy a serverless application consisting of a web frontend hosted on Amazon S3 and an API built with AWS Lambda and Amazon API Gateway. They want to implement an automated testing stage after the API deployment, but before the frontend deployment, to ensure the new API version is functional. Which CodePipeline action type should be used to run these API integration tests?Deployment
  11. 11.A developer needs to deploy a new version of a critical web application to Amazon EC2 instances using AWS CodeDeploy. Before the new application version starts serving traffic, a set of automated integration tests must be executed to validate its health and functionality. If these tests fail, the deployment must automatically roll back. Which CodeDeploy lifecycle event hook is best suited for running these validation tests immediately after the new application has started?Deployment
  12. 12.A company is migrating a monolithic application to microservices using AWS Fargate. They need to ensure that when a new version of a microservice is deployed, traffic is gradually shifted to the new version while monitoring for errors, and automatically rolled back if issues are detected. Which deployment strategy should they use?Deployment
  13. 13.A development team uses AWS CodePipeline to automate deployments. They have multiple stages, including Build, Test, and Production Deployment. They need to ensure that an approval step is required before deploying to the Production stage. How can this be configured in AWS CodePipeline?Deployment
  14. 14.A developer is deploying a containerized application to Amazon ECS using AWS Fargate. They want to ensure that the application's configuration, such as database connection strings and API keys, can be easily updated without rebuilding the Docker image or redeploying the entire service. The configuration should be accessible by the containers at runtime. Which approach should the developer take?Deployment
  15. 15.A company uses AWS CodeCommit for their source code repository and AWS CodePipeline to automate their CI/CD process. They need to ensure that every code change pushed to a specific branch in CodeCommit automatically triggers a new pipeline execution. What is the most efficient way to configure this integration?Deployment
  16. 16.A developer needs to deploy a new feature to an existing application running on Amazon EC2 instances managed by an Auto Scaling Group. The deployment must ensure zero downtime and provide an easy rollback mechanism if issues are detected. The new feature requires a database schema change that must be applied before the new application version receives traffic. Which AWS CodeDeploy deployment type and configuration would best meet these requirements?Deployment
  17. 17.A development team uses AWS CodeCommit for their source code repository and AWS CodePipeline for CI/CD. They want to ensure that every pull request (PR) merge to the `main` branch automatically triggers a build and a suite of unit tests before the code is deployed. How can they configure CodePipeline to achieve this?Deployment
  18. 18.A developer needs to deploy an AWS Lambda function that processes sensitive customer data. The function needs to connect to an Amazon RDS database instance located in a private subnet within a VPC. Additionally, the Lambda function should only access specific AWS services (e.g., S3, DynamoDB) via private endpoints, without routing traffic through the public internet. How should the Lambda function be configured?Deployment
  19. 19.A company is using AWS CodePipeline to automate the deployment of a containerized application to Amazon ECS. They need to ensure that database schema migrations are executed successfully before the new application containers are brought online, and that a rollback mechanism is in place if the migrations fail. Which CodePipeline action type and integration would best support this requirement?Deployment
  20. 20.A development team uses AWS CodeBuild for continuous integration. They need to ensure that specific sensitive environment variables, such as API keys, are available during the build process but are not exposed in plain text in the build logs or source code. How should these variables be securely managed and injected into the CodeBuild environment?Deployment
  21. 21.A company is deploying a new version of their web application to an Auto Scaling group of EC2 instances using AWS CodeDeploy. They want to ensure that the new version is thoroughly tested before it fully replaces the old version, allowing for a gradual rollout and easy rollback if issues are detected. Which CodeDeploy deployment type best fits these requirements?Deployment
  22. 22.A developer is deploying a serverless application using AWS Lambda and Amazon API Gateway. They need to ensure that different environments (development, staging, production) can have their own isolated Lambda function versions and API Gateway stages. Which deployment strategy best supports this requirement?Deployment
  23. 23.A developer is building a serverless application using AWS Lambda and Amazon API Gateway. They need to implement a blue/green deployment strategy for their Lambda function to minimize downtime and provide an easy rollback mechanism. How can this be achieved using existing AWS services?Deployment
  24. 24.A developer needs to deploy a new version of an application to an Auto Scaling group of EC2 instances. They want to ensure that the deployment process updates instances one by one, replacing them with new instances running the updated application, while maintaining application availability. The old instances should be terminated only after the new instances are successfully launched and registered with the load balancer. Which CodeDeploy deployment type, combined with an Auto Scaling group, achieves this goal most efficiently?Deployment
  25. 25.A developer is configuring an AWS CodePipeline to deploy a static website to an Amazon S3 bucket. After the new website files are deployed to S3, users are still seeing the old content due to caching by Amazon CloudFront. The developer needs to automate the process of clearing the CloudFront cache as part of the pipeline. Which CodePipeline action type should be used for this purpose?Deployment
  26. 26.A developer needs to ensure that an AWS Lambda function, which processes sensitive customer data, can only be invoked by an Amazon API Gateway endpoint and no other AWS service or user. Which security mechanism should be implemented on the Lambda function?Deployment
  27. 27.A developer needs to automate the deployment of an application that consists of an Amazon EC2 instance and an Amazon RDS database. The deployment process should create or update these resources, including their configurations (e.g., instance type, database size, security groups), in a repeatable and version-controlled manner. Which AWS service is best suited for this infrastructure as code (IaC) requirement?Deployment
  28. 28.A developer is building an application that needs to receive real-time notifications about changes to objects in an Amazon S3 bucket. They want to trigger an AWS Lambda function whenever a new object is created in a specific S3 prefix. Which method should the developer use to configure this event notification?Deployment
  29. 29.A company is using AWS CodePipeline to deploy a serverless application. The pipeline includes stages for Source, Build, and Deploy. In the Deploy stage, they are using an AWS CloudFormation action to update the serverless stack. They have noticed that sometimes, during a deployment, new Lambda function versions are created, but the API Gateway stage is not immediately updated to point to the latest Lambda version, causing inconsistencies. How can they ensure that the API Gateway stage always points to the latest deployed Lambda function version automatically?Deployment
  30. 30.A developer is configuring an AWS CodeBuild project to build a Docker image and push it to Amazon ECR. The CodeBuild project needs to assume an IAM role that has permissions to push images to ECR. Which CodeBuild environment variable should be set to automatically retrieve and use temporary credentials for the build process?Deployment
  31. 31.A developer is configuring an AWS CodeBuild project for a large application that has many dependencies. The build process frequently downloads the same dependencies from external repositories, leading to long build times. The developer wants to optimize build times by reusing previously downloaded dependencies. Which CodeBuild feature should be used to achieve this efficiently?Deployment
  32. 32.A developer is configuring an AWS CodePipeline to deploy a serverless application consisting of AWS Lambda functions, Amazon API Gateway, and Amazon DynamoDB tables. The pipeline needs to automatically create and manage these resources. Which type of deployment action should be used in the deployment stage of the CodePipeline?Deployment
  33. 33.A development team is deploying a new version of a critical web application to Amazon EC2 instances using AWS CodeDeploy. They need to ensure that the application is fully functional and responsive before any traffic is routed to the newly deployed instances. If the application does not pass these health checks, the deployment should automatically roll back. Which CodeDeploy lifecycle event hook and associated action should be used to achieve this?Deployment
  34. 34.A developer is configuring an AWS CodePipeline to deploy a web application to Amazon S3 and Amazon CloudFront. After the new version of the application is uploaded to S3, the CloudFront distribution needs to be invalidated to ensure users receive the latest content. Which action type should be used in CodePipeline to automate this CloudFront invalidation?Deployment
  35. 35.A developer needs to deploy a new version of a serverless application consisting of AWS Lambda functions and Amazon API Gateway endpoints. The deployment strategy requires routing a small percentage of production traffic to the new Lambda function version for a short period to monitor for errors before shifting 100% of the traffic. Which AWS CodeDeploy deployment configuration should be used for this scenario?Deployment
  36. 36.A developer is deploying an application to Amazon EC2 instances using AWS CodeDeploy. They need to execute a custom script on each instance immediately after the new application revision files have been copied to the instance, but before the application's dependencies are installed or the application starts. Which CodeDeploy lifecycle event hook should they use in their `appspec.yml` file?Deployment
  37. 37.A developer needs to deploy an AWS Lambda function that processes sensitive customer data. To meet compliance requirements, the Lambda function must only be able to access specific Amazon S3 buckets and a particular Amazon DynamoDB table. Additionally, the function should not have public internet access. How should the developer configure the Lambda function and its permissions?Deployment
  38. 38.A company uses AWS CodePipeline to deploy its microservices to Amazon ECS. Each microservice has its own pipeline. They want to ensure that the latest approved Docker image from an Amazon ECR repository is used in the ECS task definition during deployment, without hardcoding image tags in the source code or build process. How can this be achieved reliably?Deployment
  39. 39.A developer is building a serverless application using AWS Lambda and Amazon API Gateway. They need to ensure that different versions of their Lambda function can be invoked through the same API Gateway endpoint, allowing for controlled traffic shifting between versions. Which Lambda feature, when combined with API Gateway stages, enables this functionality?Deployment
  40. 40.A company is performing a blue/green deployment of a new application version to an Amazon ECS service using AWS CodeDeploy. They want to shift traffic to the new task set in stages: 10% for 5 minutes, then 50% for 10 minutes, and finally 100%. During these stages, they need to run automated integration tests to ensure the new version is healthy before proceeding to the next traffic shift. How can this be effectively configured?Deployment
  41. 41.A developer is configuring an AWS CodeBuild project that needs to fetch sensitive configuration parameters, such as API keys and database credentials, during the build process. These parameters are stored securely in AWS Systems Manager Parameter Store. How should the developer configure CodeBuild to access these parameters securely?Deployment
  42. 42.A company is experiencing slow build times in their AWS CodeBuild projects. They have identified that downloading dependencies and Docker images takes a significant portion of the build duration. The builds are frequently run on the same or similar codebases. What is the most effective way to reduce build times in this scenario?Deployment
  43. 43.A company is planning to migrate an on-premises application to AWS. The application consists of several web servers and a database. They want to use AWS CodeDeploy for automated deployments to Amazon EC2 instances. To prepare the on-premises servers for CodeDeploy, they need to install and configure an agent. Which agent needs to be installed on the on-premises servers to enable CodeDeploy deployments?Deployment
  44. 44.A software company is developing a new serverless application that utilizes AWS Lambda functions. They want to ensure that all Lambda function code is packaged and deployed consistently across different environments (development, staging, production) using Infrastructure as Code. Which AWS service is best suited for defining and deploying these serverless resources?Deployment
  45. 45.A development team is deploying a new web application that uses an Amazon RDS database. They want to ensure that database credentials are securely managed and rotated automatically without hardcoding them in the application code. Which AWS service should the team use to meet this requirement?Deployment
  46. 46.A company is using AWS CodeDeploy to deploy a new version of its web application to an Auto Scaling group of Amazon EC2 instances. During the deployment, they need to execute a custom script on each instance to update local configuration files immediately after the new application revision is downloaded, but before the application traffic is rerouted. Which CodeDeploy lifecycle event hook should be used for this purpose?Deployment
  47. 47.A company is using AWS CodePipeline to deploy its microservices to Amazon ECS. Each microservice has its own CodePipeline. When a new Docker image is pushed to Amazon ECR, the corresponding CodePipeline should automatically detect the new image and update the ECS service. Which action type should be used in CodePipeline to achieve this automatic update of the ECS service with the new image?Deployment
  48. 48.A development team is deploying a new version of their Node.js web application to an Amazon EC2 instance using AWS CodeDeploy. They need to ensure that specific dependencies are installed and environment variables are set up before the application starts. Which CodeDeploy lifecycle event hook should they use for installing dependencies and configuring the environment?Deployment
  49. 49.A developer is building a web application that needs to securely store configuration data, such as database connection strings and environment variables. This data must be encrypted at rest and easily retrievable by the application. The solution should also support versioning of the configuration data. Which AWS service is best suited for this purpose?Security
  50. 50.A developer is building an application that needs to securely store and retrieve binary files, such as images and videos. These files are frequently accessed, and the application requires high durability and availability. Which AWS service is the MOST appropriate for storing these files?Development with AWS Services