Scenarios Flashcards

1
Q

Scenario:

An application running in a local server is converted to
a Lambda function. When the function was tested, an
Unable to import module error showed.

A

Solution:

Install the missing modules in your application’s folder
and package them into a ZIP file before uploading to
AWS Lambda

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Scenario:

A Developer is writing a Lambda function that will be
used to send a request to an API in different
environments (Prod, Dev, Test). The function needs to
automatically invoke the correct API call based on the
environment.

A

Solution:

Use Environment Variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Scenario:
A Lambda function needs temporary storage to store
files while executing.

A

Solution:

Store the files in the /tmp directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Scenario:

Lambda function is writing data into an RDS database.
The function needs to reuse the database connection
to reduce execution time.

A

Solution:

Use execution context by placing the database
connection logic outside of the event handler.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Scenario:
A Developer needs to increase the CPU available to a
Lambda function to process data more efficiently.

A

Solution:
Increase the allocated memory of the function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Scenario:
A Developer has an application that uses a RESTful API
hosted in API Gateway. The API requests are failing
with a “No ‘Access-Control-Allow-Origin’
header is present on the requested
resource” error message.

A

Solution:

Enable CORS in the API Gateway Console.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Scenario:

A website integrated with API Gateway requires user
requests to reach the backend server without
intervention from the API Gateway. Which integration
type should be used?

A

Solution:

HTTP_PROXY

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Scenario:

A serverless application is composed of AWS Lambda,
DynamoDB, and API Gateway. Users are complaining
about getting HTTP 504 errors.

A

Solution:

The API requests are reaching the maximum integration
timeout for API Gateway (29 seconds).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Scenario:

How to invalidate API Gateway cache?

A

Solution:

  1. Send a request with a Cache-Control:
    max-age header.
  2. Enable the Require Authorization option
    on your API cache settings.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Scenario:

A developer needs to deploy different API versions in
API Gateway

A

Solution:

Use stage variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Scenario:

A Developer needs a cost-effective solution to delete
session data in a DynamoDB table.

A

Solution:

Expire session data with DynamoDB TTL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Scenario:

New changes to a DynamoDB table should be recorded
in another DynamoDB table.

A

Solution:

Use DynamoDB Streams

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Scenario:

Reduce the DynamoDB database response time.

A

Solution:

Use DynamoDB Accelerator (DAX)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Scenario:

Choosing the best partition key for the DynamDB table, involves

A

Solution:

Using the partition key with the highest cardinality (e.g.
student ID, employee ID)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Scenario:

An application uses a DynamoDB database with Global
Secondary Index. DynamoDB requests are returning a
ProvisionedThroughputExceededException error. Why is
this happening?

A

Solution:

The write capacity of the GSI is less than the base
table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Scenario:

What section must be added to a CloudFormation
template to include resources defined by AWS SAM?

A

Solution:

Transform

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Scenario:

A developer needs a reliable framework for building
serverless applications in AWS

A

Solution:

AWS SAM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Scenario:

A CloudFormation stack creation process failed
unexpectedly.

What happens next?

A

Solution:

CloudFormation will roll back by deleting resources that
it has already created.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Scenario:

A CloudFormation template will be used across
multiple AWS accounts

A

Solution:

Use CloudFormation StackSets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Scenario:

It is required that incoming traffic is shifted in two
increments. 10% of the traffic must be shifted in the
first increment, and the remaining 90% should be
deployed after some minutes.

A

Solution:

Canary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Scenario:

You need to authenticate users of a website using
social media identity profiles.

A

Solution:

Amazon Cognito Identity Pools

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Scenario:

A company has two accounts. The developers from
Account A need to access resources on Account B.

A

Solution:
Use cross-account access role

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Scenario:

Multiple developers need to make incremental code
updates to a single project and then deploy the new
changes.

Describe simplest way to achieve this.

A

Solution:

Use AWS CodeCommit as the code repository and
directly deploy the new package using AWS
CodeDeploy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Scenario:

A development team is using CodePipeline to automate
their deployment process. The code changes must be
reviewed by a person before releasing to production

A

Solution:

Add a manual approval action stage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Scenario:
A Developer needs to decode an encoded authorization
failure message.

A

Solution:

Use the aws sts
decode-authorization-message command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Scenario:
How can a Developer verify permission to call a CLI
command without actually making a request?

A

Solution:

Use the –dry-run parameter along with the CLI
command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Scenario:
A Developer needs to deploy a CloudFormation
template from a local computer.

A

Solution:
Use the aws cloudformation package and aws
cloudformation deploy command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Scenario:
A Developer has to ensure that no applications can
fetch a message from an SQS queue that’s being
processed or has already been processed.

A

Solution:
Increase the VisibilityTimeout value using the
ChangeMessageVisibility API and delete the
message using the DeleteMessage API.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Scenario:

A Developer has created an IAM Role for an application
that uploads files to an S3 bucket. Which API call
should the Developer use to allow the application to
make upload requests?

A

Solution:

Use the AssumeRole API
https://

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

How does Lambda scale?

A

Out (horizontally)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

How do you increase the CPU available to a Lambda function?

A

Increase available memory

32
Q

How do you enable tracing in Lambda functions?

A
  1. Give Permissions to
    Execution Role
  2. Enable Tracing with X-Ray
33
Q

Where can you store a temporary file of 100 MB when executing a Lambda?

A

Use /tmp directory

34
Q

Send request headers with multiple values as an array from Application Load
Balancer to a Lambda Function

A

Enable Multi-value headers
on ALB

35
Q

Event notifications from an S3 bucket trigger Lambda function to create
thumbnails for images. How do you avoid configuring the Lambda function
version in S3 event notification every time there is a new version?

A

Create an Alias for your
Lambda function and use it
from the S3 event
notification

36
Q

Create separate dev, test, qa and prod
environments for API Gateway and Lambda

A

Create multiple stages for API Gateway. Use Lambda
Aliases as Stage Variables - map to different Lambda
versions

37
Q

Expose API around a backend SOAP web service

A

Use Mapping Templates to convert JSON to XML

38
Q

You are releasing an API with breaking change.
You do NOT want to impact existing clients

A

Deploy new version to a new stage

39
Q

An API Gateway is invoking a Lambda. What
happens if Lambda take 5 minutes to process the
request

A

Timeout after 30 seconds (max allowed for API Gateway)

40
Q

Can an API Gateway client invalidate a cache
entry?

A

By using header Cache-Control:max-age=0.
User Policy
allows execute-api:InvalidateCache

41
Q

Amazon Cognito

Create customized plans for API Consumers -
Basic, Premium, Full

A

Use Usage Plans

42
Q

Amazon Cognito

Maintain Your Own Registry of Hundreds of Users for a Web Application

A

User Pool

43
Q

Amazon Cognito

Maintain Your Own Registry of Thousands of Users for a Mobile Application

A

User Pool

44
Q

Amazon Cognito

Create Sign Up Pages or Sign In Pages

A

User Pool

45
Q

Amazon Cognito

Create Password Reset Page

A

User Pool

46
Q

Amazon Cognito

Guest Access or Anonymous Access

A

Identity Pool

47
Q

Amazon Cognito

Support authentication for your mobile/web app without needing to maintain your own
users

A

Identity Pool

48
Q

Amazon Cognito

Give access to AWS resources based on Social IDs (OpenID/OIDC)

A

Identity Pool

49
Q

Amazon Cognito

Give access to AWS resources based on Corporate Directory (SAML)

A

Identity Pool

50
Q

Amazon S3 Scenarios - Security

Prevent objects from being deleted
or overwritten for a few days or forever

A

Use Amazon S3 Object Lock. Can be enabled only on new buckets.
Automatically enables versioning. Prevents deletion of objects. Allows
you to meet regulatory requirements

51
Q

Amazon S3 Scenarios - Security

Protect against accidental deletion

A

Use Versioning

52
Q

Amazon S3 Scenarios - Security

Protect from changing versioning
state of a bucket

A

Use MFA Delete. You need to be an owner of the bucket AND Versioning
should be enabled.

53
Q

Amazon S3 Scenarios - Security

A
54
Q

Amazon S3 Scenarios - Security

Avoid content scraping. Provide
secure access.

A

Pre Signed URLS. Also called Query String Authentication.

55
Q

Amazon S3 Scenarios - Security

Enable cross domain requests to S3
hosted website (from
www.abc.com to www.xyz.com)

A

Use Cross-origin resource sharing (CORS)

56
Q

Amazon S3 Scenarios - Costs

Important pricing elements

A

Cost of Storage (per GB), (If Applicable) Retrieval Charge (per GB),
Monthly tiering fee (Only for Intelligent Tiering), Data transfer fee

57
Q

Amazon S3 Scenarios - Costs

Is Data Transfer Free?

A

Nope. Some of free things include
Data transfer into Amazon S3, From Amazon S3 to Amazon CloudFront,
From Amazon S3 to services in the same region

58
Q

Amazon S3 Scenarios - Costs

Reduce Costs

A

Use proper storage classes.
Configure lifecycle management.

59
Q

Amazon S3 Scenarios - Costs

Analyze storage access patterns
and decide the right storage class

A

Use Intelligent Tiering.
Use Storage Class Analysis reports to get an analysis

60
Q

Amazon S3 Scenarios - Costs

Move data automatically between
storage classes

A

Use Lifecycle Rules

61
Q

Amazon S3 Scenarios - Costs

Remove objects from buckets a

A

Use Lifecycle Rules and configure Expiration policy

62
Q

Improve S3 bucket
performance

A

Use Prefixes. Supports upto 3,500 RPS to add data and 5,500 RPS to retrieve data with
each S3 prefix.

63
Q

Upload large objects
to S3

A

Use Multipart Upload API.
Advantages: 1. Quick recovery from any network issues 2. Pause and resume object
uploads 3. Begin an upload before you know the final object size.
Recommended for files >100 MB and mandatory for files >4 GB

64
Q

Amazon S3 Scenarios - Performance

Get part of the object

A

Use Byte-Range Fetches - Range HTTP header in GET Object request
Recommended: GET them in the same part sizes used in multipart upload

65
Q

Amazon S3 Scenarios - Performance

Is this recommended:
EC2 (Region A) <-> S3
bucket (Region B)

A

No. Same region recommended.
Reduce network latency and data transfer costs

66
Q

Amazon S3 Scenarios - Performance

Faster Data Transfer
to S3

A

Consider Transfer acceleration - Enable fast, easy and secure transfers of files to and
from your bucket

67
Q

I want to change object metadata or manage tags or ACL or
invoke Lambda function for billions of objects stored in a
single S3 bucket

A

Generate S3 inventory report
Perform S3 Batch Operations using the
report

68
Q

Need S3 Bucket (or Object) Access Logs

A

Enable S3 Server Access Logs (default: off).
Configure the bucket to use and a prefix
(logs/).

69
Q

IAM:

How to rotate access keys
without causing problems?

A

Create new access key
Use new access key in all apps
Disable original access key
Test and verify
Delete original access key

70
Q

How are multiple permissions
resolved in IAM Policy?

A

If there is an explicit deny - return deny
If there is no explicit deny and there is an explicit allow - allow
If there is no explicit allow or deny - deny

71
Q

Which region are IAM users
created in ?

A

IAM Users are global entities.
Can use AWS services in any geographic region

72
Q

What is the difference between
IAM user, Federated user and Web
identity federation user?

A

IAM users - created and maintained in your AWS account
Federated users - External Users outside AWS
Web identity federation users - Amazon Cognito, Amazon, Google, or
any OpenID Connect-compatible provider Accounts

73
Q

Relational database for analytics processing of petabytes of data

A

Amazon Redshift

74
Q

Cache data from database for a web application

A

Amazon
ElastiCache

75
Q

Very high consistency of data is needed while processing thousands of transactions per
second

A

RDS

76
Q

Transaction application needing to process million transactions per second

A

DynamoDB