DVA-C02 sample exam questions
15 exam-style questions for AWS DVA-C02: Developer Associate, with answers and explanations. Take them as a timed practice exam first if you want a score out of 1000.
- A developer is creating a template that uses AWS CloudFormation to deploy an application. The application is serverless and uses Amazon API Gateway, Amazon DynamoDB, and AWS Lambda.
Which AWS service or tool should the developer use to define serverless resources in YAML?- ACloudFormation serverless intrinsic functions
- BAWS Elastic Beanstalk
- CAWS Serverless Application Model (AWS SAM)
- DAWS Cloud Development Kit (AWS CDK)
Show answer
Correct answer: C
WhyAWS SAM extends CloudFormation with a short YAML syntax for serverless resources. CloudFormation has no serverless intrinsic functions, Elastic Beanstalk runs applications on servers, and AWS CDK defines infrastructure in programming languages.
- A
- A development team wants to build a continuous integration/continuous delivery (CI/CD) pipeline. The team is using AWS CodePipeline to automate the code build and deployment. The team wants to store the program code to prepare for the CI/CD pipeline.
Which AWS service should the team use to store the program code?- AAWS CodeDeploy
- BAWS CodeArtifact
- CAWS CodeCommit
- DAmazon CodeGuru
Show answer
Correct answer: C
WhyAWS CodeCommit is a source control repository for program code, which can be a pipeline's source. CodeDeploy deploys, CodeArtifact stores packages, and CodeGuru reviews code. AWS has since limited CodeCommit for new customers, so this question reflects an older recommendation.
- A
- A company has deployed an application on AWS Elastic Beanstalk. The company has configured the Auto Scaling group that is associated with the Elastic Beanstalk environment to have five Amazon EC2 instances. If the capacity is fewer than four EC2 instances during the deployment, application performance degrades. The company is using the all-at-once deployment policy.
What is the MOST cost-effective way to solve the deployment issue?- AChange the Auto Scaling group to six desired instances.
- BChange the deployment policy to traffic splitting. Specify an evaluation time of 1 hour.
- CChange the deployment policy to rolling with additional batch. Specify a batch size of 1.
- DChange the deployment policy to rolling. Specify a batch size of 2.
Show answer
Correct answer: C
WhyRolling with additional batch adds one new instance first, so capacity stays at five during deployment. Rolling with a batch size of 2 drops capacity to 3, traffic splitting doubles instances for longer, and keeping six instances costs more all the time.
- A
- A company is planning to deploy an application on AWS behind an Elastic Load Balancer. The application uses an HTTP/HTTPS listener and must access the client IP addresses.
Which load-balancing solution meets these requirements?- AUse an Application Load Balancer and the X-Forwarded-For headers.
- BUse a Network Load Balancer (NLB). Enable proxy protocol support on the NLB and the target application.
- CUse an Application Load Balancer. Register the targets by the instance ID.
- DUse a Network Load Balancer and the X-Forwarded-For headers.
Show answer
Correct answer: A
WhyAn ALB handles HTTP and HTTPS and passes the client's address in the X-Forwarded-For header. An NLB does not use HTTP headers, and registering targets by instance ID alone does not give an application the client IP in this case.
- A
- A developer is building a highly secure healthcare application using serverless components. This application requires writing temporary data to /tmp storage on an AWS Lambda function.
How should the developer encrypt this data?- AEnable Amazon EBS volume encryption with an AWS KMS key in the Lambda function configuration so that all storage attached to the Lambda function is encrypted.
- BSet up the Lambda function with a role and key policy to access an AWS KMS key. Use the key to generate a data key used to encrypt all data prior to writing to /tmp storage.
- CUse OpenSSL to generate a symmetric encryption key on Lambda startup. Use this key to encrypt the data prior to writing to /tmp.
- DUse an on-premises hardware security module (HSM) to generate keys, where the Lambda function requests a data key from the HSM and uses that to encrypt data on all requests to the function.
Show answer
Correct answer: B
WhyA KMS key with a role and key policy can generate a data key to encrypt data before writing to /tmp. Lambda does not use EBS volumes, a key generated with OpenSSL is not managed or protected, and on-premises HSM calls add latency and complexity.
- A
- A developer is creating a Ruby application and needs to automate the deployment, scaling, and management of an environment without requiring knowledge of the underlying infrastructure.
Which service would best accomplish this task?- AAWS CodeDeploy
- BAWS CloudFormation
- CAWS OpsWorks
- DAWS Elastic Beanstalk
Show answer
Correct answer: D
WhyAWS Elastic Beanstalk deploys, scales and manages Ruby applications and hides the infrastructure. CodeDeploy only deploys code, CloudFormation requires defining resources, and OpsWorks requires configuration management knowledge.
- A
- A company built a new application in the AWS Cloud. The company automated the bootstrapping of new resources with an Auto Scaling group by using AWS CloudFormation templates. The bootstrap scripts contain sensitive data.
The company needs a solution that is integrated with CloudFormation to manage the sensitive data in the bootstrap scripts.
Which solution will meet these requirements in the MOST secure way?- APut the sensitive data into a CloudFormation parameter. Encrypt the CloudFormation templates by using an AWS Key Management Service (AWS KMS) key.
- BPut the sensitive data into an Amazon S3 bucket. Update the CloudFormation templates to download the object from Amazon S3 during bootstrap.
- CPut the sensitive data into AWS Systems Manager Parameter Store as a secure string parameter. Update the CloudFormation templates to use dynamic references to specify template values.
- DPut the sensitive data into Amazon Elastic File System (Amazon EFS). Enforce EFS encryption after file system creation. Update the CloudFormation templates to retrieve data from Amazon EFS.
Show answer
Correct answer: C
WhyA secure string in Parameter Store with a dynamic reference keeps sensitive data out of the template. A CloudFormation parameter does not store it securely, and S3 or EFS downloads do not integrate this way and need separate protection.
- A
- Given the following AWS CloudFormation template:

What is the MOST efficient way to reference the new Amazon S3 bucket from another AWS CloudFormation template?- AAdd an Export declaration to the Outputs section of the original template and use ImportValue in other templates.
- BAdd Exported: true to the Content.Bucket in the original template and use ImportResource in other templates.
- CCreate a custom AWS CloudFormation resource that gets the bucket name from the ContentBucket resource of the first stack.
- DUse Fn::Include to include the existing template in other templates and use the ContentBucket resource directly.
Show answer
Correct answer: A
WhyAn Export in the Outputs section with Fn::ImportValue in other templates is CloudFormation's built-in way to reference across stacks. There is no Exported property or ImportResource for this, a custom resource adds work, and Fn::Include would not reference the existing bucket.
- A
- A developer is writing an application that will retrieve sensitive data from a third-party system. The application will format the data into a PDF file. The PDF file could be more than 1 MB. The application will encrypt the data to disk by using AWS Key Management Service (AWS KMS). The application will decrypt the file when a user requests to download it. The retrieval and formatting portions of the application are complete.
The developer needs to use the GenerateDataKey API to encrypt the PDF file so that the PDF file can be decrypted later. The developer needs to use an AWS KMS symmetric customer managed key for encryption.
Which solutions will meet these requirements?- AWrite the encrypted key from the GenerateDataKey API to disk for later use. Use the plaintext key from the GenerateDataKey API and a symmetric encryption algorithm to encrypt the file.
- BWrite the plain text key from the GenerateDataKey API to disk for later use. Use the encrypted key from the GenerateDataKey API and a symmetric encryption algorithm to encrypt the file.
- CWrite the encrypted key from the GenerateDataKey API to disk for later use. Use the plaintext key from the GenerateDataKey API to encrypt the file by using the KMS Encrypt API.
- DWrite the plain text key from the GenerateDataKey API to disk for later use. Use the encrypted key from the GenerateDataKey API to encrypt the file by using the KMS Encrypt API.
Show answer
Correct answer: A
WhyEncrypt the file with the plaintext data key and a symmetric algorithm, then keep only the encrypted key for later decryption. A plaintext key must never be stored on disk, and the KMS Encrypt API handles only up to 4 KB of data.
- A
- A developer created an AWS Lambda function that performs a series of operations that involve multiple AWS services. The function's duration time is higher than normal. To determine the cause of the issue, the developer must investigate traffic between the services without changing the function code.
Which solution will meet these requirements?- AEnable AWS X-Ray active tracing in the Lambda function. Review the logs in X-Ray.
- BConfigure AWS CloudTrail. View the trail logs that are associated with the Lambda function.
- CReview the AWS Config logs in Amazon CloudWatch.
- DReview the Amazon CloudWatch logs that are associated with the Lambda function.
Show answer
Correct answer: A
WhyX-Ray active tracing records calls from a function to other services with no code changes for this basic view. CloudTrail records API activity rather than timing, AWS Config tracks resource configuration, and function logs do not show traffic between services.
- A
- A company used AWS to develop an application for customers. The application includes an Amazon API Gateway API that invokes AWS Lambda functions. The Lambda functions process data and store the data in Amazon DynamoDB tables.
The company must monitor the entire application to identify potential bottlenecks in the architecture that can negatively affect customers.
Which solution will meet this requirement with the LEAST development effort?- AInstrument the application with AWS X-Ray. Inspect the service map to identify errors and issues.
- BConfigure Lambda exceptions and additional logging to Amazon CloudWatch. Use CloudWatch Logs Insights to query the logs.
- CConfigure API Gateway to log responses to Amazon CloudWatch. Create a metric filter for the TooManyRequestsException error message.
- DUse Amazon CloudWatch metrics for the DynamoDB tables to identify all the ProvisionedThroughputExceededException error messages.
Show answer
Correct answer: A
WhyAWS X-Ray works with API Gateway, Lambda and DynamoDB, and its service map shows bottlenecks across the application. Logs and metrics in the other options each cover only part of the application or require more work.
- A
- A developer is creating an application on Amazon Elastic Container Service (Amazon ECS). The developer needs to configure the application parameters. The developer must configure limits for the application's maximum number of simultaneous connections and maximum number of transactions per second.
The maximum number of connections and transactions can change in the future. The developer needs a solution that can automatically deploy these changes to the application, as needed, without causing downtime.
Which solution will meet these requirements?- AMake the configuration changes for the application. Use AWS CodeDeploy to create a deployment configuration. Specify an in-place deployment to deploy the changes.
- BBootstrap the application to use the AWS Cloud Development Kit (AWS CDK) and make the configuration changes. Specify the ECSCanary10Percent15Minutes launch type in the properties section of the ECS resource. Deploy the application by using the AWS CDK to implement the changes.
- CInstall the AWS AppConfig agent on Amazon ECS. Configure an IAM role with access to AWS AppConfig. Make the deployment changes by using AWS AppConfig. Specify Canary10Percent20Minutes as the deployment strategy.
- DCreate an AWS Lambda function to make the configuration changes. Create an Amazon CloudWatch alarm that monitors the Lambda function every 5 minutes to check if the Lambda function has been updated. When the Lambda function is updated, deploy the changes by using AWS CodeDeploy.
Show answer
Correct answer: C
WhyAWS AppConfig deploys configuration changes gradually with no downtime, and the agent retrieves them for ECS, with a canary strategy to limit risk. CodeDeploy and CDK deploy new code, ECSCanary10Percent15Minutes is not a launch type, and a Lambda function checked by an alarm is not a configuration system.
- A
- A developer is building various microservices for an application that will run on Amazon EC2 instances. The developer needs to monitor the end-to-end view of the requests between the microservices and debug any issues in the various microservices.
What should the developer do to accomplish these tasks?- AUse Amazon CloudWatch to aggregate the microservices' logs and metrics, and build the monitoring dashboard.
- BUse AWS CloudTrail to aggregate the microservices' logs and metrics, and build the monitoring dashboard.
- CUse the AWS X-Ray SDK to add instrumentation in all the microservices, and monitor using the X-Ray service map.
- DUse AWS Health to monitor the health of all the microservices.
Show answer
Correct answer: C
WhyThe X-Ray SDK instruments each microservice, and the service map gives an end-to-end view of requests. CloudWatch shows logs and metrics rather than traces, CloudTrail records API calls, and AWS Health covers AWS service health.
- A
- A developer is building a three-tier application with an Application Load Balancer (ALB), Amazon EC2 instances, and Amazon RDS. There is an alias record in Amazon Route 53 that points to the ALB. When the developer tries to access the ALB from a laptop, the request times out.
Which logs should the developer investigate to verify that the request is reaching the AWS network?- AVPC Flow Logs
- BAmazon Route 53 logs
- CAWS Systems Manager Agent logs
- DAmazon CloudWatch agent logs
Show answer
Correct answer: A
WhyVPC Flow Logs show traffic reaching the load balancer's network interfaces and whether it was accepted. Route 53 logs show DNS queries rather than connections, and Systems Manager and CloudWatch agent logs are about instances.
- A
- A developer is building an application that stores sensitive user data. The application includes an Amazon CloudFront distribution and multiple AWS Lambda functions that handle user requests.
The user requests contain over 20 data fields. Each application transaction contains sensitive data that must be encrypted. Only specific parts of the application need to have the ability to decrypt the data.
Which solution will meet these requirements?- AAssociate the CloudFront distribution with a Lambda@Edge function. Configure the function to perform field-level asymmetric encryption by using a user-defined RSA public key that is stored in AWS Key Management Service (AWS KMS).
- BIntegrate AWS WAF with CloudFront to protect the sensitive data. Use a Lambda function and self-managed keys to perform the encryption and decryption processes.
- CConfigure the CloudFront distribution to use WebSockets by forwarding all viewer request headers to the origin. Create an asymmetric AWS KMS key. Configure the CloudFront distribution to use field-level encryption. Use the AWS KMS key.
- DConfigure the cache behavior in the CloudFront distribution to require HTTPS for communication between viewers and CloudFront. Configure GoudFront to require users to access the files by using either signed URLs or signed cookies.
Show answer
Correct answer: A
WhyA Lambda@Edge function can perform field-level asymmetric encryption with a public key, so only parts of the application with the private key can decrypt. AWS WAF and self-managed keys do not provide this, CloudFront's own field-level encryption does not use KMS keys, and HTTPS and signed URLs do not limit decryption.
- A