0
0
AWScloud~10 mins

Lambda integration in AWS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a Lambda function handler in Python.

AWS
def lambda_handler(event, context):
    return [1]
Drag options to blanks, or click blank then click option'
A"Hello from Lambda!"
Bprint("Hello")
Cevent + context
DNone
Attempts:
3 left
💡 Hint
Common Mistakes
Using print instead of return
Returning None
2fill in blank
medium

Complete the AWS CLI command to invoke a Lambda function named 'MyFunction'.

AWS
aws lambda invoke --function-name [1] output.txt
Drag options to blanks, or click blank then click option'
AMyFunction
BInvokeFunction
ClambdaInvoke
DFunctionName
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect function name
Using command names instead of function name
3fill in blank
hard

Fix the error in the Lambda function resource definition in AWS CloudFormation.

AWS
Resources:
  MyLambdaFunction:
    Type: AWS::Lambda::Function
    Properties:
      Handler: [1]
      Role: arn:aws:iam::123456789012:role/lambda-role
      Runtime: python3.8
      Code:
        S3Bucket: my-bucket
        S3Key: my-function.zip
Drag options to blanks, or click blank then click option'
Amain.handler
Blambda.handler
Chandler.index
Dindex.handler
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping file and function names
Using wrong file name
4fill in blank
hard

Fill both blanks to create an API Gateway event trigger for a Lambda function in AWS SAM template.

AWS
Events:
  ApiEvent:
    Type: [1]
    Properties:
      Path: /hello
      Method: [2]
Drag options to blanks, or click blank then click option'
AApi
Bget
CS3
Dpost
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong event type like 'S3'
Using post instead of get for simple retrieval
5fill in blank
hard

Fill all three blanks to define environment variables for a Lambda function in AWS CloudFormation.

AWS
Resources:
  MyLambdaFunction:
    Type: AWS::Lambda::Function
    Properties:
      Environment:
        Variables:
          [1]: [2]
          [3]: "production"
Drag options to blanks, or click blank then click option'
ALOG_LEVEL
B"DEBUG"
CSTAGE
D"dev"
Attempts:
3 left
💡 Hint
Common Mistakes
Using values without quotes
Swapping keys and values