AWS CloudFormation Flashcards

(35 cards)

1
Q

CloudFormation

A

Declarative way of outlining your AWS infrastructure for any resources via template

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

Clouformation resources

A

Represent the different AWS components that will be created and configured, mandatory in template

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

CloudFormation parameters

A

Way to provide inputs to your template, if config will change in future you should make it a parameter

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

AllowedValues parameter

A

eg. use to specify what EC2 instance type is allowed

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

NoEcho parameter

A

NoEcho: true means the value will not be displayed anywhere eg. in logs

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

Syntax for parameters

A

Use Fn::Ref or !Ref in YAML to reference parameters

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

Pseudo parameters

A

set parameters eg. AWS::Region to get the region

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

Mappings

A

Fixed variables within the template, good for differentiating between different environments, regions ,etc

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

Mappings vs Parameters

A

Use mappings when you know in advance all the values that can be taken and can be deduced from things like region and AZ, use parameters when the values are user specific

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

Outputs

A

Declare optional output values that we can import into other stacks, view in AWS console of CLI

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

How to reference output from another stack

A

Use Fn::ImportValue or !ImportValue

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

True or false? You can delete the underlying stack without deleting the underlying references

A

False

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

CloudFormation conditions

A

Common use case us dev / test / prod, use different resources depending on environment

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

Fn::Ref

A

Can reference parameters or resources, shorthand is !Ref in YAML

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

Fn::GetAtt

A

Get attributes for your resources eg. AZ, Id, PrivateIp

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

Fn::FindInMap

A

Return a named value from a specific key

17
Q

Fn::ImportValue

A

Import values that are exported in other stacks

18
Q

Fn::Base64

A

Convert string to base64, used to pass encoded data to EC2’s UserData property

19
Q

In the case that stack creation fails …

A

Default is that everything rolls back (gets deleted), option to disable rollback and troubleshoot what happened

20
Q

Service role

A

IAM role that allows CloudFormation to create/update/delete stack resources on your behalf

21
Q

CAPABILITY_NAMED_IAM and CAPABILITY_IAM

A

Need to give to cloudformation when template is going to update IAM resources

22
Q

CAPABILITY_AUTO_EXPAND

A

Necessary when your CloudFormation template includes Macros of stacks within stacks

23
Q

InsufficientCapabilitiesException

A

Exception that will be thrown by CloudFormation if capabilities haven’t been acknowledged when deploying a template (security measure)

24
Q

DeletionPolicy

A

Control what happens when the CloudFormation template is deleted or when a resource is removed from a CloudFormation template

25
Default DeletionPolicy
DeletionPolicy=Delete
26
Will Delete work on S3 bucket that is not empty?
no
27
DeletionPolicy=Retain
Specify on resoures to preserve in case of CloudFormation deletes, works with any resources
28
DeletionPolicy=Snapshot
Create one final snapshot before deleting the resource
29
Stack Policy
JSON document that defines the update actions that are allowed on specific resources during Stack updates, protect resources from unintentional updates
30
Termination Protection
Prevents accidental deletes of CloudFormation Stacks
31
Custom Resources
Used to define resources not yet supported by CloudFormation, custom provisioning logic for resources outside of CloudFormation, custom scripts
32
Custom resource use case
Use custom resource to empty S3 bucket with lambda function so it can be deleted by CloudFormation
33
StackSets
Allow you to create, update or delete stacks across multiple accounts and regions with a single operation/template (only admin account can create)
34
Which section of a CloudFormation template cannot be associated with Condition?
Parameters
35
Exported Output Values in CloudFormation must have unique names within ...
a single Region