Amazon Web Services certification · Exam DVA-C02

DVA-C02 Mock Exam Page 10

AWS Certified Developer - Associate

Free DVA-C02 mock exam questions 91–100, each with the answer and an explanation.

20 questions · 33 minutes · free, no sign-up

Free DVA-C02 questions

91–100 of 110 free
Question 91 Choose 1
A developer is implementing a serverless application by using AWS CloudFormation to provision Amazon S3 web hosting. Amazon API Gateway, and AWS Lambda functions. The Lambda function source code is zipped and uploaded to an S3 bucket. The S3 object key of the zipped source code is specified in the Lambda resource in the CloudFormation template.
The developer notices that there are no changes in the Lambda function every time the CloudFormation stack is updated.
How can the developer resolve this issue?
Show answerHide answer

Correct answer: B Change the S3 object key or the S3 version in the CloudFormation template before updating the CloudFormation stack.

Question 92 Choose 2
A company is creating an AWS Step Functions state machine to run a set of tests for an application. The tests need to run when a specific AWS Cloud Formation stack is deployed. Which combination of steps will meet these requirements? (Select TWO.)
Show answerHide answer

Correct answer: A, E Create an AWS Lambda function to invoke the state machine. Add the state machine as a target of the EventBridge rule.

Explanation

Explanation: Requirement Summary:
Trigger anAWS Step Functions state machine(test execution)
Only when aspecific AWS CloudFormation stack is deployed
Option A: Create a Lambda function to invoke the state machine
Valid approach: Lambda can be used as anintermediary triggerfor Step Functions using the SDK (e.g., StartExecution API).
Offers flexibility (custom filtering, additional logic).
Option B: Create EventBridge rule filtering on UPDATE_IN_PROGRESS
Incorrect: UPDATE_IN_PROGRESS triggersbeforethe stack is fully deployed.
You need totrigger after deployment, such as UPDATE_COMPLETE or CREATE_COMPLETE.
Option C: EventBridge Pipes with Lambda target filtering on
UPDATE_IN_PROGRESS
Incorrect for same reason as B (wrong timing).
Also, EventBridge Pipes are not necessary here if you're using rules directly.
Option D: Pipe with EventBridge Rule as source and Step Functions as target Invalid setup: EventBridge Pipes useevent sources, not rules, as input.
This configuration is unsupported.
Option E: Add the state machine as a target of the EventBridge rule Direct and low-overhead approach.
EventBridgenatively supports Step Functionsas a target.
You can trigger the state machinewithout a Lambdaif the filter matches (e.g., ResourceStatus = CREATE_COMPLETE, with the correct StackId).
Question 93 Choose 1
A developer is using AWS Amplify Hosting to build and deploy an application. The developer is receiving an increased number of bug reports from users. The developer wants to add end-to-end testing to the application to eliminate as many bugs as possible before the bugs reach production. Which solution should the developer implement to meet these requirements?
Show answerHide answer

Correct answer: C Add a test phase to the amplify.yml build settings for the application.

Explanation

Explanation: The solution that will meet the requirements is to add a test phase to the amplify.yml build settings for the application. This way, the developer can run end-to-end tests on every code commit and catch any bugs before deploying to production. The other options either do not support end-to-end testing, or do not run tests automatically.
Question 94 Choose 1
A developer is using an AWS CloudFormation template to create a pipeline in AWS CodePipeline. The template creates an Amazon S3 bucket that the pipeline references in a source stage. The template also creates an AWS CodeBuild project for a build stage. The pipeline sends notifications to an Amazon SNS topic. Logs for the CodeBuild project are stored in Amazon CloudWatch Logs.
The company needs to ensure that the pipeline's artifacts are encrypted with an existing customer-managed AWS KMS key. The developer has granted the pipeline permissions to use the KMS key.
Which additional step will meet these requirements?
Show answerHide answer

Correct answer: C Apply an S3 bucket policy that ensures the pipeline sends only encrypted objects to the S3 bucket.

Explanation

Explanation: Why Option C is Correct:Ensuring that pipeline artifacts are encrypted with a customer-managed AWS KMS key involves configuring the S3 bucket policy to require encryption. This policy ensures all objects uploaded to the bucket are encrypted with the specified KMS key.
Question 95 Choose 2
A company has an application that is hosted on Amazon EC2 instances The application stores objects in an Amazon S3 bucket and allows users to download objects from the S3 bucket A developer turns on S3 Block Public Access for the S3 bucket After this change, users report errors when they attempt to download objects The developer needs to implement a solution so that only users who are signed in to the application can access objects in the S3 bucket. Which combination of steps will meet these requirements in the MOST secure way? (Select TWO.)
Show answerHide answer

Correct answer: A, C Create an EC2 instance profile and role with an appropriate policy Associate the role with the EC2 instances Modify the application to use the S3 GeneratePresignedUrl API call

Explanation

Explanation:
  • IAM Roles for EC2 (A): The most secure way to provide AWS permissions from EC2.
  • Pre-signed URLs (C): Temporary, authenticated URLs for specific S3 actions.
Question 96 Choose 1
A developer is creating an AWS Lambda function. The Lambda function needs an external library to connect to a third-party solution The external library is a collection of files with a total size of 100 MB The developer needs to make the external library available to the Lambda execution environment and reduce the Lambda package space Which solution will meet these requirements with the LEAST operational overhead?
Show answerHide answer

Correct answer: A Create a Lambda layer to store the external library Configure the Lambda function to use the layer

Question 97 Choose 1
A company hosts a stateless web application with low data storage in a single AWS Region. The company wants to increase the resiliency of the application to include a multi- Region presence. The company wants to set the recovery time objective (RTO) and recovery point objective (RPO) to hours. The company needs a low-cost and lowcomplexity disaster recovery (DR) strategy. Which DR strategy should the company use?
Show answerHide answer

Correct answer: B Pilot light

Explanation

Explanation: Why Option B is Correct: The pilot light strategy keeps a minimal version of the environment in another Region and scales up during a disaster. It achieves an RTO and RPO of hours at a low cost and complexity.
Question 98 Choose 1
A developer is automating a new application deployment with AWS SAM. The new application has one AWS Lambda function and one Amazon S3 bucket. The Lambda function must access the S3 bucket to only read objects. How should the developer configure AWS SAM to grant the necessary read permission to the S3 bucket?
Show answerHide answer

Correct answer: D Add the S3ReadPolicy template to the Lambda function's execution role.

Explanation

Explanation: Step-by-Step Breakdown:
Requirement Summary:
UseAWS SAMto deploy:
Lambda needsread-only accessto the S3 bucket
Solution must be expressed viaAWS SAM template
Option A: Reference a second Lambda authorizer function
Incorrect: Lambda authorizers are used inAPI Gateway for authentication, not for granting S3 permissions.
Option B: Add a custom S3 bucket policy to the Lambda function Incorrect: Bucket policiescontrol who can access the bucket, not what the Lambda function can do.
The permission must be granted to the Lambda’sIAM execution role.
Option C: Create an Amazon SQS topic for only S3 object reads Incorrect: SQS cannot read objects from S3 and is not relevant to this scenario.
Option D: Add the S3ReadPolicy template to the Lambda function's execution role Correct: AWS SAM providesmanaged policy templateslike AmazonS3ReadOnlyAccess andshortcuts like S3ReadPolicy.
You can apply these to the Lambda’s execution role using the Policies: section in your SAM template.
Example SAM YAML:
yaml
CopyEdit
Resources:
MyFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: my-code/
Handler: app.handler
Runtime: python3.11
Policies:
- S3ReadPolicy:
BucketName: !Ref MyBucket
MyBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: my-personal-bucket-name
Question 99 Choose 1
A developer is migrating a containerized application from an on-premises environment to an Amazon ECS cluster.
In the on-premises environment, the container uses a Docker file to store the application. Service dependency configurations such as databases, caches, and storage volumes are stored in a docker-compose.yml file.
Both files are located at the top level of the code base that the developer needs to containerize. When the developer deploys the code to Amazon ECS, the instructions from the Docker file are carried out. However, none of the configurations from docker-compose. yml are applied.
The developer needs to resolve the error and ensure the configurations are applied.
Show answerHide answer

Correct answer: B Add the details from the docker-compose.yml file to an ECS task definition. Associate the task with the ECS cluster.

Explanation

Explanation: Why Option B is Correct:Amazon ECS does not natively process dockercompose. yml files. Instead, the configurations from docker-compose.yml must be converted into ECS-compatible configurations within a task definition. Task definitions are the primary way to specify container configurations in ECS, including service dependencies like databases, caches, and volumes.
Question 100 Choose 2
A company uses a custom root certificate authority certificate chain (Root CA Cert) that is 10 KB in size generate SSL certificates for its on-premises HTTPS endpoints. One of the company’s cloud based applications has hundreds of AWS Lambda functions that pull date from these endpoints. A developer updated the trust store of the Lambda execution environment to use the Root CA Cert when the Lambda execution environment is initialized. The developer bundled the Root CA Cert as a text file in the Lambdas deployment bundle.
After 3 months of development the root CA Cert is no longer valid and must be updated. The developer needs a more efficient solution to update the Root CA Cert for all deployed Lambda functions. The solution must not include rebuilding or updating all Lambda functions that use the Root CA Cert. The solution must also work for alldevelopment, testing and production environment. Each environment is managed in a separate AWS account.
When combination of steps Would the developer take to meet these environments MOST cost-effectively? (Select TWO)
Show answerHide answer

Correct answer: B, E Store the Root CA Cert as a Secure Sting parameter in aws Systems Manager Parameter Store Create a resource-based policy. Add IAM users to allow access to the policy. Refactor the Lambda code to load the Root CA Cert from the Root CA Cert's location. Modify the runtime trust store outside the Lambda function handler.

Explanation

Explanation: This solution will meet the requirements by storing the Root CA Cert as a Secure String parameter in AWS Systems Manager Parameter Store, which is a secure and scalable service for storing and managing configuration data and secrets. The resource-based policy will allow IAM users in different AWS accounts and environments to access the parameter without requiring cross-account roles or permissions. The Lambda code will be refactored to load the Root CA Cert from the parameter store and modify the runtime trust store outside the Lambda function handler, which will improve performance and reduce latency by avoiding repeated calls to Parameter Store and trust store modifications for each invocation of the Lambda function. Option A is not optimal because it will use AWS Secrets Manager instead of AWS Systems Manager Parameter Store, which will incur additional costs and complexity for storing and managing a non-secret configuration data such as Root CA Cert. Option C is not optimal because it will deactivate the application secrets and monitor the application error logs temporarily, which will cause application downtime and potential data loss. Option D is not optimal because it will modify the runtime trust store inside the Lambda function handler, which will degrade performance and increase latency by repeating unnecessary operations for each invocation of the Lambda function.
Full mock exam

Sit the DVA-C02 exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real DVA-C02 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full DVA-C02 mock exam
  • 65questions per mock
  • 105 mintime limit
  • 368questions in the bank
  • Newmock on every attempt