0 votes
in AWS by

You are using S3 buckets to store images. These S3 buckets invoke a lambda function on upload. The Lambda function creates thumbnails of the images and stores them in another S3 bucket. An AWS CloudFormation template is used to create the Lambda function with the resource "AWS::Lambda::Function"

Which of the following attributes is the method name that Lambda calls to execute the function? Sample CloudFormation template:

Type: AWS Propertie Architectures: - String Code: Code CodeSigningConfigArn: String DeadLetterConfig: DeadLetterConfig Description: String Environment: Environment FileSystemConfigs: - FileSystemConfig FunctionName: String Handler: String ImageConfig: ImageConfig KmsKeyArn: String Layers: - String  ambda: : Function

A. FunctionName

B. Layers

C. Environment

D. Handler.

1 Answer

0 votes
by

orrect Answer - D.

The handler is the name of the method within a code that Lambda calls to execute the function.

Option A is incorrect as the version number changes when the functions are "published", so FunctionName is incorrect.

Option B is incorrect as it's a list of function layers added to the Lambda function execution environment.

Option C is incorrect as these are variables that are accessible during Lambda function execution.

For more information on declaring Lambda Function in AWS CloudFormation Template, refer to the following URL-

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html

YAML  AWSTemplateFormatVersion: '2010-@9-09' Description: Lambda function with cfn-response. Resources:  primer:  Type: AWS::Lambda::Function Properties: Runtime: nodejs12.x Role: arn:aws:iam: :123456789012:role/lambda-role Handler: index.handler Code: ZipFile: | var aws = require('aws-sdk') var response = require('cfn-response' ) exports.handler = function(event, context) {
...