Cloud Formation Flashcards

(25 cards)

1
Q

Where does CloudFormation pull your templates from?

A

Amazon S3

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

What are the 7 components in a CloudFormation template?

A

AWS Template Format Version
Description
Resources
Parameters - Dynamic inputs
Mappings - Static inputs
Outputs
Conditionals

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

What are the 2 helpers for a CloudFormation template?

A

References
Functions

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

How is a resource type identifier structured in CloudFormation?

A

service-provider::service-name::data-type-name

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

Is it possible to create a dynamic number of resources in CloudFormation?

A

Yes you can by using Macros and Transform

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

Even though CloudFormation almost supports every AWS service, what is the standard workaround?

A

Using Custom Resources

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

What question should you ask yourself in a value should be a Paramter in CloudFormation?

A

Is this resource configuration likely to change in the future?

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

Suppose you want to limit what values can be inputed into a specific paramter in CloudFormation?

A

Allowed Values

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

Suppose there is a sensitive input that you would not like to appear in logs, what configuration should you place on the CloudFormation input?

A

No Echo

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

How do you use a paramater or resource (but not a condition) within a CloudFormation?

A

!Ref

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

What are Pseudo Paramters in CloudFormation?

A

Paramters provided by AWS with helpful reference values

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

What are Mappings in CloudFormation? How can you use a map in a template?

A

They are static values stored within a map that can be accessed using !FindInMap [Key1, Key2, Key3]

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

How would you share values between one CloudFormation template to another?

A

“Export” the name of the value as an “output” from one template and reference it in another using !ImportValue

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

What functions can you use to define a condition in CloudFormation?

A

Fn:And
Fn::Equals
Fn:If
Fn:Not
Fn::Or

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

Explain each of the following “Must know” intrinsic functions in CloudFormation:
- Ref
- Fn::GetAtt
- Fn::FindInMap
- Fn::ImportValue
- Condition Functions (Fn:If etc)

A
  • Ref : Used to ‘reference’ paramters or resources
  • Fn::GetAtt : Gets an attribute from an existing resource
  • Fn::FindInMap : Gets a named value from a specific key set in a map
  • Fn::ImportValue : Import values that were exported from an existing stack
  • Fn::Base64 : Converts string to Bas64 (Used to encode data like a UserData script for an EC2 instance.
  • Condition Functions (Fn:If etc) : Builds a condition
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the default behaviour of a failed CloudFormation deployment?

A

New stack: Everything gets deleted
Update fails: Rolled back to previously working state
Rollback fails: Fix template issues and use use ContinueUpdateRollback API to retrigger rollback

17
Q

How would you allow a user to create/update/delete stack resources even if they shouldnt have permission to work with the resources in the stack?

A

Give the user the iam:PassRole

18
Q

What capabilities should you enable to allow a CloudFormation template to create or update IAM resources?

A

CAPABILITY_NAMED_IAM and CAPABILITY_IAM

19
Q

What capabilities should you enable if your CloudFormation contains macros or nested stacks

A

CAPABILITY_AUTO_EXPAND

20
Q

How would you stop a resource from being deleted if its CloudFormation stack is? What if you just want the data within it?

A

Set deletion policy to retain or snapshot

21
Q

How can you prevent resources within a CloudFormation stack from being accidently modified?

A

Using Stack Policies to define what actions are allowed on specific reources

22
Q

Which of the following is the recommended way to define a custom resource in CloudFormation?
1. AWS::CloudFormation:CustomResource
2. Custom::MyCustomResourceTypeName

A
  1. Custom::MyCustomResourceTypeName
23
Q

Suppose you wanted to clear a S3 buckets upon deleting a Cloudformation stack (because otherwise it cant be deleted), how could you trigger this with Lambda?

A

Define a custom resource

24
Q

What does the CloudFormation custom resource ‘Servicetoken’ define?

A

A Lambda or SNS ARN

25
What CloudFormation feature would you use to update stacks across multiple accounts or regions with a single operation/template?
Stack Sets