111. A developer works for a company that only has a single pre-production AWS account with an AWS CloudFormation AWS Serverless Application Model (AWS SAM) stack. The developer made changes to an existing AWS Lambda function specified in the AWS SAM template and additional Amazon Simple Notification service (Amazon SNS) topics.
The developer wants to do a one-time deploy of the changes to test if the changes are working. The developer does not want to impact the existing pre-production application that is currently being used by other team members as part of the release pipeline.
Which solution will meet these requirements?
A. Use the AWS SAM CLI to package and deploy the SAM application to the pre-production AWS account. Specify the debug parameter.
B. Use the AWS SAM CLI to package and create a change set against the pre-production AWS account. Execute the change set in a new AWS account designated for a development environment.
C. Use the AWS SAM CLI to package and deploy the SAM application to a new AWS account designated for a development environment.
D. Update the CloudFormation stack in the pre-production account. Add a separate stage that points to a new AWS account designated for a development environment.
Answer
C
112. A company built an online event platform. For each event, the company organizes quizzes and generates leaderboards that are based on the quiz scores. The company stores the leaderboard data in Amazon DynamoDB and retains the data for 30 days after an event is complete. The company then uses a scheduled job to delete the old leaderboard data.
The DynamoDB table is configured with a fixed write capacity. During the months when many events occur, the DynamoDB write API requests are throttled when the scheduled delete job runs.
A developer must create a long-term solution that deletes the old leaderboard data and optimizes write throughput.
Which solution meets these requirements?
A. Configure a TTL attribute for the leaderboard data.
B. Use DynamoDB Streams to schedule and delete the leaderboard data.
C. Use AWS Step Functions to schedule and delete the leaderboard data.
D. Set a higher write capacity when the scheduled delete job runs.
Answer
A
113. A company uses an AWS Lambda function that reads messages from an Amazon Simple Queue Service (Amazon SQS) standard queue. The Lambda function makes an HTTP call to a third-party API for each message. The company wants to ensure that the Lambda function does not overwhelm the third-party API with more than two concurrent requests.
Which solution will meet these requirements?
A. Configure a provisioned concurrency of two on the Lambda function.
B. Configure a batch size of two on the Amazon SQS event source mapping for the Lambda function.
C. Configure Lambda event filtering to process two messages from Amazon SQS at every invocations.
D. Configure a maximum concurrency of two on the Amazon SQS event source mapping for the Lambda function.
Answer
D
114. A company is using Amazon API Gateway to develop an API for its application on AWS. A developer needs to test and generate API responses. Other teams are required to test the API immediately.
What should the developer do to meet these requirements?
A. Set up a mock integration request in API Gateway. Configure the method’s integration request and integration response to associate a response with a given status code.
B. Set up the request validators in the API’s OpenAPI definition file. Import the OpenAPI definitions into API Gateway to test the API.
C. Set up a gateway response for the API in API Gateway. Configure response headers with hardcoded HTTP status codes and responses.
D. Set up a request parameter-based Lambda authorizer to control access to the API. Configure the Lambda function with the necessary mapping template.
Answer
A
115. A company is releasing a new feature. Users can request early access to the new feature by using an application form. The company expects a surge of requests when the application form becomes available. Each request will be stored as an item in an Amazon DynamoDB table.
Each item will contain the user’s username, the submission date, and a validation status of UNVALIDATED. VALID, or NOT VALID. Each item also will contain the user’s rating of the process on a scale of 1 to 5.
Each user can submit one request. For the DynamoDB table, the developer must choose a partition key that will give the workload well-distributed records across partitions.
Which DynamoDB attribute will meet these requirements?
A. Username
B. Submission date
C. Validation status
D. Rating of the process on a scale of 1 to 5
Answer
A
116. A developer is creating a publicly accessible enterprise website consisting of only static assets. The developer is hosting the website in Amazon S3 and serving the website to users through an Amazon CloudFront distribution. The users of this application must not be able to access the application content directly from an S3 bucket. All content must be served through the Amazon CloudFront distribution.
Which solution will meet these requirements?
A. Create a new origin access control (OAC) in CloudFront. Configure the CloudFront distribution’s origin to use the new OAC. Update the S3 bucket policy to allow CloudFront OAC with read and write access to access Amazon S3 as the origin.
B. Update the S3 bucket settings. Enable the block all public access setting in Amazon S3. Configure the CloudFront distribution’s with Amazon S3 as the origin. Update the S3 bucket policy to allow CloudFront write access.
C. Update the S3 bucket’s static website settings. Enable static website hosting and specifying index and error documents. Update the CloudFront origin to use the S3 bucket’s website endpoint.
D. Update the CloudFront distribution’s origin to send a custom header. Update the S3 bucket policy with a condition by using the aws:RequestTag/tag-key key. Configure the tag-key as the custom header name, and the value being matched is the header’s value.
Answer
A
117. A developer built an application that calls an external API to obtain data, processes the data, and saves the result to Amazon S3. The developer built a container image with all of the necessary dependencies to run the application as a container.
The application runs locally and requires minimal CPU and RAM resources. The developer has created an Amazon ECS cluster. The developer needs to run the application hourly in Amazon Elastic Container Service (Amazon ECS).
Which solution will meet these requirements with the LEAST amount of infrastructure management overhead?
A. Add a capacity provider to manage instances.
B. Add an Amazon EC2 instance that runs the application.
C. Define a task definition with an AWS Fargate launch type.
D. Create an Amazon ECS cluster and add the managed node groups feature to run the application.
Answer
C
118. A company runs its website on AWS. The company posts daily polls on its website and publishes the poll results next day. The website stores user responses in an Amazon DynamoDB table. After the poll results are published, the company does not need to keep the user responses.
A developer needs to implement a solution that will automatically remove old user responses from the DynamoDB table. The developer adds a new expiration_date attribute to the DynamoDB table. The developer plans to use the expiration_date attribute for the automation.
Which solution will meet these requirements with the LEAST development effort?
A. Create an AWS Lambda function to delete old user responses based on the expiration_date attribute. Create an Amazon EventBridge schedule to run the Lambda function daily.
B. Create an AWS Fargate task in Amazon Elastic Container Service (Amazon ECS) to delete old user responses based on the expiration_date attribute. Create an Amazon EventBridge schedule to run the Fargate task daily.
C. Create an AWS Glue job to delete old user responses based on the expiration_date attribute. Create an AWS Glue trigger schedule to run the job daily.
D. Enable TTL on the DynamoDB table and specify the expiration_date attribute. Expire old user responses by using DynamoDB TTL.
Answer
D
119. A developer is creating a simple proof-of-concept demo by using AWS CloudFormation and AWS Lambda functions. The demo will use a CloudFormation template to deploy an existing Lambda function. The Lambda function uses deployment packages and dependencies stored in Amazon S3. The developer defined an AWS::Lambda::Function resource in a CloudFormation template. The developer needs to add the S3 bucket to the CloudFormation template.
What should the developer do to meet these requirements with the LEAST development effort?
A. Add the function code in the CloudFormation template inline as the code property.
B. Add the function code in the CloudFormation template as the ZipFile property.
C. Find the S3 key for the Lambda function. Add the S3 key as the ZipFile property in the CloudFormation template.
D. Add the relevant key and bucket to the S3Bucket and S3Key properties in the CloudFormation template.
Answer
D
120. A developer is building a microservices-based application by using Python on AWS and several AWS services. The developer must use AWS X-Ray. The developer views the service map by using the console to view the service dependencies. During testing, the developer notices that some services are missing from the service map.
What can the developer do to ensure that all services appear in the X-Ray service map?
A. Modify the X-Ray Python agent configuration in each service to increase the sampling rate.
B. Instrument the application by using the X-Ray SDK for Python. Install the X-Ray SDK for all the services that the application uses.
C. Enable X-Ray data aggregation in Amazon CloudWatch Logs for all the services that the application uses.
D. Increase the X-Ray service map timeout value in the X-Ray console.
Answer
B