Skip to main content

Deploy Another App

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, station/1 and station/2, which both point to the same Terraform component components/terraform/weather.

NOTE:
The station/1 and station/2 naming convention doesn't have any inherent meaning. Atmos simply interprets them as two different strings. Feel free to use whatever format you prefer.
vars:
stage: dev

import:
# Import the baseline for all station components
- catalog/station

components:
terraform:
# Atmos component `station/1`
station/1:
metadata:
# Point to the Terraform component in `components/terraform/weather`
component: weather
description: "First weather station component"
# Inherit the defaults for all station components
inherits:
- station
# Define/override variables specific to this `station/1` component
vars:
name: station-1

# Atmos component `station/2`
station/2:
metadata:
# Point to the Terraform component in `components/terraform/weather`
component: weather
description: "Second weather station component"
# Inherit the defaults for all station components
inherits:
- station
# Define/override variables specific to this `station/2` component
vars:
name: station-2

In this example, we've included more information than necessary to demonstrate the concept. For instance, we explicitly added inherits to show how you can use multiple inheritance to merge multiple baseline configurations. We also specified the component path in both instances, even though it's already defined in the baseline configuration. This redundancy is just to emphasize that both are pointing to the same component.

Then we can deploy every component in the dev stack — including both stations — with the same bulk command you used in the main Quick Start:

atmos terraform deploy --all -s dev
NOTE:
Use a single-component command, such as atmos terraform plan station/1 -s dev, when you want to preview or operate on one specific instance.

Sweet! You’ve just finished your first Atmos QuickStart tutorial. Now you're at a crossroads with two options: you can continue to the bonus materials for some extra credit, or dive deeper into the core concepts and learn the Atmos Fundamentals.