Practice Tests Flashcards
You need to setup a RESTful API service in AWS that would be services via the following url: https://democompany.com/customer. Which of the following of services can be used for development and hosting of the RESTful service?
A. AWS Lambda and AWS API Gateway
B. AWS Cloudfront and Elastic Load Balancer
C. AWS EC2 and AWS Elastic Load Balancer
D. AWS SQS and Cloudfront
AWS Lambda and AWS API Gateway,
and AWS EC2 and AWS Elastic Load Balancer.
Lambda can be used to host the code, and API gateway can be used to access the APIs which point to the Lambda.
You can also create your own API service, host it on an EC2 instance and then use the AWS Application Load Balancer to do path based routing.
Which of the following is the right sequence of hooks that get called in AWS CodeDeploy?
A. ApplicationStop -> BeforeInstall -> AfterInstall -> ApplicationStart
B. BeforeInstall -> AfterInstall -> ApplicationStop -> ApplicationStart
C. BeforeInstall -> AfterInstall -> ValidateService -> ApplicationStart
D. BeforeInstall -> ApplicationStop -> ValidateService -> ApplicationStart
A. ApplicationStop -> BeforeInstall -> AfterInstall -> ApplicationStart
The full sequence is ApplicationStop DownloadBundle BeforeInstall Install AfterInstall ApplicationStart ValidateService
What is the sequence of hooks that gets called in AWS CodeDeploy without Classic load balancer in the deployment group?
The full sequence is
ApplicationStop DownloadBundle BeforeInstall Install AfterInstall ApplicationStart ValidateService
What is the sequence of hooks that gets called in AWS CodeDeploy with a classic load balancer in the deployment group?
The full sequence is
BeforeBlockTraffic BlockTraffic AfterBlockTraffic ApplicationStop DownloadBundle BeforeInstall Install AfterInstall ApplicationStart ValidateService BeforeAllowTraffic AllowTraffic AfterAllowTraffic
What’s best practice for working with external dependencies in AWS Lambda?
Minimize your deployment package size to its runtime necessities. This will reduce the amount of time that it takes for your deployment package to be downloaded and unpacked ahead of invocation. For functions authored in Java or .NET Core, avoid uploading the entire AWS SDK library as part of your deployment package. Instead, selectively depend on the modules which pick up components of the SDK you need ( (e.g. DynamoDB, Amazon S3 SDK modules and Lambda core libraries).
You are developing a function that will be hosted in AWS Lambda. The function will be developed in .NET. There are a number of external libraries that are needed for the code to run. Which of the following is the best practice when it comes to working with external dependencies for AWS Lambda?
A. Make sure that the dependencies are put in the root folder
B. Selectively only include libraries that are required
C. Make sure the libraries are installed in the beginning of the function.
D. Place the entire SDK dependencies in S3.
B. Selectively only include libraries that are required.
Your team has a CodeCommit repository in your account. You need to give developers in another account access to your CodeCommit repository. Which of the following is the most effective way to grant access?
A. Create IAM users for each developer and provide access to the repository.
B. Create an IAM group, add the IAM users and then provide access to the repository.
C. Create a cross account role, give the role the privileges, provide the role ARN to the developers.
D. Enable public access to the repository
C. Create a cross account role, give the role the privileges, provide the role ARN to the developers.
When you provide access to a CodeCommit repository for IAM users and groups in another AWS account, this is often referred to as cross account access.
How do you create access to a CodeCommit repository for IAM users and groups in another AWS account?
There are three sets of actions that need to be taken:
- Actions by the administrator for the account that owns the repository.
- Actions by the administrator in the account that the IAM users/groups are.
- Actions for the repository users in the other account.
- . Account A administrator must. 1) Create a policy in account A that grants access to the repository. 2) Create a role in account A that can be assumed by IAM users and groups in account B. 3) Attach the policy to the role.
- Account B administrator must 1) Create an IAM group for repository access for accountB users. 2) Create a policy and add users to the IAM group.
– Repository users in account B must configure their local computers for repository access.
Your company is planning on using the Simple Storage service to host objects that will be accessed by users. There is speculation that there would be roughly 6,000 GET requests per second. Which of the following could be used to ensure optimal performance? Choose 2.
A. Use a CloudFront distribution in front of the S3 bucket.
B. Use sequential data-based naming for your prefixes.
C. Enable versioning for the objects.
D. Enable cross region replication for the bucket
A & B: Use a Cloudfront distribution in front of the S3 bucket. Use sequential date-based naming for your prefixes.
How many PUT/POST/DELETE and GET requests can an S3 bucket handle?
Your application can achieve at least 3,500 PU/POST/DELETE and 5,500 GET requests oer second per prefix in a bucket. There are no limits to the number of prefixes in a bucket. It is simple to increase your read or write performance exponentially. E.g., if you create 10 prefixes in an Amazon S3 bucket to parallelize reads, you could scale your read performance to 55,000 read requests per seconds.
You are working on an application which uses Amazon Cognito. Data in Amazon Cognito needs to be further analyzed using Amazon Redshift. You are planning to use Kinesis Streams for this purpose. Which of the following can be performed to have Amazon Cognito Events push events to Kinesis Streams to get analyzed data from Amazon Redshift?
A. Only use an existing Kinesis Stream and create an IAM role which grants Amazon Cognito permission to publish to this existing Stream.
B. Use an existing Kinesis Stream or create a new Kinesis Stream & create an IAM role which grants Amazon Cognito permission to publich to Stream.
C. Create a new kinesis stream instead of using existing Kinesis stream and create an IAM user with permissions to Amazon Cognito to publish to this new stream.
D. Create a new Kinesis stream and enable an Amazon Cognito Streams which will automatically start putting events in the selected stream.
B. Use an existing Kinesis Stream or create a new Kinesis Stream and create an IAM role which grants Amazon Cognito permission to publish to the stream.
What is Amazon Cognito Streams and how can it be used?
Cognito Streams gives developers control and insight into their data stored in Amazon Cognito. Developers can configure a Kinesis Stream to receive events as data is updated and synchronized. Amazon Cognito can push each dataset change to a Kinesis stream you own in real time. Using Cognito Streams, you can move all of our Sync data to Kinesis, which can then be streamed to a data warehouse tool such as Amazon Redshift for further analysis.
A DynamoDB table has a read throughput capacity of 5 RCU. Which of the following read configuration will provide us the maximum read throughput?
A. Read capacity set to 5 for 4KB reads of data at strong consistency.
B. Read capacity set to 5 for 4KB reads of data at eventual consistency.
C. Read capacity set to 15 for 1KB reads of data at strong consistency.
D. Read capacity set to 5 for 1KB reads of data at eventual consistency.
B. Read capacity set to 5 for 4KB reads of data at eventual consistency.
This is how you would calculate each option.
A. Read capacity (5) * amount of data (4) = 20KB/s
B. Read capacity (5) * amount of data (4) * 2 = 40 KB/s
C. Read capacity (15) * amount of data (1) = 15 KB/s
D. Read capacity (5) * amount of data (1) * 2 = 10 KB/s
Your team is developing a solution that will make use of DynamoDB tables. Due to the nature of the application, the data is needed across a couple of regions across the world. Which of the following would help reduce the latency of requests to DynamoDB from different regions?
A. Enable multi-az for the dynamoDB table
B. Enable global tables for DynamoDB
C. Enable indexes for the table
D. Increase the read and write throughput for the table
B. Enable global tables for DynamoDB
What are DynamoDB global tables?
DynamoDB global tables provide a fully managed solution for deploying a multi-region, multi-master database, without having to build and maintain your own replication solution. When you create a global tables, you specify the AWS regions where you want the table to be available. DynamoDB performs all of the necessary tasks to create identical tables in these regions, and propagate ongoing data changes to all of them.
You are using Amazon Cognito identity pools to assign authenticated SAML users a temporary access for downloading data from Amazon S3 buckets. For this you have created multiple rules for each role which gets assigned to users. Which of the following criteria is matched for evaluating these rules?
A. Rules are evaluated in sequential order and rule with lower value is preferred.
B. Rules are evaluated in sequential oerder and IAM role for first matching rule is used, unless a standard attribute is specified to override the order.
C. Rules are evaluated in sequential order and rule with higher value is preferred.
D. Rules are evaluated in sequential order & IAM role for first matching rule is used, unless a “CustomRoleArn” is specified to override the order.
D. Rules are evaluated in sequential order and IAM role for first matching role is used, unless a “CustomRoleArn” is specified to override the order.
What’s the difference between Cognito User Pools and Identity Pools?
User pools are for authentication (identity verification). With a user pool, your app users can sign in through the user pool or federate through a third-party identity provider (IdP). Identity pools are for authorization (access control). You can use identity pools to create unique identities for users and give them access to other AWS services.
When should you use Cognito user pools?
Use a user pool when you need to:
- Design sign-up and sign-in webpages for your app.
- Access and manage user data.
- Track user device, location and IP address, and adapt to sign-in requests of different risk levels.
- Use a custom authentication flow for your app.
When should you use Cognito identity pools?
Use an identity pool when you need to:
- Give your users access to AWS resources, such as an S3 bucket or DynamoDB table.
- Generate temporary AWS credentials for unauthenticated users.
You are developing a common Lambda function that will be used across several development environments such as dev, q, staging, etc. The Lambda function needs to interact with each of these development environments. What is the best way to develop the Labda function?
A. Create a Lambda function for each environment so that each function can point to its respective environment.
B. Create one Lambda function and use environment variables for each environment to interact.
C. Create one Lambda function and create several versions for each environment.
D. Create one Lambda function and create several ALIAS for each environment.
B. Create one Lambda function and use environment variables for each environment to interact.
What are environment variables in Lambda and how are they used?
Environment variables for Lambda functions enable you to dynamically pass settings to your function code and libraries, without making changes to your code. Environment variable are key-value pairs that you create and modify as part of your function configuration. Lambda then makes these key value pairs available to your Lambda function code using standard APIs supported by the language, like process.env for Node.js functions.
You just developed code in AWS Lambda that makes use of recursive functions. After several invocations, you are beginning to see throttling errors in the metrics. Which of the following should be done to resolve this issue?
A. Place the recursive function in a separate package.
B. Use versioning for the recursive function.
C. Avoid using recursive code altogether.
D. Use the API gateway to call the recursive code.
C. Avoid using recursive code altogether.
Why should you avoid using recursive code in your Lambda function?
Using recursive code in your Lambda function, wherein the function automatically calls itself until some arbitrary criteria is met, could lead to unintended volume of function invocation and escalated costs.
When calling an API operation on an EC2 instance, the following error message was returned:
A client error (UnathorizedOperation) occurred when calling the RunInstances operation: You are not authorized to perform this operation. Encorded authorization failure message: alesjfliaseuroiaewjfkjsdfkSKHSHFKJSDHFKLSRT43857897JDFKJSDNFJDSNFKSDJFSD89ER8
Which of the following can be used to get a human-readable error message?
A. Use the command aws sts decode-authorization-message
B. Use the command aws get authorization-message
C. Use the IAM policy simulator.
D. Use the comman aws set authorization-message
A. Use the comman aws sts decode-authorization-message
You are planning on deploying an application to the worker role in Elastic Beanstalk. Moreover, this worker application is going to run the periodic tasks. Which of the following is a must have as part of the deployment?
A. An appspec.yaml file
B. A cron.yaml file
C. A cron.config file
D. An appspec.json file
When you use Elastic Beanstalk to deploy a new application or application version, you’ll need to upload a source bundle that meets the following criteria (consist of a single zip file or WAR file (you can have multiple WAR files in one zip file), not exceed 512 MB, not include a parent folder or top-level directory (subdirectories are fine)).
If you want to deploy a worker application that process periodic background tasks, your application source bundle must also include a cron.yaml file.
You have developed a web based application which makes calls to a backend API. Which of the following heads are required by web browsers to be set up in each API method which has CORS enabled?
A. Access-Control-Allow-Headers B. Access-Control-Allow-CORS C. Access-Control-Expose-Headers D. Access-Control-Expose-Origin E. Access-Control-Allow-Origin
A & E.
Access-Control-Allow-Headers and Access-Control-Allow-Origin.
Your application currently points to several Lambda functions in AWS. A change is being made to one of the Lambda functions. You need to ensure that application traffic is shifted slowly from one Lambda function to the other. Which of the following steps would you carry out?
A. Create an ALIAS with the -routing-config parameter.
B. Update the ALIAS with the -routing-config parameter.
C. Create a version with the -routing-config parameter.
D. Update the version with the -routing-config parameter.
E. Update the function with -config parameter
A & B.
Create an ALIAS with the -routing-config parameter.
Update the ALIAS with the -routing-config parameter.
By default, an alias points to a single Lambda function version. When the alias is updated to point to a different function version, incoming request traffic in turn instantly points to the updated version. This exposes that alias to any potential instabilities introduced by the version. To minimize this impact, you can implement the routing-config parameter of the Lambda alias that allows you to point to two different versions of the Lambda function and dictate what percentage of incoming traffic is sent to each version.