A developer is creating an application that must be able to generate API responses without
backend integrations. Multiple internal teams need to work with the API while the
application is still in development.
Which solution will meet these requirements with theLEAST operational overhead?
Show answerHide answer
Correct answer: DCreate an Amazon API Gateway REST API. Enable mock integration on the method of
the API resource.
Explanation
Explanation:
Comprehensive Detailed and Lengthy Step-by-Step Explanation with All AWS
Developer References:
1. Understanding the Use Case:
The API needs to:
Generate responses without backend integrations:This indicates the use of mock
responses for testing.
Be used by multiple internal teams during development.
Minimize operational overhead.
2. Key Features of Amazon API Gateway:
REST APIs:Fully managed API Gateway option that supports advanced
capabilities like mock integrations, request/response transformation, and more.
HTTP APIs:Lightweight option for building APIs quickly. It supports fewer features
but has lower operational complexity and cost.
Mock Integration:Allows API Gateway to return pre-defined responses without
requiring backend integration.
3. Explanation of the Options:
Option A:"Create an Amazon API Gateway REST API. Set up a proxy resource
that has the HTTP proxy integration type."A proxy integration requires a backend
service for handling requests. This does not meet the requirement of "no backend
integrations."
Option B:"Create an Amazon API Gateway HTTP API. Provision a VPC link, and
set up a private integration on the API to connect to a VPC."This requires setting
up a VPC and provisioning resources, which increases operational overhead and
is unnecessary for this use case.
Option C:"Create an Amazon API Gateway HTTP API. Enable mock integration on
the method of the APIresource."While HTTP APIs can enable mock integrations,
they have limited support for advanced features compared to REST APIs, such as
detailed request/response customization. REST APIs are better suited for
development environments requiring mock responses.
Option D:"Create an Amazon API Gateway REST API. Enable mock integration on
the method of the API resource."This is the correct answer. REST APIs with mock
integration allow defining pre-configured responses directly within API Gateway,
making them ideal for scenarios where backend services are unavailable. It
provides flexibility for testing while minimizing operational overhead.
4. Implementation Steps:
To enable mock integration with REST API:
Create a REST API in API Gateway:
Define the API Resource and Methods:
Set Up Mock Integration:
Configure the Mock Response:
Deploy the API:
5. Why REST API Over HTTP API?
REST APIs support detailed request/response transformations and robust mock
integration features, which are ideal for development and testing scenarios.
While HTTP APIs offer lower cost and simplicity, they lack some advanced
features required for fine-tuned mock integrations.
Question 72Choose 1
A company's application has an AWS Lambda function that processes messages from loT
devices. The company wants to monitor the Lambda function to ensure that the Lambda
function is meeting its required service level agreement (SLA).
A developer must implement a solution to determine the application's throughput in near
real time. The throughput must be based on the number of messages that the Lambda
function receives and processesin a given time period. The Lambda function performs
initialization and post-processing steps that must not factor into the throughput
measurement.
What should the developer do to meet these requirements?
Show answerHide answer
Correct answer: CModify the application to publish custom Amazon CloudWatch metrics when the Lambda
function receives and processes each message. Use the metrics to calculate the
throughput.
Question 73Choose 1
A social media application is experiencing high volumes of new user requests after a recent
marketing campaign. The application is served by an Amazon RDS for MySQL instance. A
solutions architect examines the database performance and notices high CPU usage and
many "too many connections" errors that lead to failed requests on the database. The
solutions architect needs to address the failed requests.
Which solution will meet this requirement?
Show answerHide answer
Correct answer: BDeploy an RDS Proxy. Configure the application to use the RDS Proxy.
Question 74Choose 2
A development team maintains a web application by using a single AWS CloudFormation
template. The template defines web servers and an Amazon RDS database. The team
uses the Cloud Formation template to deploy the Cloud Formation stack to different
environments.
During a recent application deployment, a developer caused the primary development
database to be dropped and recreated. The result of this incident was a loss of data. The
team needs to avoid accidental database deletion in the future.
Which solutions will meet these requirements? (Choose two.)
Show answerHide answer
Correct answer: A, BAdd a CloudFormation Deletion Policy attribute with the Retain value to the database
resource.
Update the CloudFormation stack policy to prevent updates to the database.
Explanation
Explanation:
AWS CloudFormation is a service that enables developers to model and provision AWS
resources using templates. The developer can add a CloudFormation Deletion Policy
attribute with the Retain value to the database resource. This will prevent the database
from being deleted when the stack is deleted or updated. The developer can also update
the CloudFormation stack policy to prevent updates to the database. This will prevent
accidental changes to the database configuration or properties.
Question 75Choose 1
A company has an Amazon S3 bucket that contains sensitive data. The data must be
encrypted in transit and at rest. The company encrypts the data in the S3 bucket by using
an AWS Key Management Service (AWS KMS) key. A developer needs to grant several
other AWS accounts the permission to use the S3 GetObject operation to retrieve the data
from the S3 bucket.
How can the developer enforce that all requests to retrieve the data provide encryption in
transit?
Show answerHide answer
Correct answer: ADefine a resource-based policy on the S3 bucket to deny access when a request meets
the condition “aws:SecureTransport”: “false”.
Explanation
Explanation: Amazon S3 supports resource-based policies, which are JSON documents
that specify the permissions for accessing S3 resources. A resource-based policy can be
used to enforce encryption in transit by denying access to requests that do not use HTTPS.
The condition key aws:SecureTransport can be used to check if the request was sent using
SSL. If the value of this key is false, the request is denied; otherwise, the request is
allowed.
Question 76Choose 1
A company maintains a REST service using Amazon API Gateway and the API Gateway
native API key validation. The company recently launched a new registration page, which
allows users to sign up for the service. The registration page creates a new API key using
CreateApiKey and sends the new key to the user. When the user attempts to call the API
using this key. the user receives a 403 Forbidden error. Existing users are unaffected and
can still call the API.
What code updates will grant these new users access to the API?
Show answerHide answer
Correct answer: DThe createUsagePlanKey method must be called to associate the newly created API
key with the correct usage plan.
Question 77Choose 2
A software company is launching a multimedia application. The application will allow guest
users to access sample content before the users decide if they want to create an account
to gain full access. The company wants to implement an authentication process that can
identify users who have already created an account. The company also needs to keep
track of the number of guest users who eventually create an account. Which combination of steps will meet these requirements? {Select TWO.)
Show answerHide answer
Correct answer: B, DCreate an Amazon Cognito identity pool. Configure the identity pool to allow
unauthenticated users. Exchange unique identity for temporary credentials that allow all
users to assume a role.
Create a role for authenticated users that allows access to all content. Create a role for
unauthenticated users that allows access to only the sample content.
Question 78Choose 1
A developer is building a microservice that uses AWS Lambda to process messages from
an Amazon Simple Queue Service (Amazon SQS) standard queue. The Lambda function
calls external APIs to enrich the SOS message data before loading the data into an
Amazon Redshift data warehouse. The SOS queue must handle a maximum of 1.000
messages per second.
During initial testing, the Lambda function repeatedly inserted duplicate data into the
Amazon Redshift table. The duplicate data led to a problem with data analysis. All duplicate
messages were submitted to the queue within 1 minute of each other.
How should the developer resolve this issue?
Show answerHide answer
Correct answer: ACreate an SOS FIFO queue. Enable message deduplication on the SOS FIFO queue.
Question 79Choose 1
When a developer tries to run an AWS Code Build project, it raises an error because the
length of all environment variables exceeds the limit for the combined maximum of
characters.
What is the recommended solution?
Show answerHide answer
Correct answer: DUse AWS Systems Manager Parameter Store to store large numbers ot environment
variables
Explanation
Explanation:
This solution allows the developer to overcome the limit for the combined maximum of
characters for environment variables in AWS CodeBuild. AWS Systems Manager
Parameter Store provides secure, hierarchical storage for configuration data management
and secrets management. The developer can store large numbers of environment
variables as parameters in Parameter Store and reference them in the buildspec file using
parameter references. Adding export LC_ALL=“en_US.utf8” command to the pre_build
section will not affect the environment variables limit. Using Amazon Cognito or an Amazon
S3 bucket to store key-value pairs for environment variables will require additional
configuration and integration.
Question 80Select all that apply
A company runs a payment application on Amazon EC2 instances behind an Application
Load Balance The EC2 instances run in an Auto Scaling group across multiple Availability
Zones The application needs to retrieve application secrets during the application startup
and export the secrets as environment variables These secrets must be encrypted at rest
and need to be rotated every month.
Which solution will meet these requirements with the LEAST development effort?
Show answerHide answer
Correct answer: DStore the secrets in AWS Secrets Manager Provision a new customer master key Use
the key to encrypt the secrets Enable automatic rotation Configure an Amazon EC2 user
data script to programmatically retrieve the secrets during the startup and export as
environment variables
Explanation
Explanation:
AWS Secrets Manager: Built for managing secrets, providing encryption,
automatic rotation, and access control.
Customer Master Key (CMK): Provides an extra layer of control over encryption
through AWS KMS.
Automatic Rotation: Enhances security by regularly changing the secret.
User Data Script: Allows secrets retrieval at instance startup and sets them as
environment variables for seamless use within the application.
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.