In CloudFormation both nested stacks and modules encourage reusability by creating common components.
From the AWS documentation it is not coming out when to use what. Any suggestions?
In CloudFormation both nested stacks and modules encourage reusability by creating common components.
From the AWS documentation it is not coming out when to use what. Any suggestions?
On
The fundamental difference is that with a module you deploy a single stack for your productive resources whereas nested stack deploy 1 or many stacks at once, as the term "nested" suggests. I say "productive resources" to refer to the resources you actually want to deploy, excluding the overhead that comes with modules and nested stacks respectively.
The one thing modules and nested stacks have in common is that in both cases the underlying basic unit is just a regular stack.
Some key differences are:
MyOrganization::MyNamespace::MyApp::MODULE. A nested stack is created via resource type AWS::CloudFormation::Stack.TemplateURL).The official docs of AWS for CFN modules are quite sparse. The most comprehensible explanation of modules I found is this AWS blog post.
Here is good experimentation with the following conclusions:
So I think its better to stick with nested stacks, unless you have specific requirements to use modules.