Lambda PDF
Lambda PDF
Ask Hi,
Search Courses " ! Expert Abhilash
My All
Dashboard Inbox
Courses Courses
Report
Result
Failed
1 Other 25 8 16 1 0
Total All 25 8 16 1 0
Domain
Question 1 Incorrect
Domain : Other
You are uploading large !les to AWS S3 bucket, ranging from 1GB – 3GB. Your organization
has a requirement to calculate the hash checksum of the !le by reading entire !le so the
users can validate the checksum to identify any potential corruptions during downloads. For
this, you created a Lambda function and getting it triggered through S3 noti!cations.
However, the request is getting timed out. What could be the reason?
Lambda function is set to run in a private VPC without NAT Gateway or VPC
] B.
Endpoint. &
] C. You have not setup S3 bucket name in the environment variable.
Explanation:
Answer: B
Option A is not correct. If the function reaches the maximum con!gured memory, in this case
128 MB, the function gets terminated with an error message as below, not as request timed
out.
Memory Size: 128 MB Max Memory Used: 129 MB RequestId: xxxxxxx Process exited before
completing request
Option B is correct. AWS Lambda functions can run within a private VPC with the
resources allocated inside the subnet provided during con!guration.
For the lambda function to access S3 service endpoint from within private VPC, there should
be a NAT Gateway or S3 VPC Endpoint con!gured in the route table associated with the
subnet which was chosen during Lambda function setup. If not, the request would get timed
out.
https://aws.amazon.com/premiumsupport/knowledge-center/internet-
access-lambda-function/
Lambda function environment variables are used to con!gure additional parameters that can
be passed to lambda function.
https://docs.aws.amazon.com/lambda/latest/dg/env_variables.html
Option D is not correct. As long as Lambda function has internet access, it can access S3
service endpoints irrespective of S3 bucket region.
Question 2 Incorrect
Domain : Other
Which of the following are not the supported event sources for AWS Lambda function?
(choose 2 options)
A. AWS S3
B. AWS IoT
$ C. AWS CodePipeline
&
$ D. AWS CodeCommit
%
E. AWS OpsWorks
&
Explanation:
Answer: C, E
Following are the supported event sources for AWS Lambda function.
https://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-
function.html
Question 3 Correct
Domain : Other
Your organization is having a requirement to perform big data analysis to transform data and
store the result in AWS S3 bucket. They have implemented the solution using AWS Lambda
due to its zero-administrative maintenance and cost-e"ective nature. However, in very few
cases, the execution is getting abruptly terminated after 5 minutes. They would like to get a
noti!cation in such scenarios. What would you do?
Setup timer in the code and send noti!cation when the timer reaches 300
] A.
seconds.
Explanation:
Answer: D
Option A is not correct. Although you can set the timers in the code, it may not be accurate
measure to !nd if the lambda function is terminated after 300 seconds or it just !nished
executing on 300th second.
Option B is not correct. There is no option to con!gure AWS SES within Lambda setup.
Option C is not a valid statement.
Option D is correct. You can forward non-processed payloads to Dead Letter Queue (DLQ)
using
https://aws.amazon.com/blogs/compute/robust-serverless-application-design-
with-aws-lambda-dlq/
Question 4 Correct
Domain : Other
Your organization uploads relatively large compressed !les ranging between 100MB –
200MB in size to AWS S3 bucket. Once uploaded, they are looking to calculate the total
number objects in the compressed !le and add the total count as a metadata to the
compressed !le in AWS S3. They approached you for a cost-e"ective solution. You have
recommended using AWS Lambda through S3 event noti!cations to perform this operation.
However, they were concerned about failures as S3 event noti!cation is an asynchronous
one-time trigger and Lambda can fail due to operation time outs, max memory limits, max
execution time limits etc. What is the best retry approach you recommend?
All the failed events will be logged to CloudWatch. You can manually retrigger
] A.
failed events.
] D. Enable Active tracing using AWS X-Ray. It will automatically retrigger failed events.
Explanation:
Answer: B
Option B is correct. You can forward non-processed or failed payloads to Dead Letter Queue
Option C is not correct. Max memory limit and max execution time limit gets terminated
without being caught in the handler exception.
Option D is not correct. Active tracing option can be used for detailed logging. It will not retry
failed events.
https://docs.aws.amazon.com/lambda/latest/dg/lambda-x-ray.html
Question 5 Incorrect
Domain : Other
You have a requirement to create a REST API using AWS API Gateway with Lambda as
backend system and Oracle RDS instance as database. You have created API methods,
Lambda function code and spinned up Oracle RDS instance in a private VPC with no Internet
Gateway. When you are trying to connect to RDS instance from your Lambda, connection
getting failed. What could be the reason? (choose 2 options)
$ A. Lambda execution role does not have policy to access RDS instance.
%
B. Lambda function is running in “no VPC” network mode.
&
RDS instance security group is not allowing connections from Lambda
C.
subnet range. &
Answer: B, C
Option A is not correct. A policy on the role can only de!ne access to which API
actions can be made on RDS instance such as rds:CreateDBInstance,
rds:CreateDBSecurityGroup, rds:CreateDBSnapshot etc. The policy will not de!ne
whether a resouce can connect to RDS instance or not.
Option B is correct. When Lambda function is running in “no VPC” network mode,
it will not have access to resources running in a private VPC.
https://docs.aws.amazon.com/lambda/latest/dg/vpc.html
Option C is correct. Security groups act as a !rewall for any resources (such as
RDS instance and Lambda in this case) they are connected with. If there is no
inbound rule de!ned to allow connections from Lambda subnet IP range or the
Lambda security group, connections will fail.
https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html
Question 6 Correct
Domain : Other
Which of the following is customer’s responsibility with respect to AWS Lambda service?
(choose 2 options)
C. Security patches.
Explanation:
Answer: A, E
Option A is correct.
Option D is not correct. You cannot login to underlying compute instances of lambda
execution. So, we cannot install any required libraries. However, you can package all the
required dependent libraries along with your code.
Refer below documentation for more information on creating deployment package for
Lambda functions.
https://docs.aws.amazon.com/lambda/latest/dg/with-s3-example-deployment-
pkg.html
Option E is correct. AWS Lambda assumes the role assigned during setup to access any
AWS resources it performs any action on. Policy on the role must grant access on any such
resources in order for Lambda to perform operations, for example S3 getobject, Dynamodb
GetItem etc.
https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-
model.html#lambda-intro- execution-role
Question 7 Incorrect
Domain : Other
Which of the following is not a potential use case for using AWS Lambda?
Periodically check the log !les for errors in CloudWatch or CloudTrail and send out
] A.
noti!cations through SNS.
] C. Scheduled job to generate AWS resource usage reports based on certain tags.
A website with highly scalable backend layer which will persist data into RDS
] D.
%
$
or DynamoDB.
Explanation:
Answer: B
Option A is a potential use case for AWS Lambda. You can use Lambda as scheduled event
and read log !les from AWS CloudWatch or CloudTrail and report any errors through SNS
noti!cations.
You can host the web frontend on S3, and accelerate content delivery with Cloudfront
caching. The web frontend can send requests to Lambda functions via API Gateway HTTPS
endpoints. Lambda can handle the application logic, and persist data to a fully managed
database service
(RDS for relational, or DynamoDB for non relational database). You can host your Lambda
functions and databases within a VPC to isolate them from other networks.
https://aws.amazon.com/getting-started/projects/build-serverless-web-
app-lambda-apigateway-s3-dynamodb-cognito/
Option B looks like a potential use case. But the scenario will fail due to the /tmp directory
space limitation.
Question 8 Correct
Domain : Other
You have created a Lambda function for reading data from Kinesis stream of transactions. In
the code you were using context logger so that it can log to CloudWatch and you can
monitor them at later point of time. Lambda function started running along with Kinesis
stream, however, you do not see any log entries for the new Lambda function. What could
the reason?
Lambda functions with Kinesis stream as event source do not write logs to
] A.
CloudWatch.
Lambda execution role policy does not have access to create CloudWatch
] B.
&
$
logs.
Explanation:
Answer: B
Option A is not a valid statement. Lambda function will write logs as long as the execution
role has access to create and write CloudWatch logs irrespective of source that triggered it.
Option B is correct.
Option C is not correct. AWS CloudTrail is used for logging API calls made to services such
as
https://docs.aws.amazon.com/lambda/latest/dg/with-cloudtrail.html
Option D is not correct. AWS X-Ray traces requests made to your serverless applications
built using AWS Lambda. This will not be the reason for failing to write logs to CloudWatch.
https://docs.aws.amazon.com/lambda/latest/dg/lambda-x-ray.html
Question 9 Incorrect
Domain : Other
When con!guring AWS SQS as event source for AWS Lambda function, what is the
maximum batch size supported by AWS SQS for ReceiveMessage call?
] A. 20
%
$
] B. 40
] C. 10
&
] D. 100
Explanation:
Answer: C
https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html
Question 10 Incorrect
Domain : Other
You are to planning to schedule a daily job with AWS CloudWatch scheduled event and
AWS Lambda function as trigger to the event which will perform daily health check on your
applications running on $eet of EC2 instances. For you to achieve this, you need to provide
the EC2 instances’ name tags to identify right resources. What is the correct way of passing
the inputs in this case?
You can modify the “Matched Event” option while selecting AWS Lambda as trigger
] B.
for CloudWatch scheduled event.
You can set “Constant (JSON text)” option while selecting AWS Lambda as
] C.
trigger for CloudWatch scheduled event. &
“Details” object of “Matched Event” can be con!gured while creating AWS
] D.
CloudWatch scheduled event.
Explanation:
Answer: C
When using an AWS Cloudwatch rule to trigger a Lambda event, one of the multiple options
you have to pass data onto your Lamba function is “Constant (JSON Text)”. This handy
feature allows you to send static content to your function instead of the matched event.
https://aws.amazon.com/blogs/compute/simply-serverless-use-constant-
values-in-cloudwatch-event-triggered-lambda-functions/
Ask our Experts Rate this Question?
' (
Question 11 Incorrect
Domain : Other
You have an existing AWS setup with DirectConnect. You have migrated certain on premise
backend applications to AWS EC2 instances which are having certain processes run based
on triggers from other applications. These processes are developed on JAVA programming
language. Your organization is looking to migrate these processes to Lambda and reduce
the cost incurred on EC2 instances. What would be your recommendation?
AWS Lambda cannot be invoked from a custom application. They can only be
] A.
triggered by AWS supported event sources.
Replicate the JAVA code easily onto AWS Lambda function with few
] B.
modi!cations and use Lambda Invoke API with input passed as custom event. &
Trigger Lambda from AWS CloudWatch scheduled event and invoke
] C.
%
$
CloudWatch API from your applications.
AWS Lambda is not designed to run backend applications. Better to use EC2 for that
] D.
purpose.
Explanation:
Answer: B
You can invoke a Lambda function using a custom event through AWS Lambda’s invoke API.
Only the function’s owner or another AWS account that the owner has granted permission
can invoke the function.
https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html
https://docs.aws.amazon.com/lambda/latest/dg/with-userapp.html
Question 12 Correct
Domain : Other
Which of the following are AWS CloudFront events that can trigger AWS Lambda@edge
function? (choose 3 options)
$ A. Viewer Request
&
B. CloudFront Cache
C. Sender Request
$ D. Origin Request
&
$ E. Origin Response
&
Explanation:
Answer: A, D, E
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-
cloudfront-trigger-events.html
Question 13 Incorrect
Domain : Other
You created an AWS Lambda function to process !les uploaded to AWS S3 bucket. Lambda
function started receiving requests and working properly. You have changed the code and
uploaded new version of code to AWS Lambda function. What will happen to the requests
sent right after the AWS lambda function update?
Requests will queue until the changes are fully propagated. You might see a
] A.
%
$
slight latency during this period.
] B. Requests will be served by old version till you enable new version as latest.
When you have multiple versions of Lambda function, in the code you need to de!ne
] C.
which version of function to be used. Otherwise, requests would fail.
Requests might be served by old or new version for a brief period of less than
] D.
one minute. &
Explanation:
Answer: D
Option B is not correct. By default, whenever you update the code, it updates the LATEST
version.
Option C is not correct. There is no need to de!ne in code which version to be used.
However, you can de!ne which version to be used at the source which triggers Lambda
function by providing version quali!ed ARN if you have published version.
Ask our Experts Rate this Question? ' (
Question 14 Incorrect
Domain : Other
Which of the following are poll based event sources for AWS Lambda function? (choose 3
options)
$ A. AWS SNS
%
$ B. AWS Kinesis
&
$ C. AWS SQS
&
D. AWS DynamoDB
&
E. AWS CodePipeline
Explanation:
Answer: B, C, D
https://docs.aws.amazon.com/lambda/latest/dg/invocation-options.html?
shortFooter=true#streaming-event-source-mapping
Question 15 Correct
Domain : Other
You work for a team which has 10s of applications running on AWS EC2 instances. All these
applications would need a common backend processing job. You have created an AWS
Lambda function with name “app-backend-job”and published PROD version with version “1”
in order to make sure any changes to the function by anyone will not impact the PROD
execution code. You have shared the version quali!ed ARN to all the applications assuming
requests would be sent to the speci!c version. However, due to frequent changes in
requirements, you had to change the code of Lambda function many times and
keep publishing versions. This is causing a lot of overhead at the application level
to update the Lambda function ARN each time you publish a new version. How
can you overcome this situation?
Create an alias, point it to PROD version and share the ARN with applications.
] A.
&
$
When new version is published, change the alias to point to it.
Do not publish versions for every code change. Instead, update the published
] B.
version so that ARN to be invoked will not change.
Delete the old published version “1” before publishing new version. This way when
] C. you publish, you will get the version ID as “1” and the lambda version ARN will remain
unchanged.
Do not use versioning in this case. Always use $LATEST version and share its ARN
] D.
with applications.You can update the codes of $LATEST version any number of times.
Explanation:
Answer: A
By using aliases, you can access the Lambda function an alias is pointing to (for example, to
invoke the function) without the caller having to know the speci!c version the alias is
pointing to.
https://docs.aws.amazon.com/lambda/latest/dg/aliases-intro.html?
shortFooter=true
https://docs.aws.amazon.com/lambda/latest/dg/versioning-intro.html?
shortFooter=true
$LATEST version, there are chances that the con!guration can be meddled and can cause
unwanted issues.
https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html?
shortFooter=true
Question 16 Incorrect
Domain : Other
Which of the following are correct ARNs for a Lambda function? (choose 3 options)
A. arn:aws:lambda:aws-region:acct-id:function:helloworld:$LATEST
&
$ B. arn:aws:lambda:aws-region:acct-id:function:helloworld
&
$ C. arn:aws:lambda:aws-region:acct-id:function:helloworld/$LATEST
%
D. arn:aws:lambda:aws-region:acct-id:function:helloworld:PROD
&
$ E. arn:aws:lambda:aws-region:acct-id:function:helloworld/1
%
Explanation:
Answer: A, B, D
Question 17 Incorrect
Domain : Other
Explanation:
Answer: C
Option D is not correct. Maximum memory that can be allocated is 3008 MB.
Please refer to the below link to get further information:
https://docs.aws.amazon.com/lambda/latest/dg/limits.html
Question 18 Incorrect
Domain : Other
Your organization has two accounts, for DEV and TEST. You have certain user applications
running on TEST account would like to trigger AWS Lambda on DEV account. What is the
permission model which needs to be set in order to get this con!guration working?
Add permission for TEST account on DEV account’s lambda execution role
] C.
policy through AWS CLI.
Add permission for TEST account on DEV account’s lambda function policy
] D.
through AWS Console.
Explanation:
Answer: A
https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-
based.html?shortFooter=true#access-control-resource-based-example-cross-
account-scenario
Options B, C are not correct. Permission need to be added on the Lambda function policy to
invoke the function, not on execution role policy.
Option D is not correct. Lambda function policy cannot be edited from AWS console.
For more information, please fere to the below mentioned AWS docs:
https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-
based.html
Question 19 Incorrect
Domain : Other
You have a requirement to create an AWS Lambda function inside a private VPC which will
be communicating with RDS instance inside the same private VPC. You have setup the
memory to be 1 GB for the Lambda function. You expect concurrent request during peak to
be 100 per sec and average Function execution tome is 1 sec.
What should be the minimum subnet range you must choose for creating a subnet to run
the Lambda function successfully without any issues?
] A. x.x.x.x/24
] B. x.x.x.x/25
] C. x.x.x.x/26
&
] D. x.x.x.x/27
%
$
Explanation:
Answer: C
https://docs.aws.amazon.com/lambda/latest/dg/vpc.html#vpc-setup-
guidelines
/24 CIDR range comes with 256 IP address with 251 available IP addresses
/25 CIDR range comes with 128 IP address with 123 available IP addresses.
4. Con!gure your function to use all the subnets available inside the VPC that have
access to the resource that your function needs to connect to. This both
maximises Actual ENI Capacity and provides higher availability (assuming
subnets are spread across 2+ availability zones).
6. If Required ENI Capacity > Actual ENI Capacity, then you will need to
do one or more of the following:
Question 20 Incorrect
Domain : Other
Which of the following services does the DLQ con!gured under lambda gets populated on
error? (choose 2 options)
$ A. AWS SQS
&
$ B. AWS Kinesis
%
C. AWS SNS
&
D. AWS CloudWatch
E. AWS X-Ray
Explanation:
Answer: A, C
https://docs.aws.amazon.com/lambda/latest/dg/dlq.html?shortFooter=true
Question 21 Correct
Domain : Other
You are setting up AWS Lambda function to receive messages from SQS queue, process the
message body and insert one record in MySQL RDS instance. You have setup SQS event
trigger as AWS Lambda function. However, for connecting to RDS instance, you need MySQL
details such as hostname, username and password. Where would you con!gure them?
Use properties !le in AWS Lambda function for any such con!guration. Properties
] C.
!les are encrypted by AWS in transit and at rest.
Answer: B
https://docs.aws.amazon.com/lambda/latest/dg/env_variables.html?
shortFooter=true
Option A is not correct. The statement is true, however the encryption only
happens after deployment of lambda function.
Option D looks correct. However, out of given options, Option B is more valid and
recommended.
Question 22 Correct
Domain : Other
Which of the following actions required by Lambda execution role in order to write the logs
into
AWS CloudWatch? (choose 3 options)
$ A. logs:CreateLogGroup
&
B. logs:GetLogEvents
$ C. logs:CreateLogStream
&
D. logs:DescribeLogStreams
$ E. logs:PutLogEvents
&
Explanation:
Answer: A, C, E
https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-
model.html?shortFooter=true#lambda-intro-execution-role
Question 23 Incorrect
Domain : Other
Which of the following options is not AWS CloudWatch metric for AWS Lambda function?
] A. Memory
&
] B. Dead Letter Error
%
$
] C. Duration
] D. Invocations
Explanation:
Answer: A
Question 24 Unattempted
Domain : Other
You are creating a production mode Lambda function. Due to auditing compliance, your
organization stated that production grade code must not be modi!ed during its execution
unless the modi!cation goes through a change process. For that, you decided to publish
version for PROD, create an alias and use the alias ARN for invoking the Lambda function.
However, your organization stated the code should not run if the version is $LATEST. How
would you achieve this? (choose 2 options)
Explanation:
Answer: A, C
For more information on environment variables available to Lambda functions, refer
documentation here.
https://docs.aws.amazon.com/lambda/latest/dg/env_variables.html
https://docs.aws.amazon.com/lambda/latest/dg/tutorial-env_cli.html
Option B is not correct. There is no parameter in any event source containing ARN of the
invoked Lambda function.
Question 25 Incorrect
Domain : Other
Which of the following statement is not true with respect to default retry behaviour of AWS
Lambda function?
With synchronous invocation, the invoking application receives a 429
] A.
error and is responsible for retries. &
With asynchronous invocation, if AWS Lambda is unable to fully process the
] B. event and if you don't specify a Dead Letter Queue (DLQ), the event will be
discarded.
With Poll-based (or pull model) event sources that are stream-based, when
a Lambda function invocation fails, AWS Lambda attempts to process the
] C.
erring batch of records until the time the data expires, which can be up to
seven days.
Explanation:
Answer: A
Synchronous invocation – Lambda includes the FunctionError !eld in the response body,
with details about the error in the X-Amz-Function-Error header. The status code
is 200 for function errors
Event sources that aren't stream-based – Some of these event sources are set up
to invoke a Lambda function synchronously and others invoke it asynchronously.
Accordingly, exceptions are handled as follows:
AWS service triggers can retry depending on the service. If you invoke the
Lambda function directly from your application, you can choose whether to
retry or not.
https://docs.aws.amazon.com/lambda/latest/dg/retries-on-errors.html?
shortFooter=true
Finish Review
PM Certi"cation Blog