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
Scenario: A Developer needs to decode an encoded authorization failure message.
Solution: Use the aws sts decode-authorization-message command.
26
Scenario: How can a Developer verify permission to call a CLI command without actually making a request?
Solution: Use the --dry-run parameter along with the CLI command.
27
Scenario: A Developer needs to deploy a CloudFormation template from a local computer.
Solution: Use the aws cloudformation package and aws cloudformation deploy command
28
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.
Solution: Increase the VisibilityTimeout value using the ChangeMessageVisibility API and delete the message using the DeleteMessage API.
29
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?
Solution: Use the AssumeRole API https://
30
How does Lambda scale?
Out (horizontally)
31
How do you increase the CPU available to a Lambda function?
Increase available memory
32
How do you enable tracing in Lambda functions?
1. Give Permissions to Execution Role 2. Enable Tracing with X-Ray
33
Where can you store a temporary file of 100 MB when executing a Lambda?
Use /tmp directory
34
Send request headers with multiple values as an array from Application Load Balancer to a Lambda Function
Enable Multi-value headers on ALB
35
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?
Create an Alias for your Lambda function and use it from the S3 event notification
36
Create separate dev, test, qa and prod environments for API Gateway and Lambda
Create multiple stages for API Gateway. Use Lambda Aliases as Stage Variables - map to different Lambda versions
37
Expose API around a backend SOAP web service
Use Mapping Templates to convert JSON to XML
38
You are releasing an API with breaking change. You do NOT want to impact existing clients
Deploy new version to a new stage
39
An API Gateway is invoking a Lambda. What happens if Lambda take 5 minutes to process the request
Timeout after 30 seconds (max allowed for API Gateway)
40
Can an API Gateway client invalidate a cache entry?
By using header Cache-Control:max-age=0. User Policy allows execute-api:InvalidateCache
41
Amazon Cognito Create customized plans for API Consumers - Basic, Premium, Full
Use Usage Plans
42
Amazon Cognito Maintain Your Own Registry of Hundreds of Users for a Web Application
User Pool
43
Amazon Cognito Maintain Your Own Registry of Thousands of Users for a Mobile Application
User Pool
44
Amazon Cognito Create Sign Up Pages or Sign In Pages
User Pool
45
Amazon Cognito Create Password Reset Page
User Pool
46
Amazon Cognito Guest Access or Anonymous Access
Identity Pool
47
Amazon Cognito Support authentication for your mobile/web app without needing to maintain your own users
Identity Pool
48
Amazon Cognito Give access to AWS resources based on Social IDs (OpenID/OIDC)
Identity Pool
49
Amazon Cognito Give access to AWS resources based on Corporate Directory (SAML)
Identity Pool
50
Amazon S3 Scenarios - Security Prevent objects from being deleted or overwritten for a few days or forever
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
Amazon S3 Scenarios - Security Protect against accidental deletion
Use Versioning
52
Amazon S3 Scenarios - Security Protect from changing versioning state of a bucket
Use MFA Delete. You need to be an owner of the bucket AND Versioning should be enabled.
53
Amazon S3 Scenarios - Security
54
Amazon S3 Scenarios - Security Avoid content scraping. Provide secure access.
Pre Signed URLS. Also called Query String Authentication.
55
Amazon S3 Scenarios - Security Enable cross domain requests to S3 hosted website (from www.abc.com to www.xyz.com)
Use Cross-origin resource sharing (CORS)
56
Amazon S3 Scenarios - Costs Important pricing elements
Cost of Storage (per GB), (If Applicable) Retrieval Charge (per GB), Monthly tiering fee (Only for Intelligent Tiering), Data transfer fee
57
Amazon S3 Scenarios - Costs Is Data Transfer Free?
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
Amazon S3 Scenarios - Costs Reduce Costs
Use proper storage classes. Configure lifecycle management.
59
Amazon S3 Scenarios - Costs Analyze storage access patterns and decide the right storage class
Use Intelligent Tiering. Use Storage Class Analysis reports to get an analysis
60
Amazon S3 Scenarios - Costs Move data automatically between storage classes
Use Lifecycle Rules
61
Amazon S3 Scenarios - Costs Remove objects from buckets a
Use Lifecycle Rules and configure Expiration policy
62
Improve S3 bucket performance
Use Prefixes. Supports upto 3,500 RPS to add data and 5,500 RPS to retrieve data with each S3 prefix.
63
Upload large objects to S3
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
Amazon S3 Scenarios - Performance Get part of the object
Use Byte-Range Fetches - Range HTTP header in GET Object request Recommended: GET them in the same part sizes used in multipart upload
65
Amazon S3 Scenarios - Performance Is this recommended: EC2 (Region A) <-> S3 bucket (Region B)
No. Same region recommended. Reduce network latency and data transfer costs
66
Amazon S3 Scenarios - Performance Faster Data Transfer to S3
Consider Transfer acceleration - Enable fast, easy and secure transfers of files to and from your bucket
67
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
Generate S3 inventory report Perform S3 Batch Operations using the report
68
Need S3 Bucket (or Object) Access Logs
Enable S3 Server Access Logs (default: off). Configure the bucket to use and a prefix (logs/).
69
IAM: How to rotate access keys without causing problems?
Create new access key Use new access key in all apps Disable original access key Test and verify Delete original access key
70
How are multiple permissions resolved in IAM Policy?
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
Which region are IAM users created in ?
IAM Users are global entities. Can use AWS services in any geographic region
72
What is the difference between IAM user, Federated user and Web identity federation user?
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
Relational database for analytics processing of petabytes of data
Amazon Redshift
74
Cache data from database for a web application
Amazon ElastiCache
75
Very high consistency of data is needed while processing thousands of transactions per second
RDS
76
Transaction application needing to process million transactions per second
DynamoDB