CloudFormation Flashcards
What is the Infrastructure as Code in AWS?
IaC
AWS CloudFormation
What does infrastructure as code mean?
Managing and provisioning data centers through machine readable definition files
Does CloudFormation cost anything to use?
No, The services it provisions does cost money.
Which 2 formats are supported for creating CloudFormation templates?
JSON
YAML
The section of a Cloudformation template that contains the AWS components being created
Resources
What is the minimum number of resources you can define in a CloudFormation template?
1
CloudFormation Templates requires you to at least list one resource.
Values that should be returned after deploying a CloudFormation template should be defined in what section?
Outputs
Values that returned eg. an ip-address of new server created.
Values that should be returned after deploying a CloudFormation template should be defined in what section?
Outputs
Values that returned eg. an ip-address of new server created.
A collection of CloudFormation templates ready to launch on AWS
AWS QuickStart
Who creates and provides AWS Quickstarts?
AWS solutions architects and 3rd party partners
The 3 types of Cloud Formation stack updates
Update with no interruption
Update with some interruption
Replacement
The 3 types of Cloud Formation stack updates
Update with no interruption (Without change resource’s physical ID)
Update with some interruption (Retain resource’s physical ID)
Replacement (It changes the resource’s physical ID)
What are 2 reasons that you might want to prevent stack updates?
Prevent data loss
Prevent interruption to service
What are 2 benefits of using NestedStacks?
Reduces complexity of larger templates
Makes templates more re-usable
When using NestedStacks where must you store the nested template files?
S3 Bucket
It’s a .template
This CloudFormation feature allows you to reference other templates inside your own template
Nested Stacks
ˈnɛstəd stæks
When creating a stack via the CLI which option would you provide to disable the automatic rollback feature?
–ignore-rollback
When you ___, ___ or ___, a stack, you can encounter and error and CloudFormation will attempt to rollback your stack to its previous state.
Eg.
Template Syntax Error
Try deleting a Resource which No longer exists
Create
Destroy
Update
In CloudFormation “Drift” is considered when this occurs
The current stacks configuration differs from what CloudFormation expects it to be
When detecting drift with NestedStacks where do you need to run the drift detection?
On each nested stack
What are common causes of drift in CloudFormation?
Two common causes
Deleting resources
Developers modifying resources directly
In Cloud Formation, What is when your stack’s actual configuration differs by what CloudFormation Expects.
Drift
It Has drifted
In CloudFormation you can use Pseudo Parameters, if you want to have the value “us-east-1” in your Template, what do you have to write?
!REF “ASW::Region”
Resource Attributes In CloudFormation allows you to add policies, what are some policies you can set?
There are 5
- CreationPolicy (Success signals)
- DeletionPolicy (If you delete an RDS, delete, retain, snapshot)
- UpdatePolicy (ASG, ECache, Lambda Alias)
- UpdateReplacePolicy (If you update an RDS, delete, retain…)
- DependsOn (Resources that depends on others)
CreationPolicy
Use this attribute when you want to wait on resource configuration actions before stack creation proceeds. For example, if you install and configure software applications on an EC2 instance, you might want those applications to be running before proceeding. In such cases, you can add a CreationPolicy attribute to the instance, and then send a success signal to the instance after the applications are installed and configured
DeletionPolicy
With this attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
UpdatePolicy
Use the UpdatePolicy attribute to specify how AWS CloudFormation handles updates to the
UpdateReplacePolicy
Use the UpdateReplacePolicy attribute to retain or (in some cases) backup the existing physical instance of a resource when it is replaced during a stack update operation.
DependsOn
With this attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute.