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/terraform
directory. 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
stacks
directory. 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
,environment
andstage
-
An Atmos component can have any name that can be different from the Terraform component name. For example, two different Atmos components
vpc/1
andvpc/2
can provide configuration for the same Terraform componentvpc
-
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,
vpc/1
andvpc/2
, which both point to the same Terraform componentvpc
:import:
- orgs/acme/plat/dev/_defaults
- mixins/region/us-east-2
# Import the defaults for all VPC components
- catalog/vpc/defaults
components:
terraform:
# Atmos component `vpc/1`
vpc/1:
metadata:
# Point to the Terraform component in `components/terraform/vpc`
component: vpc
# Inherit the defaults for all VPC components
inherits:
- vpc/defaults
# Define/override variables specific to this `vpc/1` component
vars:
name: vpc-1
ipv4_primary_cidr_block: 10.9.0.0/18
# Atmos component `vpc/2`
vpc/2:
metadata:
# Point to the Terraform component in `components/terraform/vpc`
component: vpc
# Inherit the defaults for all VPC components
inherits:
- vpc/defaults
# Define/override variables specific to this `vpc/2` component
vars:
name: vpc-2
ipv4_primary_cidr_block: 10.10.0.0/18Then we can execute the following
atmos
commands to provision the two VPCs into thedev
account in theus-east-2
region:atmos terraform apply vpc/1 -s plat-ue2-dev
atmos terraform apply vpc/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.