Domain: Development with AWS Services

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

A transport company uses a mobile GPS application to track the location of each of their 60 vehicles. The application records each vehicle's location to a DynamoDB table every 6 seconds. Each transmission is just under 1KB and throughput is spread evenly within that minute. How many units of write capacity should you specify for this table?

10 Writing to the database every six seconds, there are 10 writes/minute/vehicle. There are sixty vehicles in the fleet, so there are 600 writes/minute overall. 600/60 seconds = 10 writes/second.

An application uses DynamoDB table as its backend data store. Each item has size of 10KB. The application needs to perform 100 eventually consistent read operations per second, and 50 write operations per second. What is the provisioned RCU value required to meet these requirements?

150 EXPLANATION 1 RCU is equivalent to two eventually consistent reads per second of an item up to 4KB in size. Thus, to calculate the required RCU in this scenario we need to: 1) Round up the item size to the nearest 4KB (12KB). 2) Divide by 4KB to calculate number of read units (12/4 = 3). 3) Divide by 2 to calculate the number of eventually consistent read units per item (3/2 = 1.5). 4) Multiple by operations per second to get the total RCU required (1.5*100 = 150 RCU).

A DynamoDB table is configured in provisioned throughput mode with 500 RCU and 100 WCU. How much data can be read and written to the table each second?

2000 KB for strongly consistent read operations, 4000 KB for eventually consistent read operations, 100 KB for write operations. EXPLANATION One read capacity unit is equivalent to one strongly consistent read per second, or two eventually consistent reads per second, for an item up to 4 KB in size. One write capacity unit is equivalent to one write per second for an item up to 1 KB in size. Therefore, 500 RCU is equivalent to: 1) 500 RCU * 4KB = 2000 KB per second for strongly consistent read operations; 2) 500 RCU * 4KB = 2000 KB per second * 2 = 4000 KB per second for eventually consistent read operations; 3) 100 WCU * 1KB = 100 KB per second for write operations.

An application uses DynamoDB table as its backend data store. Each item has size of 10KB. The application needs to perform 100 strongly consistent read operations per second, and 50 write operations per second. What is the provisioned RCU value required to meet these requirements?

300 EXPLANATION 1 RCU is equivalent to one strongly consistent read per second of an item up to 4KB in size. Thus, to calculate the required RCU in this scenario we need to: 1) Round up the item size to the nearest 4KB (12KB). 2) Divide by 4KB to calculate number of strongly consistent read units (12/4 = 3). 3) Multiple by operations per second to get the total RCU required (3*100 = 300 RCU).

What is the maximum size of an item in a DynamoDB table?

400KB

What is NOT the best practice when deploying production applications using Elastic Beanstalk?

Amazon RDS databases should be included in the Elastic Beanstalk environment as that maintains the same life cycle for all components of the environment. EXPLANATION It is a good practice to decouple an Amazon RDS instance from an Elastic Beanstalk environment, especially in production environment. Launching an RDS database as part of an Elastic Beanstalk environment may be suitable for development or PoC environments. However, in general, it isn't ideal as this means that termination of the Elastic Beanstalk environment will result in termination of the database as well. To protect important data from potential data loss, Amazon RDS database should be launched outside of the Elastic Beanstalk environment.

A developer is working on a new application which will use DynamoDB. One of the DynamoDB tables that the developer must create requires an index sort key. When creating this DynamoDB table, the developer must select an Attribute Type for the sort key. Which of the following DynamoDB data types can the developer select to use for their index sort key?

Binary String Number EXPLANATION Both partition and sort keys attributes must be defined as type string, number, or binary.

You are planning to deploy a new version of your application using CodeDeploy. You only have a window of 2 hours to complete the deployment and test it. Your team leader is concerned about the time it could take to roll back the upgrade if it should fail. Which deployment approach would you recommend?

Blue / Green EXPLANATION Blue / Green is the one to use as this allows you to roll back with minimal disruption. An In-Place upgrade is very disruptive to roll back as it will involve re-deploying the original version of the code and during this time your application will be unavailable.

You are developing a scalable application which will run in Docker on ECS. You would like to be able to run multiple tasks on the same ECS service. How should you approach this?

Dynamic Port Mapping EXPLANATION Port mappings allow containers to access ports on the host container instance to send or receive traffic. Port mappings are specified as part of the container definition. Dynamic port mapping with an Application Load Balancer makes it easier to run multiple tasks on the same Amazon ECS service on an Amazon ECS cluster.

An organization wishes to use CodeDeploy to automate its application deployments. The organization has asked a developer to advise on which of their services can integrate with CodeDeploy. Which of the following services can the developer advise are compatible with CodeDeploy managed deployments?

Fargate EC2 On-premises servers Lambda

You have created a DynamoDB table for your application with one partition key and no local secondary index. The table will include the following attributes: AccountID (partition key) AccountName ReportingPeriod TotalRevenue You have an application running on EC2 that displays revenue data as a dashboard for your sales organization. The dashboard requires a view of total revenue over multiple reporting periods by customer name as a readable format. What secondary index will you need to add to your table?

Global secondary index with a partition key of CustomerName and sort key of ReportingPeriod; project the TotalRevenue attribute EXPLANATION The requirement is for a particular CustomerName as it would be difficult for a reader to identity customers by their ID. We need a Global Secondary Index for a different partition key because a local secondary index must be created at the time you create a table.

Which of the following Elastic Beanstalk deployment approaches allow you to maintain full capacity while performing an update?

Immutable Rolling With Additional Batch EXPLANATION Rolling with Additional Batch and Immutable both involve provisioning new servers to ensure capacity is not reduced. All At Once means the application will be offline for the duration of the update. Performing a Rolling Update without an additional batch of servers means a reduction in capacity.

An organization wishes to use AWS SQS as a job queue. There is no requirement that jobs have to be processed in the order in which they are added to the queue; however, duplicate jobs must not appear in the queue.

Implement a FIFO SQS queue. EXPLANATION SQS FIFO queues, while guaranteeing message delivery order, also support a Message Deduplication ID. This can be used to detect and ignore duplicate messages within a 5-minute deduplication interval. Standard SQS queues do not have this feature.

You are planning to use CodeDeploy to deploy an application for the first time to a brand new fleet of EC2 instances. Which deployment approach would you recommend?

In-Place EXPLANATION In-Place is the one to use as you are installing to a new fleet of instances, therefore Blue/Green is not possible. Canary and Rolling updates are not an option for CodeDeploy

Which of the following platforms are supported in ElasticBeanstalk

Java with Tomcat Node.js Single Container Docker

You have a simple, stateless Python application which processes the contents of an S3 bucket once an hour and takes about 6 minutes to complete once started. Which AWS service should you run this application on in order to provide the most reliable and cost effective solution?

Make the application a Lambda function and create a Scheduled Event Trigger set to 1 hour

Which of the following approaches can improve the performance of your Lambda function?

Only include the libraries you need to minimize the size of your deployment package Establish your database connections from within the Lambda execution environment to enable connection reuse EXPLANATION Establishing connections within the execution environment allows them to be reused next time the function is invoked which saves time. Only including the libraries you need will minimise the time taken for Lambda to unpack the deployment package.

You are importing an existing API to API Gateway. Which format is supported for API definition files?

OpenAPI v2.0 Swagger OpenAPI v3.0

An application successfully updates an existing object in S3. When checking the file contents, the developer does not see the updated file contents. What is the cause of this issue?

Overwrite PUTS in S3 have eventual consistency. EXPLANATION Amazon S3 offers eventual consistency for overwrite PUTS and DELETES in all Regions. Amazon S3 provides high availability and high durability by replicating bucket objects across multiple availability zones and servers. This means that any updates to objects must replicate across all servers storing the data. This can take some time. Therefore, any updates to existing objects (using POST or DELETE), will take some time to be propagated across all of S3, and hence are eventually consistent.

You are working on a Serverless application written in Python and running in Lambda. You have uploaded multiple versions of your code to Lambda, but would like to make sure your test environment always utilizes the latest version. How can you configure this?

Reference the function using a qualified ARN and the $LATEST suffix Reference the function using an unqualified ARN

A developer is working on a new green field project within an organization. The developer has been asked to recommend what technology could be used if the project is to be deployed with Elastic Beanstalk. Which of the following platforms could the developer recommend for the project to meet its requirements?

Ruby Docker GO (Doesn't support Perl or Swift)

A Developer is implementing an application that must allow users to subscribe to e-mail notifications. Which AWS service is the best option for implementing this functionality?

SNS EXPLANATION Amazon Simple Notification Service (Amazon SNS) is a web service that coordinates and manages the delivery or sending of messages to subscribing endpoints or clients. In Amazon SNS, there are two types of clients: publishers and subscribers, which are also referred to as producers and consumers. Publishers communicate asynchronously with subscribers by producing and sending a message to a topic, which is a logical access point and communication channel. Subscribers (that is, web servers, email addresses, Amazon SQS queues, AWS Lambda functions) consume or receive the message or notification over one of the supported protocols (that is, Amazon SQS, HTTP/S, email, SMS, Lambda) when they are subscribed to the topic.

How does API Gateway handle SOAP?

SOAP is handled as web service pass-through

You are developing an application using multiple AWS services. You need to find a solution to decouple the application components, so that they can fail independently of one another. Which of the following AWS services will enable this?

SQS

A developer has a requirement to trigger a Lambda function once every 24 hours. What is the best way of achieving this requirement?

Schedule a trigger in CloudWatch Events EXPLANATION CloudWatch Events allows targets to be triggered using a Schedule Expression. A Schedule Expression can define a rate; for example, every 24 hours. Or can accept a standard cron job expression. CloudWatch Events supports many targets, including Lambda.

You need to announce emergency downtime for a production AWS web application. This downtime notification requires different sets of instructions for different devices. All of the application users signed up to receive SNS notifications from the downtime topic when they began using the application and they are currently subscribed to this topic. What are appropriate ways for you to provide timely, device-specific instructions to end users when announcing this downtime?

Send a single message, but customize the text in the SNS message field so that each device gets only the information that is appropriate for them.

A three-tier web application is deployed using CloudFormation template. How can the CloudFormation developer ensure that the database resource is saved for backup purposes upon stack deletion?

Set the DeletionPolicy to Retain in the CloudFormation template. EXPLANATION The DeletionPolicy attribute can be used to preserve a specific resource when its stack is deleted. The DeletionPolicy Retain option can be used to ensure AWS CloudFormation keeps the resource without deleting the resource. The Stack Termination Protection feature enables protection against accidental deletion of an entire stack, not preservation of a specific resource. Similarly, the 'cloudformation:DeleteStack' Action applies to entire stack(s).

You work for a company which facilitates and organizes technical conferences. You ran a large number of events this year with many high profile speakers and would like to enable your customers to access videos of the most popular presentations. You have stored all your content in S3, but you would like to restrict access so that people can only access the videos after logging into your website. How should you configure this?

Share the videos by creating a pre-signed URL Remove public read access from the S3 bucket where the videos are stored All objects by default are private. Only the object owner has permission to access these objects. However, the object owner can optionally share objects with others by creating a pre-signed URL, using their own security credentials, to grant time-limited permission to download the objects. Anyone who receives the pre-signed URL can then access the object. For example, if you have a video in your bucket and both the bucket and the object are private, you can share the video with others by generating a pre-signed URL

ABC corp runs a web application that uses API Gateway to provide their developer customers with access to data. To reduce load on their upstream systems, the ABC corp have enabled API Gateway caching. A small number of developer customers still need access to results directly from the integration endpoint. To prevent all developer customers from bypassing the cache, ABC corp has also enabled the requirement for cache invalidation to require authorization. What must a developer customer do to return a result that is not cached from the API Gateway?

Sign their request with a user or role that has the required execute-api:InvalidateCache permissions to invalidate the cache. Include a Cache-Control: max-age=0 HTTP header in their request. EXPLANATION Setting a Cache-Control: max-age=0 HTTP header as part of the request tells API Gateway that you want a response directly from the integration endpoint, rather than a cached response. This header can be interpreted as the client stating the maximum age a cached result can be is 0 seconds - equivalent to saying it cannot be cached at all.

Your Lambda function requires a few libraries which are not available as standard in the Lambda runtime environment. Which of the following is a recommended way to make the libraries available to your function?

Store the deployment package in an S3 bucket and then upload it to Lambda Upload the deployment package to Lambda Create a deployment package containing your function code and libraries

You have developed a web application running on a number of EC2 instances running Tomcat, you are using an S3 bucket to store product data, with customer transaction data held in an RDS database. You anticipate that the number of connections into your website will grow considerably over the next year and you want to configure a scalable place to store session state data so that multiple web servers can share the session state. Which of the following are suitable options for this application?

Store the session state data in a DynamoDB table Use ElastiCache to store session state EXPLANATION DynamoDB and ElastiCache are both great options for storing session data. Both are scalable and resilient. RDS is more suited to relational data, whereas DynamoDB is far more flexible and better suited to storing session state data. Storing the data on the EC2 instances is not scalable or resilient. Lambda cannot store session state.

A document management application stores a catalogue of documents, each uniquely identified by its Document Number. Each document is also described by additional attributes: Document Title, Publication Date, Publisher Name, Country of Origin, and Length. Functional requirements specify that the application should be able to produce a listing of all documents for each country of origin. What would be the optimal DynamoDB data model for this application?

Table Partition Key=Document Number; Table Sort Key=Document Title; GSI Partition Key=Random Prefix; GSI Sort Key=Country of Origin;

You are running a large distributed application using a mix of EC2 instances and Lambda. Your EC2 instances are spread across multiple availability zones for resilience and are configured inside a VPC. You have just developed a new Lambda function which you are testing. However, when you try to complete the testing, your function cannot access a number of application servers which are located in the same private subnet. Which of the following could be a possible reason for this?

The function execution role does not include permission to connect to the VPC EXPLANATION To connect to a VPC, your functions execution role must have the following permissions: ec2:CreateNetworkInterface, ec2:DescribeNetworkInterfaces, ec2:DeleteNetworkInterface. These permissions are included in the AWSLambdaVPCAccessExecutionRole managed policy.

You are pair programming with another senior developer in your team and you have been tasked with writing a number of different Lambda functions. Your colleague recommends that you separate the Lambda handler from the core business logic of your code. What is the rationale for this?

To make the code easier to re-use

Which of the following platforms are supported in ElasticBeanstalk?

Tomcat Passenger Docker

Your application runs on Lambda and you would like to enable your functions to communicate with EC2 instances in your private subnet. How can you enable this?

Update your Lambda function with the relevant VPC config information EXPLANATION In order to enable Lambda to communicate with your private VPC, you need to add VPC config information. You do not need to add a NAT or Internet gateway and it is not possible to launch a Lambda function inside your own VPC or subnet.

You are the development lead on a large project to launch a new e-commerce website specialising in fishing supplies. Your developers are located in India, USA and the Middle East. You need to find a source code repository that everyone can use, and that will allow developers to continue to work on their code even when they are not connected to the internet. Which of the following would you suggest to the team?

Use CodeCommit to manage your source code

You are deploying a new version of your application using a CodeDeploy In-Place upgrade. At the end of the deployment you test the application and discover that something has gone wrong. You need to roll back your changes as quickly as possible. What do you do?

Use CodeDeploy to redeploy the previous version of the application

A developer has been tasked with migrating a large legacy web application, written in C++, to AWS. The developer wants to benefit from using Elastic Beanstalk to simplify the management of the infrastructure. Which of the following methods would allow the developer to migrate the application with the least amount of work?

Use Docker to containerize the application, which can then be deployed via Elastic Beanstalk. Use Packer to generate a custom AMI that contains the application, which can then be deployed via Elastic Beanstalk. EXPLANATION Elastic Beanstalk supports Docker containers and custom AMIs via Packer. Both would allow the legacy application to be wrapped in a layer of abstraction such that Elastic Beanstalk itself would not need to support the specific language of the legacy application.

GetItem operation is used to read data from a DynamoDB table. What strategy can be used to reduce the size of the read operations and increase read efficiency?

Use Projection Expression.

You are using CodeBuild to build the source code for your new application and would like to reference a large number of environment variables in buildspec.yml. However when you try to run the build you see an error telling you that the parameters you have specified have exceeded the number of characters allowed by the buildspec file. You need to find an alternative way to store these parameters, which of the following options would you recommend?

Use Systems Manager Parameter Store

You are developing a serverless retail application which includes a mobile app. All your product data is stored in DynamoDB, whilst the application itself runs on Lambda. The product catalogue is updated once every 6 months, to reflect seasonal stock and price updates. Each database read is 3KB in size and the application performs around 20 reads per second. Which of the following DynamoDB settings would you recommend?

Use eventually consistent reads Configure the table with 10 read capacity units EXPLANATION A read capacity unit represents one strongly consistent read per second, or two eventually consistent reads per second, for an item up to 4 KB in size. Eventually consistent reads provide greater throughput than strongly consistent. In this case the data changes infrequently, so eventually consistent is a good option

You are developing an application in API Gateway, and need to categorize your APIs based on their status as: sandbox, test, or prod. You want to use a name-value pair system to label and manage your APIs. What feature of API Gateway would you use to accomplish this task?

Use stage variables based on the API deployment stage to interact with different backend endpoints. EXPLANATION Stage variables are name-value pairs that you can define as configuration attributes associated with a deployment stage of a REST API. They act like environment variables and can be used in your API setup and mapping templates. With deployment stages in API Gateway, you can manage multiple release stages for each API, such as: alpha, beta, and production. Using stage variables you can configure an API deployment stage to interact with different backend endpoints. Environment variables apply to AWS Lambda.

Which of the following are supported ways to upload and deploy your Lambda code?

Write a CloudFormation template that will deploy your environment including your code. Zip your code into a zip file and upload it via the Lambda console Copy and paste your code in to the integrated development environment (IDE) inside Lambda Zip your code into a zip file, upload it to an S3 bucket and have Lambda download it from S3

You are developing a Lambda function which takes an average of 20 seconds to execute. During performance testing, you are trying to simulate peak loads, however soon after the testing begins, you notice that requests are failing with a throttling error. What could be the problem?

You have reached the limit of concurrent executions for Lambda

You are working on a Serverless application written in Node.js. You updated the Node.js code and uploaded a new zip file containing your code to Lambda. Your application references the function using the alias "Prod", however it not seem to be using the new code. Which of the following is likely to fix this?

You need to update the alias to reference the new version of your function

A CustomerOrders DynamoDB table contains attributes Customer Name (PK), Order Item, and Cost. What DynamoDB operation would be used to find all orders with cost greater than $10?

scan operation with "--filter-expression" parameter EXPLANATION A query operation is used to search for an item using a primary key value and so requires a Customer Name value to be specified. This would limit results to a specific customer and would not return all items with cost greater than $10. On the other hand, a scan operation reads every item in a table. A filter expression parameter can be used to narrow down the results based on some required criteria (Cost of the item in this case). We do not want to use projection-expression parameter as it is used to limit what attributes are returned as part of the results (not to filter the results).

Which of the following specifies the correct run order for lifecycle hooks for an In-Place deployment using CodeDeploy?

ApplicationStop, BeforeInstall, AfterInstall, ApplicationStart

What attribute should be set on a message when sent to a SQS queue that prevents the message from becoming visible to consumers of the queue for 300 seconds?

DelaySeconds EXPLANATION DelaySeconds allows the delivery of a message to be delayed for between 0 (default) and 900 seconds before the message becomes visible to consumers of the queue for the first time. VisibilityTimeout controls the time a message is hidden from consumers after it has been consumed. MessageRetentionPeriod controls how long a message remains available in a queue before it is discarded. ReceiveMessageWaitTimeSeconds controls polling wait time.

A developer has been tasked with writing a new Lambda function that generates statistics from data stored in DynamoDB. The function must be able to be invoked both synchronous and asynchronously. Which of the following AWS services would use synchronous invocations to trigger the Lambda function?

Application Load Balancer API Gateway

You are developing an online gaming application which needs to synchronize user profile data, preferences and game state across multiple mobile devices. Which of the following Cognito features enables you to do this?

Cognito Sync Cognito Events

A company is developing its first lambda function. The function needs access to their existing EC2 instances, which are all hosted in private subnets within their VPC. What must the company do to ensure their lambda can access the EC2 instances?

Configure the lambda function to connect the private subnets used by the EC2 instances. Configure lambda's execution role to have permissions for managing an ENI within the VPC. Configure lambda's security group, so it has access to the EC2 instances.

A company is developing its first lambda function. The function needs access to their existing EC2 instances, which are all hosted in private subnets within their VPC. What must the company do to ensure their lambda can access the EC2 instances?

Configure the lambda function to connect the private subnets used by the EC2 instances. Configure lambda's execution role to have permissions for managing an ENI within the VPC. Configure lambda's security group, so it has access to the EC2 instances.

A company is developing its first lambda function. The function needs access to their existing EC2 instances, which are all hosted in private subnets within their VPC. What must the company do to ensure their lambda can access the EC2 instances?

Configure the lambda function to connect the private subnets used by the EC2 instances. Configure lambda's execution role to have permissions for managing an ENI within the VPC. Configure lambda's security group, so it has access to the EC2 instances. XPLANATION To configure a lambda to connect to a VPC, one or more subnets into which it can connect must be defined. The lambda function creates an Elastic Network Interface in one of the given subnets. It, therefore, needs an execution policy that allows it permissions to do so. The specific permissions required are in the attached AWS documentation link. The Elastic Network Interface through which the lambda connects should then be associated with one or more security groups that allow network communication to the desired destinations, over the desired ports.

You are developing a latency-sensitive application which stores a lot of data in DynamoDB. Each item is 3.5KB in size. Which of the following DynamoDB settings would give you the greatest read throughput?

Configure the table with 10 read capacity units and use eventually consistent reads EXPLANATION A read capacity unit represents one strongly consistent read per second, or two eventually consistent reads per second, for an item up to 4 KB in size. Eventually consistent reads provide greater throughput than strongly consistent.


संबंधित स्टडी सेट्स

Ch. 57: Mgmt of Pts w/ Female Reproductive Disorders

View Set

Business, Marketing, and Finance I: Unit 1 Test

View Set

ECON 130: CHAPTER 1 (10 PRINCIPLES OF ECONOMICS) (148 Q)

View Set

Chapter 18: Eye and Ear Medications.

View Set

Disorders of the Thyroid and Parathyroid Glands EAQ

View Set