AWS - Lambda - multichoice questions

Question 1

A video processing lambda function is being triggered upon new video uploading to S3. The function performs resizing and upload the processed video to another S3 bucket.

What could be a potential limit?

Question 2

The Lambda function service is:

Question 3

How can you configure the OS your Lambda runs on?

Question 4

Consider the following lambda function

import boto3

dynamodb_client = boto3.client('dynamodb')

COUNTER = 0

def lambda_handler(event, context):
    global COUNTER
    COUNTER += 1

    dynamodb_client.put_item(
        TableName='fruitSalad',
        Item={
            'counter':{'S': str(COUNTER)}
        }
    )

Given two successful different invocation on the same execution environment, as described bellow:

What would be the value of counter in DynamoDB fruitSalad table? (assume there were no additional invocations except the above two)

Question 5

Given the below Python lambda:

def lambda_handler(event, context):
    file_path = 'myfile.txt'
    with open(file_path, 'w') as file:
        file.write('This is a write operation.')

What could be a potential problem?

Question 6

Given the below lambda function

import boto3
import pymysql

def lambda_handler(event, context):
    database_username = "admin"
    database_password = "secretpassword"
    connection = pymysql.connect(
        host='...',
        user=database_username,
        password='database_password',
        database='mydb'
    )

The code above contains sensitive data, directly hardcoded in the code.

How could that vulnerability be mitigated?

Question 7

You are developing a serverless application that requires the use of a custom Python library across multiple AWS Lambda functions. The library contains common utility functions and dependencies that need to be shared among the functions.

What is the recommended AWS service or feature to streamline the deployment and maintenance of the library across the Lambda functions?

Question 8

You are optimizing the performance of your AWS Lambda functions. You goal is to increase the CPU resources allocated to your lambda.

What would you do?

Question 9

You need to estimate the required provisioning capacity for an AWS Lambda function that is expected to handle a sustained load of 500 requests per second. Each request takes approximately 15 milliseconds to process.

Based on these requirements, which of the following calculations best match the minimum number of concurrent executions needed to handle the expected load?

Question 10

You have developed an asynchronous AWS Lambda function that processes messages from an event source. What happens in the case of a failure during the execution of the function?

Question 11

You have developed an synchronous AWS Lambda function that processes messages from an event source. What happens in the case of a failure during the execution of the function?

Question 12

You are developing an AWS Lambda function that needs to access other AWS resources within your account, such as an Amazon DynamoDB table and an Amazon S3 bucket.

How can you enable the Lambda function to securely access these resources?

Question 13

You are developing an AWS Lambda function that should communicate with one of your EC2 instances located in a private VPC.

How can you support this requirements?