Hi, General question, what's the difference betwe...
# atmos
e
Hi, General question, what's the difference between aws modules and aws components? For example: https://docs.cloudposse.com/modules/library/aws/s3-bucket/ Vs https://docs.cloudposse.com/components/library/aws/s3-bucket/ Which one should I use?
e
Components are root modules and more opinionated than our child modules
The components you refer to are part of our commercial AWS reference architecture. You don't have to use our components 😃 and any root modules will work with atmos.
e
Thank you for your response. Would atmos work with the child modules as well? I still don't quite understand which one should I pick and what's the difference between them if they have the same resources mostly. What's the recommended approach of picking s3 or ec2 module over the similar component?
e
Yes of course, but make sure you understand the difference. Its not anything unique to atmos. https://atmos.tools/components/terraform https://developer.hashicorp.com/terraform/language/modules#the-root-module
A root module composes your Resources, including child modules
The root is at the “root”; it has state
Its were you would run “terraform”
A child module does not have a backend
In other words, a root module maintains state, a child module does not
a
Hey Elon! Modules are low-level Terraform building blocks used under the hood, while Componentsare ready-to-deploy root modules built for Atmos. Since you're in the
#atmos
channel — go with the Component. Just vendor it in and deploy! 🚀
e
1. I see, thank you! But I've encountered an issue. I see that in each
<http://provider.tf|provider.tf>
of a Terraform component, for example,
vpc
, there is a module called
iam_roles
which has the source
local: "../account-map/module/iam-roles"
. But I didn't have this module in my repo, so I added it to my
vendor.yaml
and pulled it to my repo. Then I tried to run it again and got an error:
Could not find the component account-map in the stack core-gbl-root.
So my questions are: 1. Why is this module referenced by a local path and not a remote path like the other modules? Because this way I have to manually reference it. 2. Do I have to use this module? It looks like an undocumented prerequisite. 3. Why does it expect this
core-gbl-root
stack that I don't have? 4. Is this behavior documented anywhere? Because it seems like a prerequisite for the component to work.