Bird
0
0

You wrote this SAM template but deployment fails. What is the error?

medium📝 Debug Q14 of 15
AWS - Serverless Architecture
You wrote this SAM template but deployment fails. What is the error?
MyFunction:
  Type: AWS::Serverless::Function
  Properties:
    Handler: app.lambda_handler
    Runtime: python3.8
    Events:
      S3Event:
        Type: S3
        Properties:
          Bucket: my-bucket
          Events: s3:ObjectCreated:Put
AThe Runtime python3.8 is not supported
BThe Handler property is missing
CThe Events property under S3Event should be a list, not a string
DThe Bucket name cannot be hardcoded
Step-by-Step Solution
Solution:
  1. Step 1: Check S3 event syntax

    The Events property for S3 event must be a list of event types, but here it is a string.
  2. Step 2: Verify other properties

    Handler is present, python3.8 is supported, and bucket names can be hardcoded in SAM templates.
  3. Final Answer:

    The Events property under S3Event should be a list, not a string -> Option C
  4. Quick Check:

    S3 Events property = list, not string [OK]
Quick Trick: S3 Events must be a list, not a single string [OK]
Common Mistakes:
  • Using string instead of list for S3 Events
  • Removing required Handler property
  • Assuming runtime version is invalid without checking

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes