Hacker News new | ask | show | jobs
by dmlittle 2981 days ago
I'm not too familiar with using straight up CloudFormation JSON definitions. Are you able to create reusable modules in CloudFormation?

In Terraform you're able to create modules that you can use to setup uniform infrastructure. For example, you could have an RDS module that aside from setting up the database it also sets up a replica, a dedicated KMS encryption key, IAM policies, security groups, parameter groups, etc. So instead of setting all of this up for every database you have, you can just reuse a custom module that does all of this for you. These modules can also be versioned such that you can upgrade and change them as needed without breaking all your current infrastructure.

2 comments

Arguably you can create a stack that does this and exports the DB identifier to be used in other stacks. It doesn't sound as convenient though, and child stacks have some annoying limitations.
> Are you able to create reusable modules in CloudFormation?

Not out of the box but Cloudformation templates (jinja2) + Ansible works really well.