Amazon AWS Certified Developer - Associate DVA-C02 Practice Test 70
Question 690
A Lambda producer invokes an internal Lambda consumer and must avoid shared static API keys. Select TWO statements that together form a sound implementation and validation plan for this requirement.
- Treat a browser-supplied user ID as an AWS service principal.
- Use IAM-authenticated AWS SDK calls with a narrowly scoped identity policy and resource policy when required.
- Place a permanent admin API key in both Lambda source files.
- Make every target endpoint publicly invokable to avoid IAM trust.
- CloudTrail and target logs show requests authorized only for the permitted source principal.
Explanation
Correct Answers
B:Use IAM-authenticated AWS SDK calls with a narrowly scoped identity policy and resource policy when required. This is the concrete implementation required for service-to-service IAM authorization.
E:CloudTrail and target logs show requests authorized only for the permitted source principal. This is the workload-specific evidence needed to validate the change.
Incorrect Answers
A:Treat a browser-supplied user ID as an AWS service principal. This is not a suitable implementation or validation step for service-to-service IAM authorization; it would leave the risk that a backend-to-backend call can fail when identity access exists but a required resource policy denies the principal.
C:Place a permanent admin API key in both Lambda source files. This is not a suitable implementation or validation step for service-to-service IAM authorization; it would leave the risk that a backend-to-backend call can fail when identity access exists but a required resource policy denies the principal.
D:Make every target endpoint publicly invokable to avoid IAM trust. This is not a suitable implementation or validation step for service-to-service IAM authorization; it would leave the risk that a backend-to-backend call can fail when identity access exists but a required resource policy denies the principal.
Question 691
A pipeline must verify Lambda handles representative API Gateway authorization and validation errors. Select TWO statements that together form a sound implementation and validation plan for this requirement.
- Candidate builds pass deterministic positive and negative test cases with expected response contracts.
- Create versioned JSON test event fixtures and assert both expected outputs and error paths during automated tests.
- Replace every event fixture with an empty JSON object.
- Treat a successful Docker image push as proof all event paths work.
- Disable pipeline test steps when a fixture reveals a defect.
Explanation
Correct Answers
A:Candidate builds pass deterministic positive and negative test cases with expected response contracts.
B:Create versioned JSON test event fixtures and assert both expected outputs and error paths during automated tests. This is the concrete implementation required for deployment test event generation.
Incorrect Answers
C:Replace every event fixture with an empty JSON object. This is not a suitable implementation or validation step for deployment test event generation; it would leave the risk that tests using only happy-path payloads miss error handling and event-shape incompatibilities.
D:Treat a successful Docker image push as proof all event paths work. This is not a suitable implementation or validation step for deployment test event generation; it would leave the risk that tests using only happy-path payloads miss error handling and event-shape incompatibilities.
E:Disable pipeline test steps when a fixture reveals a defect. This is not a suitable implementation or validation step for deployment test event generation; it would leave the risk that tests using only happy-path payloads miss error handling and event-shape incompatibilities.
Question 692
Two workers attempt to claim the same job and only one may transition it from PENDING to RUNNING. Select TWO statements that together form a sound implementation and validation plan for this requirement.
- Read an item and later overwrite it unconditionally without checking state.
- Enable eventual consistency to guarantee serialized writes.
- One competing write succeeds and the other receives a conditional-check failure.
- Use DynamoDB ConditionExpression with an expected state or version for the atomic update.
- Move concurrency control to each worker's local memory.
Explanation
Correct Answers
C:One competing write succeeds and the other receives a conditional-check failure. This is the workload-specific evidence needed to validate the change.
D:Use DynamoDB ConditionExpression with an expected state or version for the atomic update. This is the concrete implementation required for DynamoDB conditional update.
Incorrect Answers
A:Read an item and later overwrite it unconditionally without checking state. This is not a suitable implementation or validation step for DynamoDB conditional update; it would leave the risk that an unconditional PutItem can overwrite valid concurrent state without a conflict signal.
B:Enable eventual consistency to guarantee serialized writes. This is not a suitable implementation or validation step for DynamoDB conditional update; it would leave the risk that an unconditional PutItem can overwrite valid concurrent state without a conflict signal.
E:Move concurrency control to each worker's local memory. This is not a suitable implementation or validation step for DynamoDB conditional update; it would leave the risk that an unconditional PutItem can overwrite valid concurrent state without a conflict signal.
Question 693
An API should be callable only from a known VPC endpoint, not the entire internet. Select TWO statements that together form a sound implementation and validation plan for this requirement.
- Requests from the intended endpoint succeed and other source contexts receive access denied.
- Set a low throttling burst rate to block unauthorized networks.
- Define an API Gateway resource policy with explicit conditions for approved source VPC endpoints.
- Configure CORS headers as the only network access restriction.
- Rely on endpoint naming conventions without a resource policy.
Explanation
Correct Answers
A:Requests from the intended endpoint succeed and other source contexts receive access denied. This is the workload-specific evidence needed to validate the change.
C:Define an API Gateway resource policy with explicit conditions for approved source VPC endpoints. This is the concrete implementation required for API Gateway resource policy.
Incorrect Answers
B:Set a low throttling burst rate to block unauthorized networks. This is not a suitable implementation or validation step for API Gateway resource policy; it would leave the risk that omitting the source restriction can leave a supposedly internal API exposed to more callers.
D:Configure CORS headers as the only network access restriction. This is not a suitable implementation or validation step for API Gateway resource policy; it would leave the risk that omitting the source restriction can leave a supposedly internal API exposed to more callers.
E:Rely on endpoint naming conventions without a resource policy. This is not a suitable implementation or validation step for API Gateway resource policy; it would leave the risk that omitting the source restriction can leave a supposedly internal API exposed to more callers.
Question 694
A team enables automatic key rotation and wants to know how older ciphertext remains decryptable. Select TWO statements that together form a sound implementation and validation plan for this requirement.
- Older ciphertext remains decryptable using protected historical key material and new operations use current material.
- Store key material in an S3 public object as the rotation backup.
- Change the KMS key ID in every stored old ciphertext without re-encrypting.
- Use supported KMS automatic key rotation while keeping the original KMS key identity for decryption.
- Delete the old key as soon as rotation is enabled.
Explanation
Correct Answers
A:Older ciphertext remains decryptable using protected historical key material and new operations use current material.
D:Use supported KMS automatic key rotation while keeping the original KMS key identity for decryption. This is the concrete implementation required for KMS rotation scope.
Incorrect Answers
B:Store key material in an S3 public object as the rotation backup. This is not a suitable implementation or validation step for KMS rotation scope; it would leave the risk that deleting the KMS key during rotation makes ciphertext inaccessible after deletion.
C:Change the KMS key ID in every stored old ciphertext without re-encrypting. This is not a suitable implementation or validation step for KMS rotation scope; it would leave the risk that deleting the KMS key during rotation makes ciphertext inaccessible after deletion.
E:Delete the old key as soon as rotation is enabled. This is not a suitable implementation or validation step for KMS rotation scope; it would leave the risk that deleting the KMS key during rotation makes ciphertext inaccessible after deletion.
Question 695
A user-facing API has intermittent 429 or ProvisionedThroughputExceeded responses for one hot key. Select THREE statements that together form a sound implementation and validation plan for this requirement.
- Increase CloudFront TTL to change a DynamoDB partition key.
- Metrics and request logs identify concentrated key traffic or exhausted write/read capacity.
- Disable all DynamoDB retry handling permanently.
- Grant the API role AdministratorAccess as the only throttling fix.
- 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.
Explanation
Correct Answers
B:Metrics and request logs identify concentrated key traffic or exhausted write/read capacity. This is the workload-specific evidence needed to validate the change.
E:Inspect DynamoDB throttling and consumed-capacity metrics, key access patterns, and application retry behavior. This is the concrete implementation required for DynamoDB throttling investigation.
F:DynamoDB throttling can reflect hot partitions or configured capacity constraints, not just network faults. This states the AWS behavior that makes the implementation valid.
Incorrect Answers
A:Increase CloudFront TTL to change a DynamoDB partition key. This is not a suitable implementation or validation step for DynamoDB throttling investigation; it would leave the risk that assuming every throttle is a client DNS issue misses partition and capacity evidence.
C:Disable all DynamoDB retry handling permanently. This is not a suitable implementation or validation step for DynamoDB throttling investigation; it would leave the risk that assuming every throttle is a client DNS issue misses partition and capacity evidence.
D:Grant the API role AdministratorAccess as the only throttling fix. This is not a suitable implementation or validation step for DynamoDB throttling investigation; it would leave the risk that assuming every throttle is a client DNS issue misses partition and capacity evidence.
Question 696
A staging deployment should use a different feature flag than production without changing code. Select TWO statements that together form a sound implementation and validation plan for this requirement.
- Commit different copies of the application for every flag value.
- Store feature flags in an unvalidated browser cookie only.
- The correct environment retrieves its scoped configuration and a failed rollout can be rolled back.
- Store environment-specific configuration in AWS AppConfig and deploy validated configuration versions.
- Rely on IAM key rotation to change application feature behavior.
Explanation
Correct Answers
C:The correct environment retrieves its scoped configuration and a failed rollout can be rolled back. This is the workload-specific evidence needed to validate the change.
D:Store environment-specific configuration in AWS AppConfig and deploy validated configuration versions. This is the concrete implementation required for environment-specific AppConfig.
Incorrect Answers
A:Commit different copies of the application for every flag value. This is not a suitable implementation or validation step for environment-specific AppConfig; it would leave the risk that copying production flags into staging accidentally enables functionality in the wrong environment.
B:Store feature flags in an unvalidated browser cookie only. This is not a suitable implementation or validation step for environment-specific AppConfig; it would leave the risk that copying production flags into staging accidentally enables functionality in the wrong environment.
E:Rely on IAM key rotation to change application feature behavior. This is not a suitable implementation or validation step for environment-specific AppConfig; it would leave the risk that copying production flags into staging accidentally enables functionality in the wrong environment.
Question 697
Integration tests create temporary DynamoDB and SQS resources that must not touch live customer records. Select TWO statements that together form a sound implementation and validation plan for this requirement.
- Let test code select resource names from untrusted user input.
- Reuse the production queue URL because it is convenient.
- Deploy a separate IaC-managed test stack with isolated resource names and clean it up after testing.
- Integration tests use temporary resource ARNs and cleanup leaves production resources unchanged.
- Run destructive integration tests on the production table.
Explanation
Correct Answers
C:Deploy a separate IaC-managed test stack with isolated resource names and clean it up after testing. This is the concrete implementation required for stage-isolated integration stack.
D:Integration tests use temporary resource ARNs and cleanup leaves production resources unchanged. This is the workload-specific evidence needed to validate the change.
Incorrect Answers
A:Let test code select resource names from untrusted user input. This is not a suitable implementation or validation step for stage-isolated integration stack; it would leave the risk that sharing production tables with integration tests can corrupt real data.
B:Reuse the production queue URL because it is convenient. This is not a suitable implementation or validation step for stage-isolated integration stack; it would leave the risk that sharing production tables with integration tests can corrupt real data.
E:Run destructive integration tests on the production table. This is not a suitable implementation or validation step for stage-isolated integration stack; it would leave the risk that sharing production tables with integration tests can corrupt real data.
Question 698
A table stores millions of tenant messages but most writes share one constant partition key. Select TWO statements that together form a sound implementation and validation plan for this requirement.
- Consumed capacity and throttling metrics distribute more evenly across partition keys.
- 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.
- Use one constant partition key for every customer.
- Add a DynamoDB TTL attribute to raise per-key write throughput.
Explanation
Correct Answers
A:Consumed capacity and throttling metrics distribute more evenly across partition keys. This is the workload-specific evidence needed to validate the change.
C:Choose a high-cardinality partition-key design that spreads requests while preserving required access patterns. This is the concrete implementation required for DynamoDB partition key cardinality.
Incorrect Answers
B:Replace Query with Scan and assume hot-key writes disappear. This is not a suitable implementation or validation step for DynamoDB partition key cardinality; it would leave the risk that a low-cardinality or hot partition key concentrates traffic despite available table capacity.
D:Use one constant partition key for every customer. This is not a suitable implementation or validation step for DynamoDB partition key cardinality; it would leave the risk that a low-cardinality or hot partition key concentrates traffic despite available table capacity.
E:Add a DynamoDB TTL attribute to raise per-key write throughput. This is not a suitable implementation or validation step for DynamoDB partition key cardinality; it would leave the risk that a low-cardinality or hot partition key concentrates traffic despite available table capacity.
Question 699
A checkout Lambda returns occasional 500 errors and its logs include a requestId and errorCode. Select TWO statements that together form a sound implementation and validation plan for this requirement.
- Use S3 lifecycle deletion as a Logs Insights query filter.
- The query isolates timestamps and the exact error records associated with the failed request.
- Query CloudWatch Logs Insights with structured fields and the request correlation identifier.
- Delete the error log group to restart the handler.
- Increase Lambda memory without examining any error evidence.
Explanation
Correct Answers
B:The query isolates timestamps and the exact error records associated with the failed request. This is the workload-specific evidence needed to validate the change.
C:Query CloudWatch Logs Insights with structured fields and the request correlation identifier. This is the concrete implementation required for CloudWatch Logs Insights root cause.
Incorrect Answers
A:Use S3 lifecycle deletion as a Logs Insights query filter. This is not a suitable implementation or validation step for CloudWatch Logs Insights root cause; it would leave the risk that searching broad unstructured text without a request key obscures the relevant failure path.
D:Delete the error log group to restart the handler. This is not a suitable implementation or validation step for CloudWatch Logs Insights root cause; it would leave the risk that searching broad unstructured text without a request key obscures the relevant failure path.
E:Increase Lambda memory without examining any error evidence. This is not a suitable implementation or validation step for CloudWatch Logs Insights root cause; it would leave the risk that searching broad unstructured text without a request key obscures the relevant failure path.
Question 700
A SaaS API validates JWTs but must restrict reads to the tenant represented by the caller's verified claims. Select TWO statements that together form a sound implementation and validation plan for this requirement.
- Trust a caller-supplied tenantId query parameter without checking claims.
- Cross-tenant requests receive an authorization failure even with otherwise valid login tokens.
- Disable row filters for all logged-in users.
- Put tenant identity only in an unverified browser cookie.
- Enforce tenant ownership checks in application code against validated identity claims for every data access.
Explanation
Correct Answers
B:Cross-tenant requests receive an authorization failure even with otherwise valid login tokens. This is the workload-specific evidence needed to validate the change.
E:Enforce tenant ownership checks in application code against validated identity claims for every data access. This is the concrete implementation required for application tenant authorization.
Incorrect Answers
A:Trust a caller-supplied tenantId query parameter without checking claims. This is not a suitable implementation or validation step for application tenant authorization; it would leave the risk that treating any valid JWT as permission to read arbitrary tenant IDs leaks cross-tenant data.
C:Disable row filters for all logged-in users. This is not a suitable implementation or validation step for application tenant authorization; it would leave the risk that treating any valid JWT as permission to read arbitrary tenant IDs leaks cross-tenant data.
D:Put tenant identity only in an unverified browser cookie. This is not a suitable implementation or validation step for application tenant authorization; it would leave the risk that treating any valid JWT as permission to read arbitrary tenant IDs leaks cross-tenant data.