AWS Gen Study Flashcards

1
Q

How does the credentials file play a role in the AWS CLI?

A

When running a CLI command that does not explicitly specify which profile to use, it will look to the credentials file;

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

What is the AWS CLI credentials chain?

A
Command line options;
Environment variables;
CLI Credentials file;
Configuration file;
Container Credentials;
Instance profile credentials;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

You can point an Alias to an unlimited number of function versions, true or false?

A

False. You can point it to two.

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

What is lazy loading in Amazon ElastiCache?

A

When data is requested, it looks in the cache to see if it exists; if it doesn’t it will grab it from the DB, and then write it to the cache

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

What are the disadvantages of a write-through in ElastiCache?

A

Missing data - when you spin up a new node, there is missing data; the data is missing until its updated or added to the DB;
Cache churn - most data will sit there and not be read (we can fix this with TTL);

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

What is an CodeDeploy deployment group?

A

It is a CodeDeploy entity for grouping EC2 instances or AWS Lambda functions in a CodeDeploy Deployment

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

To control access to an API in API Gateway, we can configure the security group of the API, true or false?

A

False. API Gateway does not use security groups but uses resource policies

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

Auto Scaling Group can span regions, true or false?

A

False. they can span AZs

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

Auto Scaling Groups can work with both Network and Application Load Balancers, true or false?

A

True

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

What API operation can we use to get security credentials to an existing IAM user? What parameter can we use to specify timing?

A

GetSessionToken and Duration Seconds

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

How can we request temporary security credentials?

A

With AWS STS

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

What is the AssumeRole API operation used for?

A

It is useful for allowing existing IAM users to access AWS resources they don’t already have access to. It can also be used cross-account

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

What file is used by CodeDeploy to manage the deployment?

A

appspec.yaml

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

What are the Elastic Beanstalk deployment options?

A
All At Once
Rolling
Rolling with additional batch
Immutable update
Traffic Splitting
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are negatives about Elastic Beanstalk Immutable update?

A

It is the highest cost and longest deployment but zero downtime

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

We need to decrypt files with KMS. How can we do this?

A

We take an encrypted key and pass it to the decrypt operation. We then use the plain text key to decrypt the encrypted file. Remove the plain text key from memory as soon as possible

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

What is the difference between a delay queue and a visibility timeout for SQS?

A

A delay queue is a period of time where the item added to the queue cannot be consumed once it has been added to the queue. The visibility timeout only is applicable once a message has been consumed.

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

To implement long polling, we hit the SetQueueAttributes with a WaitTimeSeconds parameter. True or False?

A

False. SetQueueAttributes can be used to set things about the Queue like DelaySeconds and VisibilityTimeout. We want the RecieveMessage API with WaitTimeSeconds.
We can however set RevieveMessageWaitTimeSeconds on the queues parameters.

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

How do we Recieve Messages in SQS?

A

We hit the RevieveMessages API and can consume one to 10 messages. If you set a value greater than zero for ReceiveMessageWaitTimeSeconds, than long polling is in effect. This will also query all servers instead of a subset of servers.

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

We want to notify someone when items are uploaded to an S3 bucket. What is the best way to achieve this?

A

Add an event on the bucket to send out a PUT or POST to SNS

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

We want to update our current instances with no downtime in elastic beanstalk and using the existing instances; what is a good option?

A

Rolling with additional batches. The new batch will receive requests while the old instances are update. Then, when all the old batches are updated, the new batch will be terminated.
In standard rolling update, instances taken out in batches cannot serve requests

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

When using an on-premise server, you should attatch an IAM role and use that to make API calls to AWS, true or false?

A

False. You cannot attatch an IAM role to an on-premise server. You should create an IAM user, generate access keys and create a credentials file on the on-premise server. If it was an EC2 server, storing an IAM role would be the preferred way.

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

For async lambda functions, lambda puts events in a queue. If the lambda does not have the capacity, events may be lost. How can we mitigate losing events?

A

Put them in a dead-letter queue

24
Q

An async execution of a lambda function failed, what happens?

A

Lambda reruns it twice

25
Q

What services does Lambda handle to send async invocations to?

A

SQS, SNS, Lambda and EventBridge

26
Q

The Event Source Mapper invokes the lambda function asynchronously; true or false?

A

False. Synchronously

27
Q

What happens if a function returns an error the the event source mapper when processing streams?

A

The entire batch is reprocessed until either the function succeeds or the items in the batch expires

28
Q

To set up a DLQ with Event Source Mapping, Lambda and queues, we set up the DLQ with lambda. True or false.

A

False. Lambda with DLQ is only for async invocations. The ESM is synchronous.

29
Q

For a lambda function to be triggered by an ALB, what must happen?

A

The Lambda function must be placed in a target group

30
Q

A user needs to verify that the IAM policy grants permission to call sts:AssumeRole for the role that they want to assume. What must happen in the policy?

A

The action element of the IAM policy must allow them to “sts:AssumeRole”

31
Q

What is the assume role of STS used for?

A

It returns a temporary set of credentials that allow the user to access AWS resources they normally wouldn’t have access to

32
Q

If we needed to write temporary log files to storage on an EC2 instance, would EBS of EFS be a more suitable solution?

A

EBS as EFS is generally more suitable to data that needs to be used by various EC2 instances

33
Q

For ECS dynamic port mappings is when you set the host port to say 80 and the container port to 0; true or false?

A

False. We set the host port to 0 and the container port to 80. They are specified as part of the container definition. When we set the host port to 0, ECS will automatically assign it a port.
Dynamic port mappings let us run more than one instance of a task on an instance

34
Q

What is the relationship between ECS, EC2 and Clusters?

A

Clusters are logical groupings of EC2 instances. The instances run the ECS agent (Docker container) which registers the instance to the cluster

35
Q

What do ECS task definitions do?

A

They tell ECS how to run a docker container

36
Q

A container is having trouble pulling images from ECR or cannot talk to S3. What is a good reason this may be happening?

A

There is not a task role or an inappropriate task role assigned to the task.

37
Q

What must the .zip file contain that is deployed to Lambda?

A

The zip file must contain the functions code and any dependencies needed to run the code.
If your function depends only on standard libraries or AWS SDK libraries you do not need to include the libraries in the zip file. If the zip is larger than 50 MB, we should upload it to S3.

38
Q

What is the biggest difference between SSE-KMS an SSE-S3 encryption?

A

There is an audit trail and extra security with using SSE-KMS

39
Q

What is AWS CloudTrail good for?

A

It is good for monitoring activity in the AWS account as it relates to actions taken in the Management Console, SDK, command line, etc. Really used for operational analysis

40
Q

What is an output in a CloudFormation template? What is a parameter and what is a resource? What are mappings?

A

Output declares values you can import into other stacks;
Parameter is a value allowed to be inputed at creation or updating of a stack;
Resource points to another AWS resource;
Mappings are keys that map to corresponding set of named values

41
Q

What is the max item size for DynamoDB?

A

400 KB

42
Q

What are transactional writes in DynamoDB?

A

They are coordinated all or nothing changes in the database

43
Q

What are amazon cloud watch events?

A

CloudWatch Events deliver a stream of real time events that describe changes in Amazon resources

44
Q

We pull the docker image form ECR with the CLI command of aws ecr get-login and then run docker pull REPOSITORY URI : TAG; why wont this work?

A

We need to run the output of aws ecr get-login

45
Q

What do we need to do to allow an EC2 instance to send data to AWS X-Ray?

A

We need to install the data then put the proper instance profile on the EC2 instance. The daemon will use the instance profile credentials to call out to X-Ray.

46
Q

We need to control the placement of tasks onto groups of container instances organized by AZ and instance type. How can we do this?

A

Cluster Query Language

47
Q

For general use, what is the fastest way to set up your AWS CLI configuration?

A

Run the aws configure command

48
Q

What is chain of places the AWS CLI looks for to find credentials?

A
Command line options;
Env variables;
CLI credentials file;
CLI config file;
Container credentials;
Instance profile credentials;
49
Q

We can save IAM login credentials to use with the AWS CLI, true or false?

A

False as the IAM login credentials cannot be used with the AWS CLI. You need to use an access key ID and secret access key with the AWS CLI and these are configured for use by running aws configure.

50
Q

We can define the Auto Scaling of tasks in the task definition, true or false?

A

False, we can do that in the service

51
Q

What is the action element in an IAM policy?

A

It specifies tasks you can do with a specific service

52
Q

What is a Lambda authorizer?

A

It is a feature you can use with API Gateway to control access to your API

53
Q

SSM Managament store is a good choice when rotating keys, true or false?

A

False. AWS secrets manager should be used

54
Q

What is AWS WAF?

A

A web-application firewall that helps protect web applications against common web exploits that may affect availability compromise security, or consume excessive resources.

55
Q

When using CloudFormation with SAM template, what command must you run to prepare it for deployment?

A

aws cloudformation package

56
Q

We should merge hot shards and split cold shards, true or false?

A

False. We merge cold shards to make better use of their unused capacity and split hot shards.

57
Q

DynamoDB streams with lambda triggers is asynchronous, true or false?

A

False, it is synchronous