Amazon AWS Certified Developer - Associate DVA-C02 Practice Test 16
Question 150
A mobile app wants managed account registration, confirmation, and JWT access tokens for backend endpoints. Which developer action MOST directly meets the stated constraint?
- Store all user passwords in Lambda environment variables.
- Define an API Gateway resource policy with explicit conditions for approved source VPC endpoints.
- Use an Amazon Cognito user pool as the user directory and authenticate users to obtain tokens.
- Use an identity pool alone as a password-based user directory.
Explanation
Correct Answer
C:Use an Amazon Cognito user pool as the user directory and authenticate users to obtain tokens. Cognito user pools handle user sign-in and tokens, while identity pools serve temporary AWS credentials. For this second operating case, verify that a successfully signed-in user receives correctly issued tokens whose signature, issuer, audience, and expiry validate.
Incorrect Answers
A:Store all user passwords in Lambda environment variables. This shortcut would leave the Cognito user pool authentication requirement unresolved; confusing a user pool with an identity pool leaves the app without the expected login and user-directory flow.
B:This technique primarily addresses API Gateway resource policy; it would not demonstrate Cognito user pool authentication or directly prove that a successfully signed-in user receives correctly issued tokens whose signature, issuer, audience, and expiry validate.
D:Use an identity pool alone as a password-based user directory. This shortcut would leave the Cognito user pool authentication requirement unresolved; confusing a user pool with an identity pool leaves the app without the expected login and user-directory flow.
Question 151
An ECS workload pulls an image built only for a CPU platform the target tasks do not support. Which developer action MOST directly meets the stated constraint?
- Build and publish a container image for the target runtime platform and set compatible deployment architecture.
- Configure Lambda ephemeral storage capacity appropriately and clean temporary files between invocations.
- Change the API Gateway stage to arm64 without changing the image.
- Assume all OCI image manifests work on every CPU architecture.
Explanation
Correct Answer
A:Build and publish a container image for the target runtime platform and set compatible deployment architecture. CPU architecture and container-image manifests must match the target runtime. For this second operating case, verify that the image manifest and a deployed smoke test match the target compute architecture.
Incorrect Answers
B:This technique primarily addresses Lambda ephemeral disk sizing; it would not demonstrate container image architecture compatibility or directly prove that the image manifest and a deployed smoke test match the target compute architecture.
C:Change the API Gateway stage to arm64 without changing the image. This shortcut would leave the container image architecture compatibility requirement unresolved; an architecture mismatch can prevent image startup even when application source is valid.
D:Assume all OCI image manifests work on every CPU architecture. This shortcut would leave the container image architecture compatibility requirement unresolved; an architecture mismatch can prevent image startup even when application source is valid.
Question 152
An ETL job reads SSE-KMS objects but sees AccessDenied despite having s3:GetObject. Which developer action MOST directly meets the stated constraint?
- Use supported KMS automatic key rotation while keeping the original KMS key identity for decryption.
- Make the object public to grant KMS Decrypt implicitly.
- Ensure the principal has S3 object permission and the required KMS decrypt permission on the encryption key.
- Change S3 object metadata without altering key permissions.
Explanation
Correct Answer
C:Ensure the principal has S3 object permission and the required KMS decrypt permission on the encryption key. SSE-KMS authorization involves both S3 API access and KMS cryptographic authorization. For this second operating case, verify that the object can be retrieved and decrypted by the approved principal without broad KMS rights.
Incorrect Answers
A:This technique primarily addresses KMS rotation scope; it would not demonstrate S3 SSE-KMS access or directly prove that the object can be retrieved and decrypted by the approved principal without broad KMS rights.
B:Make the object public to grant KMS Decrypt implicitly. This shortcut would leave the S3 SSE-KMS access requirement unresolved; a role allowed to GetObject but denied KMS Decrypt cannot read the plaintext.
D:Change S3 object metadata without altering key permissions. This shortcut would leave the S3 SSE-KMS access requirement unresolved; a role allowed to GetObject but denied KMS Decrypt cannot read the plaintext.
Question 153
A media job runs longer than its SQS visibility timeout and two consumers start identical transcoding tasks. Which developer action MOST directly meets the stated constraint?
- Remove DeleteMessage calls entirely.
- Reduce the visibility timeout to one second.
- Set the SQS visibility timeout above the expected processing interval and delete the message after successful work.
- Use AWS Step Functions to coordinate states, retries, catches, and compensating tasks explicitly.
Explanation
Correct Answer
C:Set the SQS visibility timeout above the expected processing interval and delete the message after successful work. Visibility hides an in-flight SQS message temporarily; it does not acknowledge completion. For this second operating case, verify that no second delivery occurs during the normal work interval and a completed message is explicitly deleted.
Incorrect Answers
A:Remove DeleteMessage calls entirely. This shortcut would leave the SQS visibility timeout requirement unresolved; a too-short visibility timeout lets another consumer receive unfinished work.
B:Reduce the visibility timeout to one second. This shortcut would leave the SQS visibility timeout requirement unresolved; a too-short visibility timeout lets another consumer receive unfinished work.
D:This technique primarily addresses Step Functions orchestration; it would not demonstrate SQS visibility timeout or directly prove that no second delivery occurs during the normal work interval and a completed message is explicitly deleted.
Question 154
A background Lambda invoked asynchronously exhausts its retries and should preserve a failure record. Which developer action MOST directly meets the stated constraint?
- Enable partial batch responses and return the identifiers of failed batch items from the handler.
- Configure an asynchronous on-failure destination and permitted target delivery for terminal failures.
- Increase provisioned concurrency to guarantee application correctness.
- Configure a synchronous API Gateway response header as an async destination.
Explanation
Correct Answer
B:Configure an asynchronous on-failure destination and permitted target delivery for terminal failures. Asynchronous Lambda destinations provide structured success or failure outcomes for supported invocation modes. For this second operating case, verify that the failure destination receives an invocation record after retries or age limits are exhausted.
Incorrect Answers
A:This technique primarily addresses Lambda event source partial batch response; it would not demonstrate Lambda asynchronous failure destination or directly prove that the failure destination receives an invocation record after retries or age limits are exhausted.
C:Increase provisioned concurrency to guarantee application correctness. This shortcut would leave the Lambda asynchronous failure destination requirement unresolved; a missing destination silently loses terminal failure context beyond default handling.
D:Configure a synchronous API Gateway response header as an async destination. This shortcut would leave the Lambda asynchronous failure destination requirement unresolved; a missing destination silently loses terminal failure context beyond default handling.
Question 155
A downstream client depends on a stable JSON error body even when backend implementation changes. Which developer action MOST directly meets the stated constraint?
- Rename all response fields to match the newest client only.
- Skip compatibility checks because the code compiles.
- Deploy API changes to an isolated API Gateway stage with stage-specific configuration.
- Run consumer contract tests across supported API versions and stage new behavior before promotion.
Explanation
Correct Answer
D:Run consumer contract tests across supported API versions and stage new behavior before promotion. Contract testing checks wire-level compatibility beyond unit correctness of a single handler. For this second operating case, verify that older client fixtures and the revised contract both pass against the candidate API stage.
Incorrect Answers
A:Rename all response fields to match the newest client only. This shortcut would leave the contract testing versioned API requirement unresolved; changing required response shapes without consumer tests can break callers after deployment.
B:Skip compatibility checks because the code compiles. This shortcut would leave the contract testing versioned API requirement unresolved; changing required response shapes without consumer tests can break callers after deployment.
C:This technique primarily addresses API Gateway staging endpoints; it would not demonstrate contract testing versioned API or directly prove that older client fixtures and the revised contract both pass against the candidate API stage.
Question 156
A repository pipeline must catch malformed SAM definitions before creating cloud resources. Which developer action MOST directly meets the stated constraint?
- Run sam validate and template linting before packaging and deploying the application.
- Replace SAM validation with an HTTP request to the production API.
- Run CloudFormation drift detection for supported resource types and reconcile unexpected changes into the source template.
- Change a Git branch name to repair invalid YAML.
Explanation
Correct Answer
A:Run sam validate and template linting before packaging and deploying the application. Template validation catches syntactic and supported structural IaC problems but not all runtime behavior. For this second operating case, verify that invalid resource declarations fail the validation stage before stack mutation.
Incorrect Answers
B:Replace SAM validation with an HTTP request to the production API. This shortcut would leave the SAM template validation requirement unresolved; a malformed template can fail deployment even if application unit tests pass.
C:This technique primarily addresses infrastructure drift detection; it would not demonstrate SAM template validation or directly prove that invalid resource declarations fail the validation stage before stack mutation.
D:Change a Git branch name to repair invalid YAML. This shortcut would leave the SAM template validation requirement unresolved; a malformed template can fail deployment even if application unit tests pass.
Question 157
A payments API needs automated rollback if errors rise during a Lambda alias traffic shift. Which developer action MOST directly meets the stated constraint?
- Delete CloudWatch alarms during the canary window.
- Use a blue-green ECS deployment with CodeDeploy and controlled target-group traffic switching.
- Overwrite the production published version instead of using aliases.
- Configure CodeDeploy Lambda traffic shifting with alarms and a tested rollback policy.
Explanation
Correct Answer
D:Configure CodeDeploy Lambda traffic shifting with alarms and a tested rollback policy. Canary deployment limits initial exposure by progressively shifting live traffic to a candidate version. For this second operating case, verify that alias routing starts at the selected small percentage and alarms can trigger rollback.
Incorrect Answers
A:Delete CloudWatch alarms during the canary window. This shortcut would leave the CodeDeploy Lambda canary requirement unresolved; switching all traffic at once removes early canary detection.
B:This technique primarily addresses CodeDeploy ECS blue-green; it would not demonstrate CodeDeploy Lambda canary or directly prove that alias routing starts at the selected small percentage and alarms can trigger rollback.
C:Overwrite the production published version instead of using aliases. This shortcut would leave the CodeDeploy Lambda canary requirement unresolved; switching all traffic at once removes early canary detection.
Question 158
A Lambda produces mixed plain text and exception dumps and operators need machine-queryable event fields. Which developer action MOST directly meets the stated constraint?
- Use an S3 bucket name as the only error severity field.
- Separate liveness checks from readiness checks and return healthy only when the correct condition holds.
- Serialize full bearer tokens into every structured log record.
- Emit consistent structured JSON logs with timestamp, request ID, operation, severity, and redacted error fields.
Explanation
Correct Answer
D:Emit consistent structured JSON logs with timestamp, request ID, operation, severity, and redacted error fields. Structured fields make telemetry queryable while avoiding sensitive payload exposure. For this second operating case, verify that log queries can reliably filter the same fields across success and failure events.
Incorrect Answers
A:Use an S3 bucket name as the only error severity field. This shortcut would leave the structured JSON logging requirement unresolved; unstructured logs with missing correlation fields make incident reconstruction slow.
B:This technique primarily addresses readiness versus liveness checks; it would not demonstrate structured JSON logging or directly prove that log queries can reliably filter the same fields across success and failure events.
C:Serialize full bearer tokens into every structured log record. This shortcut would leave the structured JSON logging requirement unresolved; unstructured logs with missing correlation fields make incident reconstruction slow.
Question 159
An internal API returns user objects and needs role-specific masking of email and national identifiers. Which developer action MOST directly meets the stated constraint?
- Apply field-level authorization and mask sensitive attributes before serializing responses.
- Return all PII in JSON and rely on users not opening dev tools.
- Store the parameter as an SSM Parameter Store SecureString with KMS protection and restricted retrieval.
- Hide fields only with CSS in the browser.
Explanation
Correct Answer
A:Apply field-level authorization and mask sensitive attributes before serializing responses. Response masking and field authorization must run before data is returned to a caller. For this second operating case, verify that requests from nonprivileged roles contain masked fields while approved roles get only permitted detail.
Incorrect Answers
B:Return all PII in JSON and rely on users not opening dev tools. This shortcut would leave the PII response field masking requirement unresolved; logging or returning raw records before masking exposes PII despite correct database encryption.
C:This technique primarily addresses Parameter Store secure strings; it would not demonstrate PII response field masking or directly prove that requests from nonprivileged roles contain masked fields while approved roles get only permitted detail.
D:Hide fields only with CSS in the browser. This shortcut would leave the PII response field masking requirement unresolved; logging or returning raw records before masking exposes PII despite correct database encryption.
Question 160
A retail clickstream table routes a high write volume to only one partition-key value. Which developer action MOST directly meets the stated constraint?
- Use one constant partition key for every customer.
- Use DynamoDB Query with the customer partition key and an appropriate sort-key condition.
- Replace Query with Scan and assume hot-key writes disappear.
- Choose a high-cardinality partition-key design that spreads requests while preserving required access patterns.
Explanation
Correct Answer
D:Choose a high-cardinality partition-key design that spreads requests while preserving required access patterns. DynamoDB partition-key choice influences physical request distribution and hot-key throttling. For this second operating case, verify that consumed capacity and throttling metrics distribute more evenly across partition keys.
Incorrect Answers
A:Use one constant partition key for every customer. This shortcut would leave the DynamoDB partition key cardinality requirement unresolved; a low-cardinality or hot partition key concentrates traffic despite available table capacity.
B:This technique primarily addresses DynamoDB Query versus Scan; it would not demonstrate DynamoDB partition key cardinality or directly prove that consumed capacity and throttling metrics distribute more evenly across partition keys.
C:Replace Query with Scan and assume hot-key writes disappear. This shortcut would leave the DynamoDB partition key cardinality requirement unresolved; a low-cardinality or hot partition key concentrates traffic despite available table capacity.