IaC (CFN) Flashcards
What’s the difference between CloudFormation logical and physical resources?
Logical - The resource as defined in a CFN template.
Physical - The actual resources created when a template is applied.
What are CFN stacks?
Organizational units for physical resources with a logical boundary - they are isolated and self-contained by default.
What is the importance of DependsOn?
Many resources have implicit dependencies (in terms of create order) that CFN can auto-detect, especially in the presence of !Refs.
DependsOn allows the specification of explicit dependencies that CFN cannot auto-detect, such as an ElasticIP resource.
What is the CFN Stack resource limit?
500.
What are some other limits of CFN stacks and templates that Nested Stacks can help with?
- Shared lifecycle.
- Can’t easily reference other stacks.
- Can’t easily reuse resources like VPCs.
What CFN directive is used by stacks to reference each other?
The Outputs directive, which can be referenced or used as parameters for other templates/stacks.
What is the main difference between Cross-Stack References and Nested Stacks?
Nested stacks are for lifecycle-linked resources and help with code (template) re-use, NOT with resource re-use or sharing.
What CFN Directives are useful for Cross-Stack References?
Export, inside a single Output, paired with !ImportValue.
What are CFN StackSets?
Containers for Stack Instances (which themselves reference actual Stacks), and used to deploy Stacks across many Accounts and Regions.
What are the uses of a CFN DeletionPolicy?
By default, CFN deletes physical resources when the logical resource is deleted. DeletionPolicies can instruct CFN to either Retain or Snapshot the physical resources, depending on individual resource support for these actions.
What is the purpose of CFN Stack Roles?
Used for role separation, where a user with Stack-based access can pass an IAM Role to CFN that itself has the permissions to CRUD the resources.
What is CloutFormationInit?
A system to describe a desired state for EC2 instances, as an alternative to defining procedural steps in the user-data. Is idempotent.
What’s the use case for cfn-hup?
This helper daemon can detect changes in resource metadata and run configuration actions.
Is user-data, even when parameterized, re-applied during stack updates?
No. The user-data is run only once, when the stack and physical resources are first created.
Where is the output of the user-data process captured on the EC2 instance (Linux)?
In the /var/log/cloud-init-output.log file.