Demo of several ways to set up cloudformation stacks. This sets up a minimal stack which is then later divided to show multiple ways of slicing and dicing stacks. Remember that this will incur costs and also remember to tear down the resources later!
- python
- aws cli (pip install)
- sceptre cli (pip install)
- GNU make
- export AWS_PROFILE=<profile_with_permissions_to_create_resources> into your environment
- access to AWS web console to view all the different stacks and resources
-
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html
-
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html
This one sets up security group and instance in one simple template.
- Change into dir
- Check and use the make targets
Two independent stacks are created, with the one stack exporting a value that the other one imports to make use of it in a dynamic way
- Change into dir
- Check and use the make targets
The two formerly independent stacks are now orchestrated by a master-stack and handeled as nested stacks
- Change into dir
- Check and use the make targets
- S3-bucket is hardcoded, please change to your own needs if needed
Usage of sceptre to set up a dev environment of independent stacks. The dependencies are not managed by CloudFormation anymore, but by sceptre.
Make sure you export your AWS_DEFAULT_REGION into the environment, because the config is set up to take it from there. Example:
export AWS_DEFAULT_REGION=eu-west-1
Then launch and delete envs:
sceptre --var-file config/vars.yaml launch-env dev
sceptre --var-file config/vars.yaml delete-env dev