Infrastructure as code (CF) Flashcards

1
Q

CloudFormation

A

CloudFormation defines logical resources within templates (using YAML or JSON).

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

CloudFormation Stacks

A

what gets created from a CF template

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

Parameters

A

Template parameters accept input form console ,CL, or API

when a stack is created or updated

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

Template Parameters

A

Default, or explicit values chosen

you set the values in the template

Parameters references are used by CloudFormation to provision physical resources

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

Pseudo Parameters

A

Parameters provided by AWS based on environment when creating the stack

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

CloudFormation Intrinsic functions: Fn::GettAtt

A

GetATT can be used to retrieve any attribute associated with the resource. Most Logical resources return detailed configuration of the physical resources.

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

CloudFormation Intrinsic Functions

A

AWS CloudFormation provides several built-in functions that help you manage your stacks. Use intrinsic functions in your templates to assign values to properties that are not available until runtime.

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

CloudFormation Intrinsic functions: Ref

A

using !Ref on template or pseudo parameters returns their value. When used with logical resources-the physical ID is usually returned

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

CloudFormation Intrinsic functions:

Fn::Join and Fn: Split

A

split or join strings

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

CloudFormation Intrinsic functions:

Fn::GetAZs and Fn::Select

A

!GetAZs and !Select, a template can be made portable. Rather than explicitly specifying AZ by using intrinsic functions resources can be launched or created in AZ1 AZ2

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

CloudFormation Intrinsic functions:

Fn::Basse64 & Fn::Sub

A

Fn::Base64 accepts plaintext .. and outputs Base64 encoded text

Fn::Sub substitutes variables in the input, which their actual runtime values. In the example the instanceid attribute of the instance logical resource.

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

CloudFormation Conditions

A

created in the optional ‘conditions’ section of a template

conditions are evaluated to True or False

processed before resources are created

user the other intrinsic function AND,EQUALS,IF,NOT, OR

associated with local resources to control if they are created or not

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

CloudFormation Intrinsic functions:

Fn::Cider

A

Fn::Cider is used to generate a number of smaller CIDR ranges for subnets, from a larger VPC range

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

CloudFormation Mappings

A

Templates can contain a mapping object which contains may mappings which maps keys to values , allowing lookup

can have one key, or Top & second level

Mappings use the !FindInMap intrinsic function

Common use.. retrieve AMI for given region & architecture

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

CloudFormation Outputs

A

Templates can have an optional output section values can be declared in this section visible as outputs when using CLI or console UI.

accessible from a parent stack when using nesting. can be exported , allowing cross-stack references.

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

CloudFormation DependsOn

A

Depends on let you explicitly define the dependency order

ex: if resources B and C depends on A both wait for A to complete before starting

17
Q

CloudFormation Wait Condition, Creation Policy & cfn-signal

A

configure CloudFormation to hold → wait for ‘x’ number of success signals

wait for Timeout H:M:S for those signals(12hr Max)

can send success or fail signals

EC2 and to scaling groups(AWS resouces) → user a creationPolicy

EC2 or external Systems → used to get information from external system

18
Q

CloudFormation Nested Stacks

A

used to overcome the 500 resource limit of one stack

modular template .. code reuse

Make the installation process easier

nested stack created by the root stack

you can only refence the outputs when using nested stacks you can’t reference the logical resources created in any of the nested stack

19
Q

CloudFront Cross-Stack References

A

outputs are normally not visible from other stacks

Nested stacks can reference them

outputs can be exported… Making them visible from other stacks

Exports must have a unique name in the regions

Fn::Import can be used instead of Ref

20
Q

CloudFormation StackSets

A

Deploy CFN stacks across many account & regions

stack sets are containers in a admin account

container stack instances .. which reference stacks

stack instance & stacks are in ‘target accounts’

each stack = 1 region in 1 account

21
Q

Retain stack

A

allows you to remove stack instances from stack sets and by default it will remove the stacks in target accounts but can be set to retain Stack after removal.

22
Q

Stack Failure Tolerance

A

the amount of individual deployment can fail before the Stack set is consider failed

23
Q

Stack set operation options : Maximum concurrent accounts

A

how many stacks you want deployed in each region

24
Q

When would you use CloudFormation StackSets

A

Enabling AWS config

Aws config Rules - MFA, EIPS,EBS encryption

create IAM Roles for cross-account access

25
Q

CloudFormation DeletionPolicy

A

if you delete logical resource’s from a template the physical resources is also deleted which could cause data loss.

With deletion policy, you can define on each resource Delete(Default), Retain or (if supported) Snapshot.

26
Q

What resources can an CloudFormation DeletionPolicy be used on ?

A

EBS volume, ElastiCache , Neptune ,RDS , Redshift

27
Q

CF Stack Roles

A

CFN uses the permissions of the logged in identity

which means you need permission for AWS

CFN can assume a role to gain permissions

This lets you implement role separation

The identities creating the stack.. doesn’t need resource permission-only PassRole

28
Q

CloudFormation cfn-init

A

Another way you can provide configuration information to an ec2 instance

simple configuration management system AWS::CloudFormation::Init part of logical resouces

Desired state -What(Cfn-init decides How)

Cfn-init helper-script -installed on EC2 OS(makes it so)

29
Q

CloudFormation cfn-hup

A

if CloudFormation::Init is updated, it isn’t run

cfn-hup helper is a daemon which can be installed

detects changes in resources metadata

running configurable actions when a change is detected

Update Stack → update config on EC2 instances

30
Q

CloudFormation Change Sets

A

changes to stacks could cause no interruptions, some interruption, or Replacement which cause interruptions.

change sets let you preview changes(A change set: over view of changes to a stack)

multiple different version(lots of change sets)

chosen changes can be applied by executing the change set

31
Q

CloudFormation Custom Resources

A

Custom resources Lets CFN integrated with anything it doesn’t yet or doesn’t natively support

passes data to something and gets data back from something

CFN sends data to an endpoint that you define within the custom Resources that data gets sent to a lambada function or an SNS topic once created it then signals back to CFN

32
Q

How does Cloud Formation work ? Explain the process ?

A

The logical resource defines the WHAT, and leaves the HOW up to the CFN product.

A CFN stack creates a physical resource for every logical resource - updating or deleting them as a template changes.

33
Q

What some defaults that parameters can be configured with ?

A

can be configured with Defaults, AllowedValues, Min and Max length & Allowed Patterns, No Echo & Type

34
Q

How can parameters influence the resources created ?

A

can be referenced from within Logical resources

which allows them influence physical resources and /or configuration