Amazon AWS Certified Developer - Associate DVA-C02 Practice Test 20
Question 190
An event-driven worker retries DynamoDB writes heavily during a predictable product launch. Which developer action MOST directly meets the stated constraint?
- Inspect Lambda init-duration and handler-duration metrics and reduce startup work or use provisioned concurrency when justified.
- Increase CloudFront TTL to change a DynamoDB partition key.
- Disable all DynamoDB retry handling permanently.
- Inspect DynamoDB throttling and consumed-capacity metrics, key access patterns, and application retry behavior.
Explanation
Correct Answer
D:Inspect DynamoDB throttling and consumed-capacity metrics, key access patterns, and application retry behavior. DynamoDB throttling can reflect hot partitions or configured capacity constraints, not just network faults. For this second operating case, verify that metrics and request logs identify concentrated key traffic or exhausted write/read capacity.
Incorrect Answers
A:This technique primarily addresses Lambda Init Duration diagnosis; it would not demonstrate DynamoDB throttling investigation or directly prove that metrics and request logs identify concentrated key traffic or exhausted write/read capacity.
B:Increase CloudFront TTL to change a DynamoDB partition key. This shortcut would leave the DynamoDB throttling investigation requirement unresolved; assuming every throttle is a client DNS issue misses partition and capacity evidence.
C:Disable all DynamoDB retry handling permanently. This shortcut would leave the DynamoDB throttling investigation requirement unresolved; assuming every throttle is a client DNS issue misses partition and capacity evidence.
Question 191
A Kubernetes-style web service restarts unnecessarily when downstream readiness briefly fails. Which developer action MOST directly meets the stated constraint?
- Separate liveness checks from readiness checks and return healthy only when the correct condition holds.
- Restart the process for every transient database read failure.
- Return HTTP 200 for readiness before required dependencies initialize.
- Use low-cardinality X-Ray annotations for indexed filters and metadata for nonindexed diagnostic details.
Explanation
Correct Answer
A:Separate liveness checks from readiness checks and return healthy only when the correct condition holds. Readiness controls whether a service should receive requests; liveness indicates whether the process needs restarting. For this second operating case, verify that traffic reaches only ready tasks while a temporary dependency delay does not force needless process restarts.
Incorrect Answers
B:Restart the process for every transient database read failure. This shortcut would leave the readiness versus liveness checks requirement unresolved; a single strict probe for every purpose can create restart loops during transient dependency slowness.
C:Return HTTP 200 for readiness before required dependencies initialize. This shortcut would leave the readiness versus liveness checks requirement unresolved; a single strict probe for every purpose can create restart loops during transient dependency slowness.
D:This technique primarily addresses tracing annotations versus metadata; it would not demonstrate readiness versus liveness checks or directly prove that traffic reaches only ready tasks while a temporary dependency delay does not force needless process restarts.
Question 192
A support dashboard receives a valid token for tenant A and must not let it request tenant B's records. Which developer action MOST directly meets the stated constraint?
- Enforce tenant ownership checks in application code against validated identity claims for every data access.
- Disable row filters for all logged-in users.
- Use IAM-authenticated AWS SDK calls with a narrowly scoped identity policy and resource policy when required.
- Trust a caller-supplied tenantId query parameter without checking claims.
Explanation
Correct Answer
A:Enforce tenant ownership checks in application code against validated identity claims for every data access. Authentication proves a principal, whereas tenant-level authorization constrains which records it may access. For this second operating case, verify that cross-tenant requests receive an authorization failure even with otherwise valid login tokens.
Incorrect Answers
B:Disable row filters for all logged-in users. This shortcut would leave the application tenant authorization requirement unresolved; treating any valid JWT as permission to read arbitrary tenant IDs leaks cross-tenant data.
C:This technique primarily addresses service-to-service IAM authorization; it would not demonstrate application tenant authorization or directly prove that cross-tenant requests receive an authorization failure even with otherwise valid login tokens.
D:Trust a caller-supplied tenantId query parameter without checking claims. This shortcut would leave the application tenant authorization requirement unresolved; treating any valid JWT as permission to read arbitrary tenant IDs leaks cross-tenant data.
Question 193
A multi-tenant service needs to prevent an authenticated tenant from querying another tenant's keyspace. Which developer action MOST directly meets the stated constraint?
- Cache shared query results without a tenant-specific key.
- Permit any valid user to choose any tenant partition key.
- Derive a tenant-scoped key prefix from verified identity and enforce tenant authorization on each query.
- Run automated secret scanning in CI and revoke exposed credentials instead of merely deleting one commit.
Explanation
Correct Answer
C:Derive a tenant-scoped key prefix from verified identity and enforce tenant authorization on each query. A tenant identifier from verified claims must control data scoping instead of untrusted request parameters. For this second operating case, verify that authorized requests query only their tenant partition while cross-tenant requests are blocked.
Incorrect Answers
A:Cache shared query results without a tenant-specific key. This shortcut would leave the multi-tenant DynamoDB row isolation requirement unresolved; accepting a caller-supplied tenant key without validation enables cross-tenant record access.
B:Permit any valid user to choose any tenant partition key. This shortcut would leave the multi-tenant DynamoDB row isolation requirement unresolved; accepting a caller-supplied tenant key without validation enables cross-tenant record access.
D:This technique primarily addresses secret scanning in CI; it would not demonstrate multi-tenant DynamoDB row isolation or directly prove that authorized requests query only their tenant partition while cross-tenant requests are blocked.
Question 194
An event processor wants richer failure records than the original event alone after async retries. Which developer action MOST directly meets the stated constraint?
- Use Lambda destinations for each synchronous SDK invocation without wrapping.
- Set environment-specific Lambda configuration or AWS AppConfig values and read them at runtime.
- Replace async destinations with S3 object versioning.
- Use a Lambda asynchronous failure destination for an invocation record instead of relying solely on a DLQ.
Explanation
Correct Answer
D:Use a Lambda asynchronous failure destination for an invocation record instead of relying solely on a DLQ. Destinations for async Lambda invocations capture richer invocation outcomes than traditional dead-letter queues. For this second operating case, verify that the target receives a record including request details and failure response context.
Incorrect Answers
A:Use Lambda destinations for each synchronous SDK invocation without wrapping. This shortcut would leave the Lambda destinations versus DLQ requirement unresolved; treating an async DLQ as a complete execution trace omits response context.
B:This technique primarily addresses Lambda environment configuration; it would not demonstrate Lambda destinations versus DLQ or directly prove that the target receives a record including request details and failure response context.
C:Replace async destinations with S3 object versioning. This shortcut would leave the Lambda destinations versus DLQ requirement unresolved; treating an async DLQ as a complete execution trace omits response context.
Question 195
A developer must undo a failed deployment without overwriting published Lambda code. Which developer action MOST directly meets the stated constraint?
- Point the production Lambda alias back to the previously tested immutable version.
- Delete the previous healthy version before performing rollback.
- Edit published version code in place as though it were mutable.
- Use a blue-green ECS deployment with CodeDeploy and controlled target-group traffic switching.
Explanation
Correct Answer
A:Point the production Lambda alias back to the previously tested immutable version. Lambda aliases can be repointed independently of immutable published version code. For this second operating case, verify that invocations through the alias immediately resolve to the prior version and error rates recover.
Incorrect Answers
B:Delete the previous healthy version before performing rollback. This shortcut would leave the Lambda alias rollback requirement unresolved; editing $LATEST does not necessarily change an alias pinned to a published version.
C:Edit published version code in place as though it were mutable. This shortcut would leave the Lambda alias rollback requirement unresolved; editing $LATEST does not necessarily change an alias pinned to a published version.
D:This technique primarily addresses CodeDeploy ECS blue-green; it would not demonstrate Lambda alias rollback or directly prove that invocations through the alias immediately resolve to the prior version and error rates recover.
Question 196
A stage promotion should change the backend alias without copying an entire REST API definition. Which developer action MOST directly meets the stated constraint?
- Configure the existing pipeline stages to build, test, approve where required, and promote immutable artifacts.
- Treat CloudFront cache invalidation as an integration alias update.
- Configure stage-specific variables or integrations pointing to the intended Lambda alias and grant invoke permissions.
- Delete all API stages and keep one mutable production endpoint.
Explanation
Correct Answer
C:Configure stage-specific variables or integrations pointing to the intended Lambda alias and grant invoke permissions. API Gateway stage configuration can parameterize integrations for separate environments. For this second operating case, verify that test and production invoke the correct Lambda alias without unintended cross-stage traffic.
Incorrect Answers
A:This technique primarily addresses CodePipeline gated promotion; it would not demonstrate API Gateway stage variables or directly prove that test and production invoke the correct Lambda alias without unintended cross-stage traffic.
B:Treat CloudFront cache invalidation as an integration alias update. This shortcut would leave the API Gateway stage variables requirement unresolved; a hardcoded backend alias in a shared integration can route test traffic into production.
D:Delete all API stages and keep one mutable production endpoint. This shortcut would leave the API Gateway stage variables requirement unresolved; a hardcoded backend alias in a shared integration can route test traffic into production.
Question 197
A diagnostic middleware records full request headers including Authorization during a failed API call. Which developer action MOST directly meets the stated constraint?
- Add more verbose logs of complete bearer tokens.
- Store the secret in Secrets Manager and use a supported rotation workflow with least-privilege GetSecretValue.
- Redact secret-bearing environment values and authorization headers from structured application logs.
- Make the log group public so failures are easier to share.
Explanation
Correct Answer
C:Redact secret-bearing environment values and authorization headers from structured application logs. Encryption at rest does not stop an application from leaking plaintext secrets during logging. For this second operating case, verify that controlled failure tests produce usable trace metadata but no credential material in logs.
Incorrect Answers
A:Add more verbose logs of complete bearer tokens. This shortcut would leave the Lambda environment secret leakage requirement unresolved; dumping secrets into CloudWatch Logs exposes credentials to log readers.
B:This technique primarily addresses Secrets Manager rotation; it would not demonstrate Lambda environment secret leakage or directly prove that controlled failure tests produce usable trace metadata but no credential material in logs.
D:Make the log group public so failures are easier to share. This shortcut would leave the Lambda environment secret leakage requirement unresolved; dumping secrets into CloudWatch Logs exposes credentials to log readers.
Question 198
A scheduled Lambda writes objects to a single S3 bucket and its role is missing PutObject. Which developer action MOST directly meets the stated constraint?
- Configure an asynchronous on-failure destination and permitted target delivery for terminal failures.
- Grant public bucket access to fix an IAM role policy.
- Embed a permanent administrator access key in source code.
- Attach a least-privilege policy to the Lambda execution role for the required API actions and resource ARN.
Explanation
Correct Answer
D:Attach a least-privilege policy to the Lambda execution role for the required API actions and resource ARN. Lambda code obtains AWS credentials from its execution role rather than hardcoded keys. For this second operating case, verify that cloudTrail or SDK results confirm the expected action succeeds while unrelated resources remain denied.
Incorrect Answers
A:This technique primarily addresses Lambda asynchronous failure destination; it would not demonstrate Lambda execution role least privilege or directly prove that cloudTrail or SDK results confirm the expected action succeeds while unrelated resources remain denied.
B:Grant public bucket access to fix an IAM role policy. This shortcut would leave the Lambda execution role least privilege requirement unresolved; the execution role lacks a required resource permission and AWS denies the API call.
C:Embed a permanent administrator access key in source code. This shortcut would leave the Lambda execution role least privilege requirement unresolved; the execution role lacks a required resource permission and AWS denies the API call.
Question 199
A containerized API uses separate target groups to validate a new task set before production traffic changes. Which developer action MOST directly meets the stated constraint?
- Point both target groups at an unrelated static S3 site.
- Point the production Lambda alias back to the previously tested immutable version.
- Use a blue-green ECS deployment with CodeDeploy and controlled target-group traffic switching.
- Terminate the healthy original task set before testing replacement tasks.
Explanation
Correct Answer
C:Use a blue-green ECS deployment with CodeDeploy and controlled target-group traffic switching. ECS blue-green deployments route traffic between old and new task sets using load-balancer target groups. For this second operating case, verify that the replacement task set passes health checks before traffic moves and the old target remains available for rollback.
Incorrect Answers
A:Point both target groups at an unrelated static S3 site. This shortcut would leave the CodeDeploy ECS blue-green requirement unresolved; replacing all tasks in place can increase downtime or remove a quick rollback path.
B:This technique primarily addresses Lambda alias rollback; it would not demonstrate CodeDeploy ECS blue-green or directly prove that the replacement task set passes health checks before traffic moves and the old target remains available for rollback.
D:Terminate the healthy original task set before testing replacement tasks. This shortcut would leave the CodeDeploy ECS blue-green requirement unresolved; replacing all tasks in place can increase downtime or remove a quick rollback path.
Question 200
A team needs to deploy a shared Node.js utility library with several separate Lambda handlers. Which developer action MOST directly meets the stated constraint?
- Put the dependency archive in CloudWatch Logs expecting Lambda to import it.
- Attach the layer without checking runtime or architecture compatibility.
- Publish compatible dependencies as a versioned Lambda layer and attach the required layer version to functions.
- Enable partial batch responses and return the identifiers of failed batch items from the handler.
Explanation
Correct Answer
C:Publish compatible dependencies as a versioned Lambda layer and attach the required layer version to functions. Lambda layers package reusable dependencies separately while runtime compatibility must still match. For this second operating case, verify that each function loads the expected dependency version under the declared runtime and architecture.
Incorrect Answers
A:Put the dependency archive in CloudWatch Logs expecting Lambda to import it. This shortcut would leave the Lambda layer dependency management requirement unresolved; a layer built for a different runtime or architecture can cause module import failures.
B:Attach the layer without checking runtime or architecture compatibility. This shortcut would leave the Lambda layer dependency management requirement unresolved; a layer built for a different runtime or architecture can cause module import failures.
D:This technique primarily addresses Lambda event source partial batch response; it would not demonstrate Lambda layer dependency management or directly prove that each function loads the expected dependency version under the declared runtime and architecture.