misc deck dump Flashcards

1
Q

A company is implementing an application on Amazon EC2 instances. The application needs to process incoming transactions. When the application detects a transaction that is not valid, the application must send a chat message to the company’s support team. To send the message, the application needs to retrieve the access token to authenticate by using the chat API.
A developer needs to implement a solution to store the access token. The access token must be encrypted at rest and in transit. The access token must also be accessible from other AWS accounts.
Which solution will meet these requirements with the LEAST management overhead?

A. Use an AWS Systems Manager Parameter Store SecureString parameter that uses an AWS Key Management Service (AWS KMS) AWS managed key to store the access token. Add a resource-based policy to the parameter to allow access from other accounts. Update the IAM role of the EC2 instances with permissions to access Parameter Store. Retrieve the token from Parameter Store with the decrypt flag enabled. Use the decrypted access token to send the message to the chat.
B. Encrypt the access token by using an AWS Key Management Service (AWS KMS) customer managed key. Store the access token in an Amazon DynamoDB table. Update the IAM role of the EC2 instances with permissions to access DynamoDB and AWS KMS. Retrieve the token from DynamoDDecrypt the token by using AWS KMS on the EC2 instances. Use the decrypted access token to send the message to the chat.
C. Use AWS Secrets Manager with an AWS Key Management Service (AWS KMS) customer managed key to store the access token. Add a resource-based policy to the secret to allow access from other accounts. Update the IAM role of the EC2 instances with permissions to access Secrets Manager. Retrieve the token from Secrets Manager. Use the decrypted access token to send the message to the chat.
D. Encrypt the access token by using an AWS Key Management Service (AWS KMS) AWS managed key. Store the access token in an Amazon S3 bucket. Add a bucket policy to the S3 bucket to allow access from other accounts. Update the IAM role of the EC2 instances with permissions to access Amazon S3 and AWS KMS. Retrieve the token from the S3 bucket. Decrypt the token by using AWS KMS on the EC2 instances. Use the decrypted access token to send the massage to the chat

A

C. Use AWS Secrets Manager with an AWS Key Management Service (AWS KMS) customer managed key to store the access token. Add a resource-based policy to the secret to allow access from other accounts. Update the IAM role of the EC2 instances with permissions to access Secrets Manager. Retrieve the token from Secrets Manager. Use the decrypted access token to send the message to the chat.

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

A company is running Amazon EC2 instances in multiple AWS accounts. A developer needs to implement an application that collects all the lifecycle events of the EC2 instances. The application needs to store the lifecycle events in a single Amazon Simple Queue Service (Amazon SQS) queue in the company’s main AWS account for further processing.
Which solution will meet these requirements?

A. Configure Amazon EC2 to deliver the EC2 instance lifecycle events from all accounts to the Amazon EventBridge event bus of the main account. Add an EventBridge rule to the event bus of the main account that matches all EC2 instance lifecycle events. Add the SQS queue as a target of the rule.
B. Use the resource policies of the SQS queue in the main account to give each account permissions to write to that SQS queue. Add to the Amazon EventBridge event bus of each account an EventBridge rule that matches all EC2 instance lifecycle events. Add the SQS queue in the main account as a target of the rule.
C. Write an AWS Lambda function that scans through all EC2 instances in the company accounts to detect EC2 instance lifecycle changes. Configure the Lambda function to write a notification message to the SQS queue in the main account if the function detects an EC2 instance lifecycle change. Add an Amazon EventBridge scheduled rule that invokes the Lambda function every minute.
D. Configure the permissions on the main account event bus to receive events from all accounts. Create an Amazon EventBridge rule in each account to send all the EC2 instance lifecycle events to the main account event bus. Add an EventBridge rule to the main account event bus that matches all EC2 instance lifecycle events. Set the SQS queue as a target for the rule.

A

D. Configure the permissions on the main account event bus to receive events from all accounts. Create an Amazon EventBridge rule in each account to send all the EC2 instance lifecycle events to the main account event bus. Add an EventBridge rule to the main account event bus that matches all EC2 instance lifecycle events. Set the SQS queue as a target for the rule

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

An application is using Amazon Cognito user pools and identity pools for secure access. A developer wants to integrate the user-specific file upload and download features in the application with Amazon S3. The developer must ensure that the files are saved and retrieved in a secure manner and that users can access only their own files. The file sizes range from 3 KB to 300 MB.
Which option will meet these requirements with the HIGHEST level of security?

A. Use S3 Event Notifications to validate the file upload and download requests and update the user interface (UI).
B. Save the details of the uploaded files in a separate Amazon DynamoDB table. Filter the list of files in the user interface (UI) by comparing the current user ID with the user ID associated with the file in the table.
C. Use Amazon API Gateway and an AWS Lambda function to upload and download files. Validate each request in the Lambda function before performing the requested operation.
D. Use an IAM policy within the Amazon Cognito identity prefix to restrict users to use their own folders in Amazon S3.

A

D. Use an IAM policy within the Amazon Cognito identity prefix to restrict users to use their own folders in Amazon S3

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

A company is building a scalable data management solution by using AWS services to improve the speed and agility of development. The solution will ingest large volumes of data from various sources and will process this data through multiple business rules and transformations.
The solution requires business rules to run in sequence and to handle reprocessing of data if errors occur when the business rules run. The company needs the solution to be scalable and to require the least possible maintenance.
Which AWS service should the company use to manage and automate the orchestration of the data flows to meet these requirements?

A. AWS Batch
B. AWS Step Functions
C. AWS Glue
D. AWS Lambda

A

B. AWS Step Functions

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

A developer has created an AWS Lambda function that is written in Python. The Lambda function reads data from objects in Amazon S3 and writes data to an Amazon DynamoDB table. The function is successfully invoked from an S3 event notification when an object is created. However, the function fails when it attempts to write to the DynamoDB table.
What is the MOST likely cause of this issue?

A. The Lambda function’s concurrency limit has been exceeded.
B. DynamoDB table requires a global secondary index (GSI) to support writes.
C. The Lambda function does not have IAM permissions to write to DynamoDB.
D. The DynamoDB table is not running in the same Availability Zone as the Lambda function.

A

C. The Lambda function does not have IAM permissions to write to DynamoDB

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

A developer is creating an AWS CloudFormation template to deploy Amazon EC2 instances across multiple AWS accounts. The developer must choose the EC2 instances from a list of approved instance types.
How can the developer incorporate the list of approved instance types in the CloudFormation template?

A. Create a separate CloudFormation template for each EC2 instance type in the list.
B. In the Resources section of the CloudFormation template, create resources for each EC2 instance type in the list.
C. In the CloudFormation template, create a separate parameter for each EC2 instance type in the list.
D. In the CloudFormation template, create a parameter with the list of EC2 instance types as AllowedValues.

A

D. In the CloudFormation template, create a parameter with the list of EC2 instance types as AllowedValues.

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

A developer has an application that makes batch requests directly to Amazon DynamoDB by using the BatchGetItem low-level API operation. The responses frequently return values in the UnprocessedKeys element.
Which actions should the developer take to increase the resiliency of the application when the batch response includes values in UnprocessedKeys? (Choose two.)

A. Retry the batch operation immediately.
B. Retry the batch operation with exponential backoff and randomized delay.
C. Update the application to use an AWS software development kit (AWS SDK) to make the requests.
D. Increase the provisioned read capacity of the DynamoDB tables that the operation accesses.
E. Increase the provisioned write capacity of the DynamoDB tables that the operation accesses.

A

B. Retry the batch operation with exponential backoff and randomized delay.
D. Increase the provisioned read capacity of the DynamoDB tables that the operation accesses

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

A company is running a custom application on a set of on-premises Linux servers that are accessed using Amazon API Gateway. AWS X-Ray tracing has been enabled on the API test stage.
How can a developer enable X-Ray tracing on the on-premises servers with the LEAST amount of configuration?

A. Install and run the X-Ray SDK on the on-premises servers to capture and relay the data to the X-Ray service.
B. Install and run the X-Ray daemon on the on-premises servers to capture and relay the data to the X-Ray service.
C. Capture incoming requests on-premises and configure an AWS Lambda function to pull, process, and relay relevant data to X-Ray using the PutTraceSegments API call.
D. Capture incoming requests on-premises and configure an AWS Lambda function to pull, process, and relay relevant data to X-Ray using the PutTelemetryRecords API call.

A

B. Install and run the X-Ray daemon on the on-premises servers to capture and relay the data to the X-Ray service

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

A company wants to share information with a third party. The third party has an HTTP API endpoint that the company can use to share the information. The company has the required API key to access the HTTP API.
The company needs a way to manage the API key by using code. The integration of the API key with the application code cannot affect application performance.
Which solution will meet these requirements MOST securely?

A. Store the API credentials in AWS Secrets Manager. Retrieve the API credentials at runtime by using the AWS SDK. Use the credentials to make the API call.
B. Store the API credentials in a local code variable. Push the code to a secure Git repository. Use the local code variable at runtime to make the API call.
C. Store the API credentials as an object in a private Amazon S3 bucket. Restrict access to the S3 object by using IAM policies. Retrieve the API credentials at runtime by using the AWS SDK. Use the credentials to make the API call.
D. Store the API credentials in an Amazon DynamoDB table. Restrict access to the table by using resource-based policies. Retrieve the API credentials at runtime by using the AWS SDK. Use the credentials to make the API call.

A

A. Store the API credentials in AWS Secrets Manager. Retrieve the API credentials at runtime by using the AWS SDK. Use the credentials to make the API call.

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

A developer is deploying a new application to Amazon Elastic Container Service (Amazon ECS). The developer needs to securely store and retrieve different types of variables. These variables include authentication information for a remote API, the URL for the API, and credentials. The authentication information and API URL must be available to all current and future deployed versions of the application across development, testing, and production environments.
How should the developer retrieve the variables with the FEWEST application changes?

A. Update the application to retrieve the variables from AWS Systems Manager Parameter Store. Use unique paths in Parameter Store for each variable in each environment. Store the credentials in AWS Secrets Manager in each environment.
B. Update the application to retrieve the variables from AWS Key Management Service (AWS KMS). Store the API URL and credentials as unique keys for each environment.
C. Update the application to retrieve the variables from an encrypted file that is stored with the application. Store the API URL and credentials in unique files for each environment.
D. Update the application to retrieve the variables from each of the deployed environments. Define the authentication information and API URL in the ECS task definition as unique names during the deployment process.

A

A. Update the application to retrieve the variables from AWS Systems Manager Parameter Store. Use unique paths in Parameter Store for each variable in each environment. Store the credentials in AWS Secrets Manager in each environment.

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

A developer is creating an AWS Lambda function that will connect to an Amazon RDS for MySQL instance. The developer wants to store the database credentials. The database credentials need to be encrypted and the database password needs to be automatically rotated.

Which solution will meet these requirements?

A. Store the database credentials as environment variables for the Lambda function. Set the environment variables to rotate automatically.

B. Store the database credentials in AWS Secrets Manager. Set up managed rotation on the database credentials.

C. Store the database credentials in AWS Systems Manager Parameter Store as secure string parameters. Set up managed rotation on the parameters.

D. Store the database credentials in the X-Amz-Security-Token parameter. Set up managed rotation on the parameter.

A

B. Store the database credentials in AWS Secrets Manager. Set up managed rotation on the database credentials.

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

A developer registered an AWS Lambda function as a target for an Application Load Balancer (ALB) using a CLI command. However, the Lambda function is not being invoked when the client sends requests through the ALB. Why is the Lambda function not being invoked?

A. A Lambda function cannot be registered as a target for an ALB.

B. A Lambda function can be registered with an ALB using AWS Management Console only.

C. The permissions to invoke the Lambda function are missing.

D. Cross-zone is not enabled on the ALB.

A

C. The permissions to invoke the Lambda function are missing.

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

A company is hosting a workshop for external users and wants to share the reference documents with the external users for 7 days. The company stores the reference documents in an Amazon S3 bucket that the company owns.

What is the MOST secure way to share the documents with the external users?

A. Use S3 presigned URLs to share the documents with the external users. Set an expiration time of 7 days.

B. Move the documents to an Amazon WorkDocs folder. Share the links of the WorkDocs folder with the external users.

C. Create temporary IAM users that have read-only access to the S3 bucket. Share the access keys with the external users. Expire the credentials after 7 days.

D. Create a role that has read-only access to the S3 bucket. Share the Amazon Resource Name (ARN) of this role with the external users.

A

A. Use S3 presigned URLs to share the documents with the external users. Set an expiration time of 7 days.

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

A developer is planning to use an Amazon API Gateway and AWS Lambda to provide a REST API. The developer will have three distinct environments to manage: development, test, and production.

How should the application be deployed while minimizing the number of resources to manage?

A. Create a separate API Gateway and separate Lambda function for each environment in the same Region.

B. Assign a Region for each environment and deploy API Gateway and Lambda to each Region.

C. Create one API Gateway with multiple stages with one Lambda function with multiple aliases.

D. Create one API Gateway and one Lambda function, and use a REST parameter to identify the environment.

A

C. Create one API Gateway with multiple stages with one Lambda function with multiple aliases.

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

A developer has built an application that inserts data into an Amazon DynamoDB table. The table is configured to use provisioned capacity. The application is deployed on a burstable nano Amazon EC2 instance. The application logs show that the application has been failing because of a ProvisionedThroughputExceededException error.

Which actions should the developer take to resolve this issue? (Choose two.)

A. Move the application to a larger EC2 instance.

B. Increase the number of read capacity units (RCUs) that are provisioned for the DynamoDB table.

C. Reduce the frequency of requests to DynamoDB by implementing exponential backoff.

D. Increase the frequency of requests to DynamoDB by decreasing the retry delay.

E. Change the capacity mode of the DynamoDB table from provisioned to on-demand.

A

C. Reduce the frequency of requests to DynamoDB by implementing exponential backoff.
E. Change the capacity mode of the DynamoDB table from provisioned to on-demand

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

An application uses AWS X-Ray to generate a large amount of trace data on an hourly basis. A developer wants to use filter expressions to limit the returned results through user-specified custom attributes.

How should the developer use filter expressions to filter the results in X-Ray?

A. Add custom attributes as annotations in the segment document.

B. Add custom attributes as metadata in the segment document.

C. Add custom attributes as new segment fields in the segment document.

D. Create new sampling rules that are based on custom attributes.

A

A. Add custom attributes as annotations in the segment document

17
Q

A web application is using Amazon Kinesis Data Streams for clickstream data that may not be consumed for up to 12 hours.

How can the developer implement encryption at rest for data within the Kinesis Data Streams?

A. Enable SSL connections to Kinesis.

B. Use Amazon Kinesis Consumer Library.

C. Encrypt the data once it is at rest with a Lambda function.

D. Enable server-side encryption in Kinesis Data Streams.

A

D. Enable server-side encryption in Kinesis Data Streams.

18
Q

An application is real-time processing millions of events that are received through an API.

What service could be used to allow multiple consumers to process the data concurrently and MOST cost-effectively?

A. Amazon SNS with fanout to an SQS queue for each application

B. Amazon SNS with fanout to an SQS FIFO (first-in, first-out) queue for each application

C. Amazon Kinesis Firehose

D. Amazon Kinesis Data Streams

A

D. Amazon Kinesis Data Streams

19
Q

Given the following AWS CloudFormation template:

“Description: Create a new Amazon S3 bucket for shared content. Uses a random bucket name to avoid conflicts.
Resources:
ContentBucket: Type: AWS: S3: Bucket
Output:
ContentBucketName:
Value: !Ref ContentBucket”

What is the MOST efficient way to reference the new Amazon S3 bucket from another AWS CloudFormation template?

A. Add an Export declaration to the Outputs section of the original template and use ImportValue in other templates.

B. Add Exported: true to the Content.Bucket in the original template and use ImportResource in other templates.

C. Create a custom AWS CloudFormation resource that gets the bucket name from the ContentBucket resource of the first stack.

D. Use Fn::Include to include the existing template in other templates and use the ContentBucket resource directly.

A

A. Add an Export declaration to the Outputs section of the original template and use ImportValue in other templates.

20
Q

A developer is designing a serverless application that customers use to select seats for a concert venue. Customers send the ticket requests to an Amazon API Gateway API with an AWS Lambda function that acknowledges the order and generates an order ID. The application includes two additional Lambda functions: one for inventory management and one for payment processing. These two Lambda functions run in parallel and write the order to an Amazon Dynamo DB table.

The application must provide seats to customers according to the following requirements. If a seat is accidently sold more than once, the first order that the application received must get the seat. In these cases, the application must process the payment for only the first order. However, if the first order is rejected during payment processing, the second order must get the seat. In these cases, the application must process the payment for the second order.

Which solution will meet these requirements?

A. Send the order ID to an Amazon Simple Notification Service (Amazon SNS) FIFO topic that fans out to one Amazon Simple Queue Service (Amazon SQS) FIFO queue for inventory management and another SQS FIFO queue for payment processing.

B. Change the Lambda function that generates the order ID to initiate the Lambda function for inventory management. Then initiate the Lambda function for payment processing.

C. Send the order ID to an Amazon Simple Notification Service (Amazon SNS) topic. Subscribe the Lambda functions for inventory management and payment processing to the topic.

D. Deliver the order ID to an Amazon Simple Queue Service (Amazon SQS) queue. Configure the Lambda functions for inventory management and payment processing to poll the queue.

A

A. Send the order ID to an Amazon Simple Notification Service (Amazon SNS) FIFO topic that fans out to one Amazon Simple Queue Service (Amazon SQS) FIFO queue for inventory management and another SQS FIFO queue for payment processing.

21
Q

A company is migrating a legacy application to Amazon EC2 instances. The application uses a user
name and password that are stored in the source code to connect to a MySQL database. The company
will migrate the database to an Amazon RDS for MySQL DB instance. As part of the migration, the
company needs to implement a secure way to store and automatically rotate the database credentials.
Which solution will meet these requirements?
A) Store the database credentials in environment variables in an Amazon Machine Image (AMI). Rotate the
credentials by replacing the AMI.
B) Store the database credentials in AWS Systems Manager Parameter Store. Configure Parameter Store to
automatically rotate the credentials.
C) Store the database credentials in environment variables on the EC2 instances. Rotate the credentials by
relaunching the EC2 instances.
D) Store the database credentials in AWS Secrets Manager. Configure Secrets Manager to automatically
rotate the credentials.

A

D) Store the database credentials in AWS Secrets Manager. Configure Secrets Manager to automatically
rotate the credentials.

22
Q

A developer is creating a web application that must give users the ability to post comments and
receive feedback in near real time.
Which solutions will meet these requirements? (Select TWO.)
A) Create an AWS AppSync schema and corresponding APIs. Use an Amazon DynamoDB table as the data
store.
B) Create a WebSocket API in Amazon API Gateway. Use an AWS Lambda function as the backend. Use
an Amazon DynamoDB table as the data store.
C) Create an AWS Elastic Beanstalk application that is backed by an Amazon RDS database. Configure the
application to allow long-lived TCP/IP sockets.
D) Create a GraphQL endpoint in Amazon API Gateway. Use an Amazon DynamoDB table as the data
store.
E) Establish WebSocket connections to Amazon CloudFront. Use an AWS Lambda function as the
CloudFront distribution’s origin. Use an Amazon Aurora DB cluster as the data store.

A

A) Create an AWS AppSync schema and corresponding APIs. Use an Amazon DynamoDB table as the data
store.
B) Create a WebSocket API in Amazon API Gateway. Use an AWS Lambda function as the backend. Use
an Amazon DynamoDB table as the data store.

23
Q

3) A developer is adding sign-up and sign-in functionality to an application. The application must make an
API call to a custom analytics solution to log user sign-in events.
Which combination of actions should the developer perform to meet these requirements? (Select TWO.)
A) Use Amazon Cognito to provide the sign-up and sign-in functionality.
B) Use AWS Identity and Access Management (IAM) to provide the sign-up and sign-in functionality.
C) Configure an AWS Config rule to make the API call when a user is authenticated.
D) Invoke an Amazon API Gateway method to make the API call when a user is authenticated.
E) Invoke an AWS Lambda function to make the API call when a user is authenticated.

A

A) Use Amazon Cognito to provide the sign-up and sign-in functionality
E) Invoke an AWS Lambda function to make the API call when a user is authenticated.

24
Q

A company is using Amazon API Gateway for its REST APIs in an AWS account. A developer wants to
allow only IAM users from another AWS account to access the APIs.
Which combination of steps should the developer take to meet these requirements? (Select TWO.)
A) Create an IAM permission policy. Attach the policy to each IAM user. Set the method authorization type
for the APIs to AWS_IAM. Use Signature Version 4 to sign the API requests.
B) Create an Amazon Cognito user pool. Add each IAM user to the user pool. Set the method authorization
type for the APIs to COGNITO_USER_POOLS. Authenticate by using the IAM credentials in Amazon
Cognito. Add the ID token to the request headers.
C) Create an Amazon Cognito identity pool. Add each IAM user to the identity pool. Set the method
authorization type for the APIs to COGNITO_USER_POOLS. Authenticate by using the IAM credentials
in Amazon Cognito. Add the access token to the request headers.
D) Create a resource policy for the APIs to allow access for each IAM user only.
E) Create an Amazon Cognito authorizer for the APIs to allow access for each IAM user only. Set the
method authorization type for the APIs to COGNITO_USER_POOLS.

A

A) Create an IAM permission policy. Attach the policy to each IAM user. Set the method authorization type
for the APIs to AWS_IAM. Use Signature Version 4 to sign the API requests.
D) Create a resource policy for the APIs to allow access for each IAM user only.

25
Q

A developer is building a new application that transforms text files to .pdf files. A separate application
writes the text files to a source Amazon S3 bucket. The new application must read the files as they arrive
in Amazon S3 and must convert the files to .pdf files by using an AWS Lambda function. The developer
has written an IAM policy to allow access to Amazon S3 and Amazon CloudWatch Logs.
What should the developer do to ensure that the Lambda function has the correct permissions?
A) Create a Lambda execution role by using AWS Identity and Access Management (IAM). Attach the IAM
policy to the role. Assign the Lambda execution role to the Lambda function.
B) Create a Lambda execution user by using AWS Identity and Access Management (IAM). Attach the IAM
policy to the user. Assign the Lambda execution user to the Lambda function.
C) Create a Lambda execution role by using AWS Identity and Access Management (IAM). Attach the IAM
policy to the role. Store the IAM role as an environment variable in the Lambda function.
D) Create a Lambda execution user by using AWS Identity and Access Management (IAM). Attach the IAM
policy to the user. Store the IAM user credentials as environment variables in the Lambda function.

A

A) Create a Lambda execution role by using AWS Identity and Access Management (IAM). Attach the IAM
policy to the role. Assign the Lambda execution role to the Lambda function.

26
Q

A developer is working on an application that stores highly confidential data in a database. The
developer must use AWS Key Management Service (AWS KMS) with envelope encryption to protect the
data.
How should the developer configure the data encryption to meet these requirements?
A) Encrypt the data by using a KMS key. Store the encrypted data in the database.
B) Encrypt the data by using a generated data key. Store the encrypted data in the database.
C) Encrypt the data by using a generated data key. Store the encrypted data and the data key ID in the
database.
D) Encrypt the data by using a generated data key. Store the encrypted data and the encrypted data key in
the database

A

D) Encrypt the data by using a generated data key. Store the encrypted data and the encrypted data key in
the database.

27
Q

A developer is adding Amazon ElastiCache for Memcached to a company’s existing record storage
application. The developer has decided to use lazy loading based on an analysis of common record
handling patterns.
Which pseudocode example will correctly implement lazy loading?
A) record_value = db.query(“UPDATE Records SET Details = {1} WHERE ID == {0}”,
record_key, record_value)
cache.set (record_key, record_value)
B) record_value = cache.get(record_key)
if (record_value == NULL)
record_value = db.query(“SELECT Details FROM Records WHERE ID == {0}”,
record_key)
cache.set (record_key, record_value)
C) record_value = cache.get (record_key)
db.query(“UPDATE Records SET Details = {1} WHERE ID == {0}”, record_key,
record_value)
D) record_value = db.query(“SELECT Details FROM Records WHERE ID == {0}”,
record_key)
if (record_value != NULL)
cache.set (record_key, record_value)

A

B) record_value = cache.get(record_key)
if (record_value == NULL)
record_value = db.query(“SELECT Details FROM Records WHERE ID == {0}”,
record_key)
cache.set (record_key, record_value)

28
Q

A developer is building a web application that uses Amazon API Gateway. The developer wants to
maintain different environments for development (dev) and production (prod) workloads. The API will be
backed by an AWS Lambda function with two aliases: one for dev and one for prod.
How can the developer maintain these environments with the LEAST amount of configuration?
A) Create a REST API for each environment. Integrate the APIs with the corresponding dev and prod aliases
of the Lambda function. Deploy the APIs to their respective stages. Access the APIs by using the stage
URLs.
B) Create one REST API. Integrate the API with the Lambda function by using a stage variable in place of
an alias. Deploy the API to two different stages: dev and prod. Create a stage variable in each stage with
different aliases as the values. Access the API by using the different stage URLs.
C) Create one REST API. Integrate the API with the dev alias of the Lambda function. Deploy the API to the
dev environment. Configure a canary release deployment for the prod environment where the canary will
integrate with the Lambda prod alias.
D) Create one REST API. Integrate the API with the prod alias of the Lambda function. Deploy the API to the
prod environment. Configure a canary release deployment for the dev environment where the canary will
integrate with the Lambda dev alias

A

B) Create one REST API. Integrate the API with the Lambda function by using a stage variable in place of
an alias. Deploy the API to two different stages: dev and prod. Create a stage variable in each stage with
different aliases as the values. Access the API by using the different stage URLs.

29
Q

A developer wants to track the performance of an application that runs on a fleet of Amazon EC2
instances. The developer wants to view and track statistics, such as the average request latency and the
maximum request latency, across the fleet. The developer wants to receive immediate notification if the
average response time exceeds a threshold.
Which solution will meet these requirements?
A) Configure a cron job on each EC2 instance to measure the response time and update a log file stored in
an Amazon S3 bucket every minute. Use an Amazon S3 event notification to invoke an AWS Lambda
function that reads the log file and writes new entries to an Amazon OpenSearch Service cluster.
Visualize the results in OpenSearch Dashboards. Configure OpenSearch Service to send an alert to an
Amazon Simple Notification Service (Amazon SNS) topic when the response time exceeds the threshold.
B) Configure the application to write the response times to the system log. Install and configure the Amazon
Inspector agent on the EC2 instances to continually read the logs and send the response times to
Amazon EventBridge (Amazon CloudWatch Events). View the metrics graphs in the EventBridge
(CloudWatch Events) console. Configure an EventBridge (CloudWatch Events) custom rule to send an
Amazon Simple Notification Service (Amazon SNS) notification when the average of the response time
metric exceeds the threshold.
C) Configure the application to write the response times to a log file. Install and configure the Amazon
CloudWatch agent on the EC2 instances to stream the application log to CloudWatch Logs. Create a
metric filter of the response time from the log. View the metrics graphs in the CloudWatch console. Create
a CloudWatch alarm to send an Amazon Simple Notification Service (Amazon SNS) notification when the
average of the response time metric exceeds the threshold.
D) Install and configure AWS Systems Manager Agent (SSM Agent) on the EC2 instances to monitor the
response time and send the response time to Amazon CloudWatch as a custom metric. View the metrics
graphs in Amazon QuickSight. Create a CloudWatch alarm to send an Amazon Simple Notification
Service (Amazon SNS) notification when the average of the response time metric exceeds the threshold.

A

C) Configure the application to write the response times to a log file. Install and configure the Amazon
CloudWatch agent on the EC2 instances to stream the application log to CloudWatch Logs. Create a
metric filter of the response time from the log. View the metrics graphs in the CloudWatch console. Create
a CloudWatch alarm to send an Amazon Simple Notification Service (Amazon SNS) notification when the
average of the response time metric exceeds the threshold.

30
Q

A developer is testing an application locally and has deployed the application to an AWS Lambda
function. To avoid exceeding the deployment package size quota, the developer did not include the
dependencies in the deployment file. When the developer tests the application remotely, the Lambda
function does not run because of missing dependencies.
Which solution will resolve this issue?
A) Use the Lambda console editor to update the code and include the missing dependencies.
B) Create an additional .zip file that contains the missing dependencies. Include the .zip file in the original
Lambda deployment package.
C) Add references to the missing dependencies in the Lambda function’s environment variables.
D) Create a layer that contains the missing dependencies. Attach the layer to the Lambda function.

A

D) Create a layer that contains the missing dependencies. Attach the layer to the Lambda function.