DVA-C02 Troubleshooting and Optimization Practice Question
Exhibit
Refer to the exhibit. The following is a CloudFormation template snippet that creates an S3 bucket and a Lambda function. The Lambda function is triggered by S3 events. The stack creation succeeds, but no logs appear in CloudWatch Logs when objects are uploaded to the bucket.
```yaml
Resources:
Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: my-bucket-12345
LambdaFunction:
Type: AWS::Lambda::Function
Properties:
Handler: index.handler
Role: !GetAtt LambdaExecutionRole.Arn
Code:
ZipFile: |
def handler(event, context):
print(event)
Runtime: python3.8
PermissionForS3ToInvokeLambda:
Type: AWS::Lambda::Permission
Properties:
FunctionName: !Ref LambdaFunction
Action: lambda:InvokeFunction
Principal: s3.amazonaws.com
SourceArn: !GetAtt Bucket.Arn
```Why is the Lambda function not being invoked?
⚠ Common exam trap
DVA-C02 often tests the difference between execution role permissions and resource-based policies. Candidates might think the execution role needs invoke permission, but actually S3 needs permission to invoke Lambda, which is granted via a resource-based policy, and the notification configuration must exist.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The S3 bucket does not have a notification configuration for the Lambda function.
The most likely reason the Lambda function is not being invoked is that the S3 bucket does not have a notification configuration for the Lambda function. For S3 to invoke a Lambda function, you must configure an event notification on the bucket that specifies the Lambda function as the destination. Without this configuration, S3 will not send events to Lambda, and the function will never be invoked.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The Lambda execution role does not have permission to be invoked by S3.
Why it's wrong here
The Lambda execution role grants permissions for the Lambda function itself to interact with other AWS services, such as writing logs to CloudWatch or accessing S3 buckets. This role does not govern *who* can invoke the Lambda function. Instead, S3 requires a resource-based policy attached directly to the Lambda function to grant S3 explicit permission to invoke it, ensuring proper authorization for the invocation action.
- ✗
The Lambda permission does not specify the correct source account.
Why it's wrong here
A resource-based policy on the Lambda function grants S3 permission to invoke it. While this policy often includes a SourceAccount condition for security, an incorrect account would typically result in a "permission denied" error *if* S3 attempted an invocation. However, without an S3 notification configuration, S3 never even attempts to invoke the function, rendering the specifics of the SourceAccount condition irrelevant to the initial problem of non-invocation.
- ✗
The Lambda function has a runtime that is not supported.
Why it's wrong here
An unsupported runtime would prevent the Lambda service from successfully executing the function code, leading to execution errors or failures. However, the S3 service would still *attempt* to invoke the Lambda function if a notification configuration was present. The question states the function is "not being invoked," indicating the issue occurs *before* Lambda even tries to run the code, making runtime support a secondary concern.
- ✓
The S3 bucket does not have a notification configuration for the Lambda function.
Why this is correct
For an S3 bucket to trigger a Lambda function, a specific event notification configuration must be set up on the bucket. This configuration specifies which S3 events (e.g., s3:ObjectCreated:*) should trigger the Lambda function and identifies the target Lambda ARN. Without this explicit configuration, S3 will not publish events to the Lambda function, resulting in no invocation regardless of other permissions.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
This DVA-C02 question is part of Courseiva's 1,135-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint
This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.