A high-level introduction to two of my favourite AWS automation tools: CloudFormation and Sceptre
Why Infrastructure as Code?
We want the same things from our infrastructure as from our code:
- Version controlled
- Tested
- Reproducible
- Documented
CloudFormation
- YAML (or JSON…) templates
- Define AWS
Resources
- Configuration
Parameters
- Optional
Outputs
for further use
CloudFormation Basic Example Template
CloudFormation Basic Example Usage
This is not fun
So? Use a wrapper!
- Everyone realises they want a CloudFormation wrapper quickly
- Dozens to choose from!
Sceptre!
https://sceptre.cloudreach.com/
Convenient and unintrusive AWS wrapper
- Write CloudFormation templates as normal
- Add a small bit of directory structure
- Add some YAML configuration files
Sceptre Example Directory Structure
Sceptre Example Configuration
Sceptre Example Configuration
Sceptre Example Configuration
Sceptre Example Usage
CircleCI Example Configuration
Sceptre - What else?
- Manage CloudFormation Change Sets
- Connect Stacks together
- Source Parameters from external files, environment variables and more
- Configure hooks to run when Sceptre actions occur
Questions?
mail@doismellburning.co.uk