Complete the code to specify the runtime for the Lambda layer.
CompatibleRuntimes:
- [1]The runtime must match the language used in the Lambda layer code. Here, python3.9 is correct for Python code.
Complete the code to specify the content location of the Lambda layer.
Content:
S3Bucket: my-layer-bucket
S3Key: [1]The S3Key should point to the zip file containing the Lambda layer code. Here, layer.zip is the correct file name.
Fix the error in the layer version declaration by completing the missing field.
Type: AWS::Lambda::LayerVersion Properties: LayerName: shared-utils [1]: - python3.9 Content: S3Bucket: my-layer-bucket S3Key: layer.zip
The correct property to specify supported runtimes for a Lambda layer is CompatibleRuntimes, which is a list of runtimes.
Fill both blanks to correctly attach the Lambda layer to a function.
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.zipThe Lambda function's Layers property requires the ARN of the layer version. The layer's CompatibleRuntimes must include the runtime used by the function, here python3.9.
Fill all three blanks to define a Lambda layer with description, compatible runtimes, and content.
Resources:
SharedLayer:
Type: AWS::Lambda::LayerVersion
Properties:
LayerName: shared-utils
Description: [1]
CompatibleRuntimes:
- [2]
Content:
S3Bucket: my-layer-bucket
S3Key: [3]The Description should clearly state the purpose of the layer. The CompatibleRuntimes must list the runtime used, and S3Key points to the zip file with the layer code.