0
0
AWScloud~10 mins

Lambda layers for shared code 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 specify the runtime for the Lambda layer.

AWS
CompatibleRuntimes:
  - [1]
Drag options to blanks, or click blank then click option'
Ajava11
Bnodejs14.x
Cpython3.9
Dgo1.x
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a runtime that does not match the layer code language.
Leaving the runtime field empty.
2fill in blank
medium

Complete the code to specify the content location of the Lambda layer.

AWS
Content:
  S3Bucket: my-layer-bucket
  S3Key: [1]
Drag options to blanks, or click blank then click option'
Alambda.zip
Blayer.zip
Ccode.zip
Dfunction.zip
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong zip file name.
Not specifying the S3Key at all.
3fill in blank
hard

Fix the error in the layer version declaration by completing the missing field.

AWS
Type: AWS::Lambda::LayerVersion
Properties:
  LayerName: shared-utils
  [1]:
    - python3.9
  Content:
    S3Bucket: my-layer-bucket
    S3Key: layer.zip
Drag options to blanks, or click blank then click option'
ACompatibleRuntimes
BRuntime
CRuntimes
DCompatibleRuntime
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Runtime' instead of 'CompatibleRuntimes'.
Using singular form instead of plural.
4fill in blank
hard

Fill both blanks to correctly attach the Lambda layer to a function.

AWS
Resources:
  MyFunction:
    Type: AWS::Lambda::Function
    Properties:
      FunctionName: my-function
      Handler: index.handler
      Runtime: python3.9
      Layers:
        - [1]
      Code:
        S3Bucket: my-function-bucket
        S3Key: function.zip

  SharedLayer:
    Type: AWS::Lambda::LayerVersion
    Properties:
      LayerName: shared-utils
      CompatibleRuntimes:
        - [2]
      Content:
        S3Bucket: my-layer-bucket
        S3Key: layer.zip
Drag options to blanks, or click blank then click option'
Aarn:aws:lambda:us-east-1:123456789012:layer:shared-utils:1
Bpython3.9
Cnodejs14.x
Darn:aws:lambda:us-east-1:123456789012:layer:shared-utils:2
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong ARN version number.
Mismatching runtimes between function and layer.
5fill in blank
hard

Fill all three blanks to define a Lambda layer with description, compatible runtimes, and content.

AWS
Resources:
  SharedLayer:
    Type: AWS::Lambda::LayerVersion
    Properties:
      LayerName: shared-utils
      Description: [1]
      CompatibleRuntimes:
        - [2]
      Content:
        S3Bucket: my-layer-bucket
        S3Key: [3]
Drag options to blanks, or click blank then click option'
ACommon utilities for Lambda functions
Bpython3.9
Clayer.zip
DShared code for multiple Lambdas
Attempts:
3 left
💡 Hint
Common Mistakes
Using an incorrect or missing description.
Mismatching runtime versions.
Incorrect S3Key filename.