Amazon AWS Certified Developer - Associate DVA-C02 Practice Test 12
Question 110
A synchronous API frequently reaches its integration timeout despite a long Lambda function timeout. Which developer action MOST directly meets the stated constraint?
- Set the Lambda function timeout to fifteen minutes and assume API Gateway waits equally long.
- Measure the integration latency and redesign or optimize synchronous work to finish within the API integration limit.
- Trace the caller identity, the requested S3 action, and the KMS key permissions with CloudTrail evidence.
- Increase DynamoDB TTL to change HTTP integration deadlines.
Explanation
Correct Answer
B:Measure the integration latency and redesign or optimize synchronous work to finish within the API integration limit. API integration timeout limits are independent of a Lambda function's own maximum runtime. For this second operating case, verify that end-to-end traces show the integration completes under the configured limit without gateway timeouts.
Incorrect Answers
A:Set the Lambda function timeout to fifteen minutes and assume API Gateway waits equally long. This shortcut would leave the API Gateway Lambda integration timeout requirement unresolved; a longer Lambda timeout alone does not prevent an earlier API Gateway integration timeout.
C:This technique primarily addresses AccessDenied troubleshooting chain; it would not demonstrate API Gateway Lambda integration timeout or directly prove that end-to-end traces show the integration completes under the configured limit without gateway timeouts.
D:Increase DynamoDB TTL to change HTTP integration deadlines. This shortcut would leave the API Gateway Lambda integration timeout requirement unresolved; a longer Lambda timeout alone does not prevent an earlier API Gateway integration timeout.
Question 111
A checkout integration test needs to control a partner's timeout and invalid-signature responses. Which developer action MOST directly meets the stated constraint?
- Deploy API changes to an isolated API Gateway stage with stage-specific configuration.
- Mock external dependency responses in unit tests and retain separate contract or integration tests.
- Put production API credentials in public test fixtures.
- Turn off test assertions whenever the partner is unavailable.
Explanation
Correct Answer
B:Mock external dependency responses in unit tests and retain separate contract or integration tests. Mocks isolate code logic while independent integration checks validate real API contracts. For this second operating case, verify that tests deterministically exercise success, timeout, and error handling without contacting the live partner.
Incorrect Answers
A:This technique primarily addresses API Gateway staging endpoints; it would not demonstrate API external dependency mocks or directly prove that tests deterministically exercise success, timeout, and error handling without contacting the live partner.
C:Put production API credentials in public test fixtures. This shortcut would leave the API external dependency mocks requirement unresolved; relying only on live third-party calls makes tests slow and nondeterministic.
D:Turn off test assertions whenever the partner is unavailable. This shortcut would leave the API external dependency mocks requirement unresolved; relying only on live third-party calls makes tests slow and nondeterministic.
Question 112
An internal integration test requires a separate base path for new API behavior. Which developer action MOST directly meets the stated constraint?
- Point every test client at production without a stage boundary.
- Delete the API deployment after each individual request.
- Deploy API changes to an isolated API Gateway stage with stage-specific configuration.
- Build test events using realistic SQS Records metadata and verify handler output plus failure identifiers.
Explanation
Correct Answer
C:Deploy API changes to an isolated API Gateway stage with stage-specific configuration. API Gateway stages provide deployment boundaries and can hold environment-specific settings. For this second operating case, verify that test requests route to the test deployment while production routes keep serving the previous version.
Incorrect Answers
A:Point every test client at production without a stage boundary. This shortcut would leave the API Gateway staging endpoints requirement unresolved; updating the production stage for every test exposes incomplete behavior to consumers.
B:Delete the API deployment after each individual request. This shortcut would leave the API Gateway staging endpoints requirement unresolved; updating the production stage for every test exposes incomplete behavior to consumers.
D:This technique primarily addresses SQS handler contract tests; it would not demonstrate API Gateway staging endpoints or directly prove that test requests route to the test deployment while production routes keep serving the previous version.
Question 113
A product catalog needs tokenized free-text matching rather than exact primary-key lookups. Which developer action MOST directly meets the stated constraint?
- Run a full table Scan on each keystroke and call it full-text ranking.
- Index searchable fields in Amazon OpenSearch Service and query the text index with an appropriate analyzer.
- Put every document into a single DynamoDB partition and use Query for relevance.
- Add a Global Secondary Index with the required alternate partition and sort keys.
Explanation
Correct Answer
B:Index searchable fields in Amazon OpenSearch Service and query the text index with an appropriate analyzer. Full-text search uses analyzed inverted indexes rather than DynamoDB exact-key access. For this second operating case, verify that search results return ranked text matches according to indexed tokens and query clauses.
Incorrect Answers
A:Run a full table Scan on each keystroke and call it full-text ranking. This shortcut would leave the OpenSearch full-text queries requirement unresolved; a DynamoDB key-only Query cannot perform arbitrary relevance-ranked text search.
C:Put every document into a single DynamoDB partition and use Query for relevance. This shortcut would leave the OpenSearch full-text queries requirement unresolved; a DynamoDB key-only Query cannot perform arbitrary relevance-ranked text search.
D:This technique primarily addresses DynamoDB GSI access pattern; it would not demonstrate OpenSearch full-text queries or directly prove that search results return ranked text matches according to indexed tokens and query clauses.
Question 114
A data parsing handler is configured with minimal memory and consumes high CPU time per request. Which developer action MOST directly meets the stated constraint?
- Reduce memory to the absolute minimum without benchmarking.
- Benchmark memory settings and pick a measured memory and CPU allocation optimizing duration and total cost.
- Increase S3 bucket version retention to speed CPU operations.
- Apply an SNS subscription filter policy on the relevant message attributes or payload fields.
Explanation
Correct Answer
B:Benchmark memory settings and pick a measured memory and CPU allocation optimizing duration and total cost. Lambda allocates CPU in proportion to memory, so more memory can reduce compute duration. For this second operating case, verify that comparative load tests show latency and billed cost at the chosen memory setting.
Incorrect Answers
A:Reduce memory to the absolute minimum without benchmarking. This shortcut would leave the Lambda duration versus memory tradeoff requirement unresolved; simply reducing memory can raise duration and total cost for CPU-bound code.
C:Increase S3 bucket version retention to speed CPU operations. This shortcut would leave the Lambda duration versus memory tradeoff requirement unresolved; simply reducing memory can raise duration and total cost for CPU-bound code.
D:This technique primarily addresses SNS subscription filter policy; it would not demonstrate Lambda duration versus memory tradeoff or directly prove that comparative load tests show latency and billed cost at the chosen memory setting.
Question 115
A pipeline needs to prevent credentials in code, configuration, or test fixtures from reaching release artifacts. Which developer action MOST directly meets the stated constraint?
- Assume renaming the branch makes the key private again.
- Use the AWS SDK default credential chain with short-lived credentials from an approved profile or federation.
- Run automated secret scanning in CI and revoke exposed credentials instead of merely deleting one commit.
- Encrypt only the build status badge.
Explanation
Correct Answer
C:Run automated secret scanning in CI and revoke exposed credentials instead of merely deleting one commit. Secret scanning reduces accidental credential publication but exposed keys must be invalidated. For this second operating case, verify that a seeded test secret blocks the merge and revocation evidence confirms the exposed credential is unusable.
Incorrect Answers
A:Assume renaming the branch makes the key private again. This shortcut would leave the secret scanning in CI requirement unresolved; removing a secret from the latest file does not erase its exposure in repository history.
B:This technique primarily addresses temporary credential storage; it would not demonstrate secret scanning in CI or directly prove that a seeded test secret blocks the merge and revocation evidence confirms the exposed credential is unusable.
D:Encrypt only the build status badge. This shortcut would leave the secret scanning in CI requirement unresolved; removing a secret from the latest file does not erase its exposure in repository history.
Question 116
A multi-client HTTP API must reject expired or wrong-audience access tokens before the Lambda integration. Which developer action MOST directly meets the stated constraint?
- Compare only whether bearer-token length is greater than ten.
- Use IAM-authenticated AWS SDK calls with a narrowly scoped identity policy and resource policy when required.
- Accept every token whose JSON payload includes a username.
- Configure a JWT authorizer with the trusted issuer and audience and bind it to protected API routes.
Explanation
Correct Answer
D:Configure a JWT authorizer with the trusted issuer and audience and bind it to protected API routes. JWT verification checks cryptographic signature and claims, not only whether a header exists. For this second operating case, verify that valid JWTs reach integrations while expired, bad-signature, or wrong-audience tokens are rejected.
Incorrect Answers
A:Compare only whether bearer-token length is greater than ten. This shortcut would leave the API Gateway JWT authorizer requirement unresolved; merely checking that Authorization is nonempty accepts fabricated or expired tokens.
B:This technique primarily addresses service-to-service IAM authorization; it would not demonstrate API Gateway JWT authorizer or directly prove that valid JWTs reach integrations while expired, bad-signature, or wrong-audience tokens are rejected.
C:Accept every token whose JSON payload includes a username. This shortcut would leave the API Gateway JWT authorizer requirement unresolved; merely checking that Authorization is nonempty accepts fabricated or expired tokens.
Question 117
An Elastic Beanstalk environment needs a safe update path that isolates new capacity before cutover. Which developer action MOST directly meets the stated constraint?
- Use an immutable or blue-green deployment strategy and verify replacement health before shifting users.
- Pin deployment manifests to an immutable image digest or unique tested release tag.
- Replace all application instances simultaneously during the busiest period.
- Delete the existing environment before validating the replacement.
Explanation
Correct Answer
A:Use an immutable or blue-green deployment strategy and verify replacement health before shifting users. Immutable deployments create replacement capacity to limit in-place update impact. For this second operating case, verify that new instances become healthy and application checks pass before old capacity is retired.
Incorrect Answers
B:This technique primarily addresses immutable container image tags; it would not demonstrate Elastic Beanstalk immutable update or directly prove that new instances become healthy and application checks pass before old capacity is retired.
C:Replace all application instances simultaneously during the busiest period. This shortcut would leave the Elastic Beanstalk immutable update requirement unresolved; an all-at-once update can take the complete fleet offline if the revision fails.
D:Delete the existing environment before validating the replacement. This shortcut would leave the Elastic Beanstalk immutable update requirement unresolved; an all-at-once update can take the complete fleet offline if the revision fails.
Question 118
A REST API accepts JSON orders and needs schema validation with a predictable client error. Which developer action MOST directly meets the stated constraint?
- Expose an unrestricted mock integration to all clients.
- Increase backend memory to handle missing JSON keys.
- Configure an API Gateway request validator and matching request model for required JSON structure.
- Write a stable event ID with a conditional DynamoDB write and skip a side effect when that ID was processed.
Explanation
Correct Answer
C:Configure an API Gateway request validator and matching request model for required JSON structure. Validating at the API boundary reduces invalid traffic and keeps backend operations focused. For this second operating case, verify that malformed requests produce a client error before backend invocation while valid requests reach the integration.
Incorrect Answers
A:Expose an unrestricted mock integration to all clients. This shortcut would leave the API Gateway request validation requirement unresolved; missing or incomplete request models let invalid payloads reach Lambda and trigger runtime exceptions.
B:Increase backend memory to handle missing JSON keys. This shortcut would leave the API Gateway request validation requirement unresolved; missing or incomplete request models let invalid payloads reach Lambda and trigger runtime exceptions.
D:This technique primarily addresses idempotent event handling; it would not demonstrate API Gateway request validation or directly prove that malformed requests produce a client error before backend invocation while valid requests reach the integration.
Question 119
A worker fetches a sensitive connection string at startup without putting the value in source code. Which developer action MOST directly meets the stated constraint?
- Print parameter contents to every startup log.
- Store the parameter as an SSM Parameter Store SecureString with KMS protection and restricted retrieval.
- Use the AWS SDK default credential chain with short-lived credentials from an approved profile or federation.
- Put the secret in a plain CloudFormation output without protection.
Explanation
Correct Answer
B:Store the parameter as an SSM Parameter Store SecureString with KMS protection and restricted retrieval. SecureString parameters protect parameter values at rest and require appropriate API and KMS permissions. For this second operating case, verify that authorized reads with decryption return the intended value while unauthorized callers cannot decrypt it.
Incorrect Answers
A:Print parameter contents to every startup log. This shortcut would leave the Parameter Store secure strings requirement unresolved; a plaintext String parameter does not provide the intended encrypted-at-rest secret boundary.
C:This technique primarily addresses temporary credential storage; it would not demonstrate Parameter Store secure strings or directly prove that authorized reads with decryption return the intended value while unauthorized callers cannot decrypt it.
D:Put the secret in a plain CloudFormation output without protection. This shortcut would leave the Parameter Store secure strings requirement unresolved; a plaintext String parameter does not provide the intended encrypted-at-rest secret boundary.
Question 120
A VPC-attached Lambda accesses an internal service on private subnets and receives connection timeouts. Which developer action MOST directly meets the stated constraint?
- Replace the execution role with broad IAM access to repair TCP connectivity.
- Increase the Lambda memory setting experimentally and benchmark latency and cost at several settings.
- Make the RDS instance publicly accessible by default.
- Attach Lambda to appropriate subnets and security groups with allowed routes and database connectivity.
Explanation
Correct Answer
D:Attach Lambda to appropriate subnets and security groups with allowed routes and database connectivity. VPC networking and security groups control reachability independently of IAM API authorization. For this second operating case, verify that network tests confirm outbound connectivity from the function to the private endpoint on its service port.
Incorrect Answers
A:Replace the execution role with broad IAM access to repair TCP connectivity. This shortcut would leave the Lambda VPC private data access requirement unresolved; missing security-group or routing rules prevent TCP access to a private endpoint.
B:This technique primarily addresses Lambda memory CPU tuning; it would not demonstrate Lambda VPC private data access or directly prove that network tests confirm outbound connectivity from the function to the private endpoint on its service port.
C:Make the RDS instance publicly accessible by default. This shortcut would leave the Lambda VPC private data access requirement unresolved; missing security-group or routing rules prevent TCP access to a private endpoint.