Chapter 9 Configuration as Code Flashcards

1
Q

Difference b/t ( aws Opworks for Chef Automate / AWS OpsWorks for Puppet Enterprise) and AWS OpsWorks Stack

A

OpsWorks Stacks does not provision an EC2 instance w/ puppet/chef software. Thee other two do.

OpsWorks Stacks uses and ‘in memory’ chef server and a ‘chef client’.

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

T/F: You must replace instances in order to update cookbooks in AWS OpsWorks

A

True

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

How to package cookbook dependencies?

A

Use a tool called berkshelf. Good for packaging dependencies before you upload it to S3 (and then set it as cookbook source)

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

T/F: When you create a resource in the stack, such as an instance, it is available only from the endpoint you specify when you create the stack.

A

True

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

If you want to use a custom AMI in OpsWorks, what are the requirements?

A
  1. AMI must be based off of AMI which OpsWorks supports
  2. must be 64 bit
  3. must support instance types you want to launch
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In chef terminology, a ‘layer’ is equivalent to what?

A

a ‘role’

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

For EBS backed instances, the IP address will 1. ___ when instance restarts; for instance store backed instances, it will 2. ____.

A
  1. stay the same

2. change

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

In regard to EBS volumes, when volumes are added or removed from a layer, only ______ will receive the updated configuration.

A

New instances. Existing instance volumes do not change.

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

What are the three types of instances supported by OpsWorks Stacks?

A
  1. 24/7: they run until you stop them
  2. Time based instances: they run on specified schedules. (good for handling predictable load on your stack)
  3. Load based instances: they start and stop based on load metrics like ‘NetworkOut’ and ‘CPUUtilization’
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Caveat about using load based and time based instances with OpsWorks Stacks

A

Unlike auto scaling groups, you must set these up ahead of time via console or CLI.

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

Do instances automatically install security and package updates?

A

No, this occurs only when the instance is first started.

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

An alternative to updating instances directly via OpsWorks is to ….

A

regularly launch new instances to replace old ones

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

Within OpsWorks can you register instances in separate accounts or even on prem instances? How?

A

Yes, by installing the OpsWorks agent on the target instances.

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

What is ‘auto healing’ in the context of OpsWorks?

A

When an instance can’t communicate with the OpsWorks service for 5 minutes, it will restart automatically. Enabled by default.

NOTE: health check itself performed every minute

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

When an app update occurs, will instances in OpsWorks automatically update with the new app?

A

No, but new instances will.

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

T/F: OpWorks stack users are associated with a specific region and cannot be given access to stacks in another region.

A

True

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

What are the four stack level permissions you can give a user?

A
  1. Deny: no action allowed on stack
  2. Show: user can only view stack configuration
  3. Deploy: user can view and deploy stacks
  4. Manage: view, deploy, manage
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How are Chef recipes executed?

A

Via lifecycle events or manually.

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

Any time an instance in a stack comes online or goes offline, all instances in the same stack will undergo a ______ lifecycle event

A

Configure

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

When will an instance run the ‘DEPLOY’ lifecycle event?

A

Only after it has run the initial SETUP and CONFIGURE lifecycle events. After this, it must be run manually each time you want to run it.

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

What is the name of the lifecycle event which removes an app from an OpsWorks layer?

A

UNDEPLOY

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

What is a lifecycle event associated with tasks like taking snapshots and copying log files to S3 for later use?

A

SHUTDOWN

23
Q

If an AWS resource like RDS is registered with a stack and attach to an instance, is it deleted when instance is deleted?

A

No, you must manually delete it via console or CLI

24
Q

What is an important limitation regarding EBS volumes with OpsWorks Stack?

A

You cannot attach EBS volumes to Windows stacks.

Also, you can only register EBS volumes to one stack at a time.

25
Q

Can you register an RDS instance with multiple apps in the same stack?

A

Yes

26
Q

Any data that you define at the _____ level overrides the data set at the layer or stack levels.

A

deployment

27
Q

Any data set at the _____ level overrides the data set at the stack level.

A

layer

28
Q

list basic metrics displayed in OpsWorks dashboard

A
  1. cpu
  2. memory utilization
  3. load
  4. processes
29
Q

cloudwatch events supports which event types from OpsWorks?

A
  1. Instance state change
  2. Command state change
  3. Deployment state change
  4. Alerts
30
Q

Is instance monitoring the same b/t Linux and Windows?

A

No, Windows based stacks provide only basic EC2 metrics

31
Q

What is standard service limit threshold for stacks, layers per stack, instances per stack, and apps per stack?

A

40

32
Q

Can an instance with 1 vCPU run a container which requires 2vCPUs?

A

No

33
Q

Does scaling out a cluster increase the running task count?

A

No, service auto scaling performs that task.

34
Q

What is a major restriction of Fargate containers?

A

They cannot be run in ‘privileged’ mode. You can verify a given task definition is acceptable by running the ‘requires capabilities’ option in the console or CLI.

35
Q

What is a ‘task definition’ with regards to containers?

A

JSON document which describes what containers launch for an application. It can specify up to 10 containers and their requirements.

36
Q

What are conditions under which containers should be added to the same task definition?

A
  1. containers share same lifecycle
  2. containers need to run on the same host/instance
  3. containers need to share the same resources
37
Q

What is a ‘service’ in the context of containers.

A

Process/entity created by specifying task definition and number of task to maintain.

If any containers in service become unhealthy, the service is responsible and launches a replacement task.

Service also defines min/max healthy thresholds for deployment strategies.

38
Q

Classic load balancers register/deregister instances. What is an implication of this fact?

A

Any tasks being run on the classic load balancer all exist on the same container instance.

An alternative to this is the application load balancer ALB.

39
Q

Target Tracking Policies

A

determine when to scale the number of tasks based on a target metric

40
Q

Step Scaling Policies

A

task scaling policy which grows with multiple ‘step’ based metrics. So for example it can grow based on reaching 70% cpu utilization and yet again when 80% threshold met.

41
Q

Task Scaling Policies

A

These describe on which instances tasks launch or which tasks terminate during scaling actions. v

Policies implemented on best effort basis (‘try to do it, and if I can’t just settle on whatever works’)

42
Q

ECS Service Discovery

A

Allows you to assign Route 53 DNS entries to tasks your service manages

43
Q

ECS Container Agent

A

Responsible for monitoring the status of tasks running on cluster instances. Monitors health of containers and replaces them if necessary. Automatically available in ECS optimized AMIs

Note: instance must be restarted if trying to update agent on Windows.

44
Q

Can you create an ECS cluster when setting up a CodePipeline?

A

No, it must be created ahead of time.

45
Q

Unlike ECS, Fargate requires no ____

A

agent management (ECS manages clusters via agent)

46
Q

Clusters consist of 1. ______ which contain an installed 2. ______ responsible for receiving scheduling/shutdown commands from the ECS service and reporting health of containers.

A
  1. EC2 Instances

2. agent

47
Q

How do you allow a user cross region access to a stack?

A

You have to copy the user to another region.

48
Q

List the lifecycle events

A

setup, configure, deploy, undeploy, shutdown

Note: CONFIGURE run on all instance in stack if any instance comes online or goes offline

49
Q

Can you raise limits on Stack limits?

A

no

50
Q

After updating a custom cookbook repository, will

any currently online instances automatically receive the updated cookbooks?

A

no, You must run the ‘Update Custom Cookbooks’ command.

51
Q

When will an AWS OpsWorks Stacks instance register and deregister from an Elastic Load Balancing load balancer associated with the layer?

A

Instances will be registered when they enter an online state and are deregistered when they leave an online state.

52
Q

Why should instances in a single AWS OpsWorks Stacks layer have the same functionality and purpose?

A

Because all instances in a layer run the same recipes

53
Q

How many containers can a single task definition describe?

A

10