Skip to main content

atmos.atlantis

The atmos.atlantis function runs atmos atlantis through the current Atmos executable. Use it to generate the Atlantis repository configuration for your Atmos stacks and components from automation.

Usage​

atmos.atlantis(
*positionals,
flags = {},
args = [],
working_directory = ...,
env = ...,
output = "stream",
check = True,
)

Subcommands​

Pass the subcommand and any positional arguments as strings before the keyword arguments. The call atmos.atlantis("generate", "repo-config") runs atmos atlantis generate repo-config.

SubcommandPurpose
generateGenerate Atlantis configuration files.
generate repo-configGenerate the repository configuration file that Atlantis needs to manage Terraform projects.

See the atmos atlantis command reference for the complete list of subcommands and flags.

Arguments​

*positionals

(Optional) Strings placed on the command line right after atlantis, in order: the subcommand and its positional arguments, such as "generate", "repo-config". Every value must be a string.

flags

(Optional) A dictionary of command-line options; see flag translation. A bare key such as "config-template" becomes --config-template. Other flags for generate repo-config include --project-template, --affected-only, --stacks, --components, and --output-path. Flags such as --stacks take a comma-separated string, so pass "dev,prod" rather than a list.

args
(Optional) A list or tuple of strings appended after the flags.
working_directory, env, output, check

(Optional) See atmos.run for process options and defaults.

Options other than the positionals are keyword-only.

Returns​

A result with stdout, stderr, and exit_code. See atmos.run for output and error behavior.

Examples​

Generate the configuration for selected stacks​

atmos.atlantis(
"generate",
"repo-config",
flags = {
"config-template": "config-1",
"project-template": "project-1",
"stacks": "tenant1-ue2-staging,tenant1-ue2-prod",
"output-path": "atlantis.yaml",
},
)

The template names refer to the Atlantis templates defined in atmos.yaml.

Generate projects only for affected components​

atmos.atlantis(
"generate",
"repo-config",
flags = {
"config-template": "config-1",
"project-template": "project-1",
"affected-only": True,
"ref": "refs/heads/main",
"output-path": "atlantis.yaml",
},
)

This limits the generated projects to the components that changed compared with the main branch.