201-220 Flashcards

1
Q

201

A developer is deploying an application on Amazon EC2 instances that run in Account A. The application needs to read data from an existing Amazon Kinesis data stream in Account B. Which actions should the developer take to provide the application with access to the stream? (Choose two.)

A. Update the instance profile role in Account A with stream read permissions.

B. Create an IAM role with stream read permissions in Account B.

C. Add a trust policy to the instance profile role and IAM role in Account B to allow the instance profile role to assume the IAM role.

D. Add a trust policy to the instance profile role and IAM role in Account B to allow reads from the stream.

E. Add a resource-based policy in Account B to allow read access from the instance profile role.

A

B. Create an IAM role with stream read permissions in Account B.

C. Add a trust policy to the instance profile role and IAM role in Account B to allow the instance profile role to assume the IAM role.

https://docs.aws.amazon.com/kinesisanalytics/latest/java/examples-cross.html

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

202

A developer is working on an AWS Lambda function that accesses Amazon DynamoDB. The Lambda function must retrieve an item and update some of its attributes, or create the item if it does not exist. The Lambda function has access to the primary key. Which IAM permissions should the developer request for the Lambda function to achieve this functionality?

A.

dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem

B.

dynamodb:UpdateItem
dynamodb:GetItem
dynamodb:DescribeTable

C.

dynamodb:GetRecords
dynamodb:PutItem
dynamodb:UpdateTable

D.

dynamodb:UpdateItem
dynamodb:GetItem
dynamodb:PutItem
A

D.

dynamodb:UpdateItem
dynamodb:GetItem
dynamodb:PutItem
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

203

A company is using AWS CloudFormation templates to deploy AWS resources. The company needs to update one of its AWS CloudFormation stacks. What can the company do to find out how the changes will impact the resources that are running?

A. Investigate the change sets.

B. Investigate the stack policies.

C. Investigate the Metadata section.

D. Investigate the Resources section.

A

A. Investigate the change sets.

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

204

A developer is building an application integrating an Amazon API Gateway with an AWS Lambda function. When calling the API. the developer receives the following error:
~~~
Wed Nov 08 01:13:00 UTC 2017 : Method completed with status: 502
~~~

What should the developer do to resolve the error?

A. Change the HTTP endpoint of the API to an HTTPS endpoint.

B. Change the format of the payload sent to the API Gateway.

C. Change the format of the Lambda function response to the API call.

D. Change the authorization header in the API call to access the Lambda function.

A

C. Change the format of the Lambda function response to the API call.

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

205

A company’s social media application stores image files in an Amazon S3 bucket. All the images are stored in S3 Standard storage. Users access images frequently during the first week after images are uploaded. Users rarely access images that were uploaded more than 1 week ago. The company needs a solution to reduce the application’s storage cost. Users must be able to access all images in the same amount of time, regardless of when the images were uploaded. Which solution will meet these requirements with the LEAST amount of effort?

A. Modify the application to use S3 Intelligent-Tiering for all the images.

B. Modify the application to use S3 One Zone-Infrequent Access (S3 One Zone-IA) for all the images.

C. Use an S3 Lifecycle policy to move images that were uploaded more than 1 week ago to S3 Glacier Deep Archive.

D. Use an S3 Lifecycle policy to move images that were uploaded more than 1 week ago to S3 Glacier Flexible Retrieval.

A

A. Modify the application to use S3 Intelligent-Tiering for all the images.

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

206

A development team is designing a mobile app that requires multi-factor authentication. Which steps should be taken to achieve this? (Choose two.)

A. Use Amazon Cognito to create a user pool and create users in the user pool.

B. Send multi-factor authentication text codes to users with the Amazon SNS Publish API call in the app code.

C. Enable multi-factor authentication for the Amazon Cognito user pool.

D. Use AWS IAM to create IAM users.

E. Enable multi-factor authentication for the users created in AWS IAM.

A

A. Use Amazon Cognito to create a user pool and create users in the user pool.

C. Enable multi-factor authentication for the Amazon Cognito user pool.

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

207

A company is using AWS CodePipeline pipelines to deploy development Amazon EC2 instances for multiple teams. All the pipelines are using the same AWS CloudFormation template to deploy the EC2 instances and create dedicated CloudFormation stacks for each team. Each pipeline passes a parameter that is named TeamName to the CloudFormation stack to tag resources with the appropriate team’s name. The company discovers that each team’s usage of EC2 instances is not consistent with the type of EC2 instances that the teams are deploying. The company needs to allow the teams to deploy different types of EC2 instances. Which solution will meet this requirement with the LEAST change to the pipelines?

A. For each team, use a dedicated CloudFormation template that includes different types of EC2 instances. Update CodePipeline to use the dedicated template for each team.

B. For each team, use a dedicated CloudFormation template that includes an InstanceType parameter and a value that is specific to the team’s requirement. Update CodePipeline to use the dedicated template for each team

C. Update the CloudFormation template by creating an InstanceType parameter. Update CodePipeline to pass the InstanceType parameter value that is specific to the team’s requirement.

D. Update the CloudFormation template by adding a map for the instance types to the Mappings section. Create a list of all the teams. Configure the required instance type for each team in the map.

A

D. Update the CloudFormation template by adding a map for the instance types to the Mappings section. Create a list of all the teams. Configure the required instance type for each team in the map.

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

A developer is creating an application for a company. The application needs to read the file doc txt that is placed in the root folder of an Amazon S3 bucket that is named DOC-EXAMPLE-BUCKET. The company’s security team requires the principle of least privilege to be applied to the application’s IAM policy.

Which IAM policy statement will meet these security requirements?

A.

{"Action": ["s3:Getobject"],
"Effect": "Allow"
"Resource":"arn:aws:s3:::DOC-EXAMPLE-BUCKET/doc.txt" }

B.

{"Action": ["s3:*"],
"Effect": "Allow"
"Resource":"*"}

C.

{"Action": ["s3:Getobject"],
"Effect": "Allow"
"Resource":"arn:aws:s3:::DOC-EXAMPLE-BUCKET/*"}

D.

{"Action": ["s3:*"],
"Effect": "Allow"
"Resource":"arn:aws:s3:::DOC-EXAMPLE-BUCKET/doc.txt" }
A

A.

{"Action": ["s3:Getobject"],
"Effect": "Allow"
"Resource":"arn:aws:s3:::DOC-EXAMPLE-BUCKET/doc.txt" }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

209

A company has migrated an application to Amazon EC2 instances. Automatic scaling is working well for the application user interface. However, the process to deliver shipping requests to the company’s warehouse staff is encountering issues. Duplicate shipping requests are arriving, and some requests are lost or arrive out of order.

The company must avoid duplicate shipping requests and must process the requests in the order that the requests arrive. Requests are never more than 250 KB in size and take 5-10 minutes to process. A developer needs to rearchitect the application to improve the reliability of the delivery and processing of the requests. What should the developer do to meet these requirements?

A. Create an Amazon Kinesis Data Firehose delivery stream to process the requests. Create an Amazon Kinesis data stream. Modify the application to write the requests to the Kinesis data stream.

B. Create an AWS Lambda function to process the requests. Create an Amazon Simple Notification Service (Amazon SNS) topic. Subscribe the Lambda function to the SNS topic. Modify the application to write the requests to the SNS topic.

C. Create an AWS Lambda function to process the requests. Create an Amazon Simple Queue Service (Amazon SQS) standard queue. Set the SQS queue as an event source for the Lambda function. Modify the application to write the requests to the SQS queue.

D. Create an AWS Lambda function to process the requests. Create an Amazon Simple Queue Service (Amazon SQS) FIFO queue. Set the SQS queue as an event source for the Lambda function. Modify the application to write the requests to the SQS queue.

A

D. Create an AWS Lambda function to process the requests. Create an Amazon Simple Queue Service (Amazon SQS) FIFO queue. Set the SQS queue as an event source for the Lambda function. Modify the application to write the requests to the SQS queue.

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

210

A team of developers must migrate an application running inside an AWS Elastic Beanstalk environment from a Classic Load Balancer to an Application Load Balancer. Which steps should be taken to accomplish the task using the AWS Management Console?

A.
1. Update the application code in the existing deployment.
2. Select a new load balancer type before running the deployment
3. Deploy the new version of the application code to the environment

B.
1. Create a new environment with the same configurations except for the load balancer type.
2. Deploy the same application version as used in the original environment.
3. Run the swap-environment-cnames action

C.
1. Clone the existing environment, changing the associated load balancer type.
2. Deploy the same application version as used in the original environment.
3. Run the swap-environment-cnames action

D.
1. Edit the environment definitions in the existing deployment.
2. Change the associated load balancer type according to the requirements.
3. Rebuild the environment with the new load balancer type.

A

B.
1. Create a new environment with the same configurations except for the load balancer type.
2. Deploy the same application version as used in the original environment.
3. Run the swap-environment-cnames action

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

211

What does an Amazon SQS delay queue accomplish?

A. Messages are hidden for a configurable amount of time when they are first added to the queue.

B. Messages are hidden for a configurable amount of time after they are consumed from the queue.

C. The consumer can poll the queue for a configurable amount of time before retrieving a message.

D. Messages cannot be deleted for a configurable amount of time after they are consumed from the queue.

A

A. Messages are hidden for a configurable amount of time when they are first added to the queue.

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

212

A company stores the photographs in an Amazon S3 bucket. The company wants to resize the photographs automatically after writing the photographs to the S3 bucket. The company creates an AWS Lambda function to resize the photographs. Which solution will meet these requirements?

A. Configure S3 Event Notifications to invoke the Lambda function

B. Configure an S3 Lifecycle rule to invoke the Lambda function.

C. Configure S3 Select on a schedule to invoke the Lambda function.

D. Configure S3 Storage Lens to invoke the Lambda function.

A

A. Configure S3 Event Notifications to invoke the Lambda function

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

213

A developer is automating a new application deployment with AWS Serverless Application Model (AWS SAM). The new application has one AWS Lambda function and one Amazon S3 bucket. The Lambda function must access the S3 bucket to only read objects. How should the developer configure AWS SAM to grant the necessary read privilege to the S3 bucket?

A. Reference a second Lambda authorizer function.

B. Add a custom S3 bucket policy to the Lambda function.

C. Create an Amazon Simple Queue Service (SQS) topic for only S3 object reads Reference the topic in the template.

D. Add the S3ReadPolicy template to the Lambda function’s execution role.

A

D. Add the S3ReadPolicy template to the Lambda function’s execution role.

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

214

A company hosts a web application that writes to an Amazon DynamoDB table. Application users frequently observe and report errors. The development team examines Amazon CloudWatch logs and frequently sees the following error:

400 Bad Request ProvisionedThroughputExceededException

What is the cause of this error?

A. The application does not have the required permissions for the DynamoDB table.

B. The item that the application is placing on the table exceeds the item size limit.

C. The development team has not allocated enough space for the table and its indexes.

D. The development team has not allocated enough write capacity units (WCU) for the table and Its indexes.

A

D. The development team has not allocated enough write capacity units (WCU) for the table and Its indexes.

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

215

A company’s developer is building a static website to be deployed in Amazon S3 for a production environment. The website integrates with an Amazon Aurora PostgreSQL database by using an AWS Lambda function. The website that is deployed to production will use a Lambda alias that points to a specific version of the Lambda function. The company must rotate the database credentials every 2 weeks. Lambda functions that the company deployed previously must be able to use the most recent credentials.

Which solution will meet these requirements?

A. Store the database credentials in AWS Secrets Manager. Turn on rotation. Write code in the Lambda function to retrieve the credentials from Secrets Manager.

B. Include the database credentials as part of the Lambda function code. Update the credentials periodically and deploy the new Lambda function.

C. Use Lambda environment variables. Update the environment variables when new credentials are available.

D. Store the database credentials in AWS Systems Manager Parameter Store Turn on rotation. Write code in the Lambda function to retrieve the credentials from Systems Manager Parameter Store.

A

A. Store the database credentials in AWS Secrets Manager. Turn on rotation. Write code in the Lambda function to retrieve the credentials from Secrets Manager.

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

216

An application reads data from an Amazon DynamoDB table. Several times a day, for a period of 15 seconds, me application receives multiple ProvisionedThroughputExceeded errors. How should this exception be handled?

A. Create a new global secondary index for the table to help with the additional requests.

B. Retry the failed read requests with exponential backoff.

C. Immediately retry the failed read requests.

D. Use the DynamoDB “UpdateItem” API to increase the provisioned throughput capacity of the table.

A

B. Retry the failed read requests with exponential backoff.

17
Q

217

A company wants to migrate its web application to AWS and leverage auto scaling to handle peak workloads. The solutions architect determined that the best metric for an auto scaling event is the number of concurrent users. Based on this information, what should the developer use to auto scale based on concurrent users?

A. An Amazon SNS topic to be invoked when a concurrent user threshold is met.

B. An Amazon Cloudwatch NetworkIn metric

C. Amazon CloudFront to leverage AWS edge locations

D. A custom Amazon CloudWatch metric for concurrent users

A

D. A custom Amazon CloudWatch metric for concurrent users

18
Q

218

A company is managing a NoSQL database on-premises to host a critical component of an application, which is starting to have scaling issues. The company wants to migrate the application to Amazon DynamoDB with the following considerations:

  • Optimize frequent queries
  • Reduce read latencies
  • Plan for frequent queries on certain key attributes of the table

Which solution would help achieve these objectives?

A. Create global secondary indexes on keys that are frequently queried. Add the necessary attributes into the indexes.

B. Create local secondary indexes on keys that are frequently queried. DynamoDB will fetch needed attributes from the table.

C. Create DynamoDB global tables to speed up query responses. Use a scan to fetch data from the table

D. Create an AWS Auto Scaling policy for the DynamoDB table.

A

A. Create global secondary indexes on keys that are frequently queried. Add the necessary attributes into the indexes.

19
Q

219

A developer is storing sensitive data generated by an application in Amazon S3. The developer wants to encrypt the data at rest A company policy requires an audit trail of when the AWS Key Management Service (AWS KMS) key was used and by whom.

Which encryption option will meet these requirements?

A. Server-side encryption with Amazon S3 managed keys (SSE-S3)

B. Server-side encryption with AWS KMS managed keys (SSE-KMS)

C. Server-side encryption with customer-provided keys (SSE-C)

D. Server-side encryption with self-managed keys

A

B. Server-side encryption with AWS KMS managed keys (SSE-KMS)

20
Q

220

An AWS Lambda function that Is running in a test environment is not working property. However, there is no error associated with the Lambda function in the Amazon CloudWatch logs for the account. The Lambda function’s permissions do not include a resource-based policy. The Lambda function’s execution role has properly configured trust relationships and has no permissions policies attached. Which action should a developer take to allow logs for the Lambda function to appear in CloudWatch?

A. Attach the AWSLambdaBasicExecutionRole managed policy to the Lambda function’s execution role.

B. Set the AWSLambdaBasicExecutionRole managed policy as the Lambda function’s resource-based policy.

C. Attach the CloudWatchLambdaInsightsExecutionRolePolicy managed policy to the Lambda function’s execution role.

D. Set the CloudWatchLambdaInsightsExecutionRolePolicy managed policy as the Lambda function’s resource-based policy.

A

A. Attach the AWSLambdaBasicExecutionRole managed policy to the Lambda function’s execution role.