Final Notes
Atmos provides unlimited flexibility in defining and configuring stacks and components in the stacks.
-
Terraform components can be in different sub-folders in the
components/terraformdirectory. The sub-folders can be organized by type, by teams that are responsible for the components, by operations that are performed on the components, or by any other category -
Atmos stack manifests can have arbitrary names and can be located in any sub-folder in the
stacksdirectory. Atmos stack filesystem layout is for people to better organize the stacks and make the configurations DRY. Atmos (the CLI) does not care about the filesystem layout, all it cares about is how to find the stacks and the components in the stacks by using the context variablesnamespace,tenant,environmentandstage -
An Atmos component can have any name that can be different from the Terraform component name. For example, two different Atmos components
s3-bucket/1ands3-bucket/2can provide configuration for the same Terraform components3-bucket -
We can provision more than one instance of the same Terraform component (with the same or different settings) into the same environment by defining many Atmos components that provide configuration for the Terraform component. For example, the following config shows how to define two Atmos components,
s3-bucket/1ands3-bucket/2, which both point to the same Terraform components3-bucket(see the Multiple Component Instances design pattern):import:- orgs/acme/plat/dev/_defaults- mixins/region/us-east-2# Import the defaults for all `s3-bucket` components- catalog/s3-bucket/defaultscomponents:terraform:# Atmos component `s3-bucket/1`s3-bucket/1:metadata:# Point to the Terraform component in `components/terraform/s3-bucket`component: s3-bucket# Inherit the defaults for all `s3-bucket` componentsinherits:- s3-bucket/defaults# Define/override variables specific to this `s3-bucket/1` componentvars:name: assets-1# Atmos component `s3-bucket/2`s3-bucket/2:metadata:# Point to the Terraform component in `components/terraform/s3-bucket`component: s3-bucket# Inherit the defaults for all `s3-bucket` componentsinherits:- s3-bucket/defaults# Define/override variables specific to this `s3-bucket/2` componentvars:name: assets-2Then we can execute the following
atmoscommands to provision the two buckets into thedevaccount in theus-east-2region:atmos terraform apply s3-bucket/1 -s plat-ue2-devatmos terraform apply s3-bucket/2 --stack plat-ue2-dev
All the above makes Atmos an ideal framework to organize infrastructure, to design for organizational complexity, and to provision multi-account environments for very complex organizations — and, as this tutorial showed, you can learn all of it offline against a local sandbox before pointing it at a real cloud account.