CloudFormation Physical and Logical Resources Flashcards
The “What” in a CloudFormation Template
Logical Resources
What CloudFormation templates are used to create
Stacks
Creates physical resources from the logical resources which can be updated or deleted
Stacks
If you delete a stack are the logical resources deleted?
Yes
If the logical resources are deleted in a CloudFormation Stack and the physical resources deleted?
Yes
Parameters that accept input from console/cli/api when a stack is created or updated
Template Parameters
Parameters that are made by AWS based on the environment when creating the stack which can be referenced
Pseudo Parameters
Function which allows you to reference a value from one logical resource or parameter in another one
!Ref & Fn::GetAtt
Function which allows you to join strings together or split them
Fn::Join & Fn::Split
Function which can be used to get a list of availability zones for a given AWS region
FN::GetAZs
Function which allows you to select one element from list of Availible AZs
Fn::Select
Function used to provision resources based on conditional checks
Fn:: IF, And, Equals, Not, Or
Function used to accept non-encoded text and outputs base64 encoded text that can be provided to the resource
Fn::Base64
Function that allows you to substitute things within text based on runtime information
Fn::Sub
Function used to automatically configure the network ranges subnets use within a ClouDFormation template
Fn:Cidr
Function used to retrieve any attribute associated with the resource
!GetAtt
Object within a template which maps keys to values allowing lookup
CloudFormation Mappings
Function which are used to retrieve a given amazon machine image ID
!FindInMap
declares output values that you can import into other stacks, return in response, or view on the AWS CloudFormation Console
Outputs
statements that define the circumstances under which entities are created or configured, evaluated based on predefined pseudo parameters or input parameter values that you specify when you create or update a stack
Conditions
attribute you can specify that the creation of a specific resource follows another and ensure that the resource is created only after the creation of the resource specified
DependsOn
can be used together to prevent the status if a resource from reaching create complete until AWS CloudFormation receives a specified number of success signals or the timeout period is exceeded
CreationPolicy, WaitConditions and cfn-signal
stacks that allow for a hierarchy of related templates to be combined to form a single product used to overcome the resource limit of one stack when everything created is lifecycle linked
Nested Stack
stacks that create modular templates which allow code to be reused
Nested Stack
Allow one stack to reference another. Outputs in one stack reference logical resources or attributes in that stack can be used in another stack
Cross stack references
Can be used to reference exported values from one stack into another stack
!ImportValue
Feature of CloudFormation allowing infrastructure to be deployed and managed across multiple regions and multiple accounts from a single location
StackSets
Reference to stacks running in specific regions in specific AWS accounts (Container for an individual stack)
Stack Instances
Accounts that stack sets target to deploy resources into
Target Accounts
Defines how many individual AWS accounts stacks are being deployed into at one time (If you have 10 accounts and set the value to 2, then 2 deployments will happen to 2 accounts 5 times)
Concurrent accounts
Defines the amount of individual deployments that can fail before the stack set is viewed as failed
Failure Tolerance
Allows you to remove stack instances or stacks from a target account by default when deleting stack instances stacks are deleted but can be toggled to be retained
Retain Stacks
attribute you can preserve or (in some cases) backup each resource when its stack is deleted
Deletion Policy
Allows an IAM role to be passed into the stack via PassRole, A stack uses this role, rather than the identity interacting with the stack to create, update and delete AWS resources
Stack Role
Tools which allow a desired state configuration management system to be implemented within CloudFormation that are stored within templates
CloudFormationInit
helper tool that detects changes in resource metadata and runs user-specified actions when a change is detected
cfn-hup helper
allow you to preview how proposed changes to a stack might impact your running resources, for example, whether your changes will delete or replace any critical resources
ChangeSets
enable you to write custom provisioning logic in templates that AWS CloudFormation runs anytime you create, update (if you changed the custom resource), or delete stacks
Custom Resources