|
1 | | -# CLI config is loaded from the following locations (from lowest to highest priority): |
2 | | -# system dir ('/usr/local/etc/atmos' on Linux, '%LOCALAPPDATA%/atmos' on Windows) |
3 | | -# home dir (~/.atmos) |
4 | | -# current directory |
5 | | -# ENV vars |
6 | | -# Command-line arguments |
7 | | -# |
8 | | -# It supports POSIX-style Globs for file names/paths (double-star '**' is supported) |
9 | | -# https://en.wikipedia.org/wiki/Glob_(programming) |
10 | | - |
11 | | -# Base path for components, stacks and workflows configurations. |
12 | | -# Can also be set using 'ATMOS_BASE_PATH' ENV var, or '--base-path' command-line argument. |
13 | | -# Supports both absolute and relative paths. |
14 | | -# If not provided or is an empty string, 'components.terraform.base_path', 'components.helmfile.base_path', 'stacks.base_path' and 'workflows.base_path' |
15 | | -# are independent settings (supporting both absolute and relative paths). |
16 | | -# If 'base_path' is provided, 'components.terraform.base_path', 'components.helmfile.base_path', 'stacks.base_path' and 'workflows.base_path' |
17 | | -# are considered paths relative to 'base_path'. |
18 | | -base_path: "." |
19 | | - |
20 | | -components: |
21 | | - terraform: |
22 | | - # Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_BASE_PATH' ENV var, or '--terraform-dir' command-line argument |
23 | | - # Supports both absolute and relative paths |
24 | | - base_path: "components/terraform" |
25 | | - # Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_APPLY_AUTO_APPROVE' ENV var |
26 | | - apply_auto_approve: false |
27 | | - # Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_DEPLOY_RUN_INIT' ENV var, or '--deploy-run-init' command-line argument |
28 | | - deploy_run_init: true |
29 | | - # Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_INIT_RUN_RECONFIGURE' ENV var, or '--init-run-reconfigure' command-line argument |
30 | | - init_run_reconfigure: true |
31 | | - # Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_AUTO_GENERATE_BACKEND_FILE' ENV var, or '--auto-generate-backend-file' command-line argument |
32 | | - auto_generate_backend_file: false |
33 | | - helmfile: |
34 | | - # Can also be set using 'ATMOS_COMPONENTS_HELMFILE_BASE_PATH' ENV var, or '--helmfile-dir' command-line argument |
35 | | - # Supports both absolute and relative paths |
36 | | - base_path: "components/helmfile" |
37 | | - # Can also be set using 'ATMOS_COMPONENTS_HELMFILE_USE_EKS' ENV var |
38 | | - # If not specified, defaults to 'true' |
39 | | - use_eks: true |
40 | | - # Can also be set using 'ATMOS_COMPONENTS_HELMFILE_KUBECONFIG_PATH' ENV var |
41 | | - kubeconfig_path: "/dev/shm" |
42 | | - # Can also be set using 'ATMOS_COMPONENTS_HELMFILE_HELM_AWS_PROFILE_PATTERN' ENV var |
43 | | - helm_aws_profile_pattern: "{namespace}-gbl-{stage}-helm" |
44 | | - # Can also be set using 'ATMOS_COMPONENTS_HELMFILE_CLUSTER_NAME_PATTERN' ENV var |
45 | | - cluster_name_pattern: "{namespace}-{environment}-{stage}-eks-cluster" |
46 | | - |
47 | | -stacks: |
48 | | - # Can also be set using 'ATMOS_STACKS_BASE_PATH' ENV var, or '--config-dir' and '--stacks-dir' command-line arguments |
49 | | - # Supports both absolute and relative paths |
50 | | - base_path: "stacks" |
51 | | - # Can also be set using 'ATMOS_STACKS_INCLUDED_PATHS' ENV var (comma-separated values string) |
52 | | - included_paths: |
53 | | - - "orgs/**/*" |
54 | | - # Can also be set using 'ATMOS_STACKS_EXCLUDED_PATHS' ENV var (comma-separated values string) |
55 | | - excluded_paths: |
56 | | - - "**/_defaults.yaml" |
57 | | - # Can also be set using 'ATMOS_STACKS_NAME_PATTERN' ENV var |
58 | | - name_pattern: "{tenant}-{environment}-{stage}" |
59 | | - |
60 | | -workflows: |
61 | | - # Can also be set using 'ATMOS_WORKFLOWS_BASE_PATH' ENV var, or '--workflows-dir' command-line arguments |
62 | | - # Supports both absolute and relative paths |
63 | | - base_path: "stacks/workflows" |
64 | | - |
65 | | -logs: |
66 | | - verbose: false |
67 | | - colors: true |
68 | | - |
69 | | -templates: |
70 | | - settings: |
71 | | - enabled: true |
72 | | - sprig: |
73 | | - enabled: true |
74 | | - gomplate: |
75 | | - enabled: true |
76 | | - |
77 | | -# Custom CLI commands |
78 | | -commands: |
79 | | - - name: tf |
80 | | - description: Execute 'terraform' commands |
81 | | - # subcommands |
82 | | - commands: |
83 | | - - name: plan |
84 | | - description: This command plans terraform components |
85 | | - arguments: |
86 | | - - name: component |
87 | | - description: Name of the component |
88 | | - flags: |
89 | | - - name: stack |
90 | | - shorthand: s |
91 | | - description: Name of the stack |
92 | | - required: true |
93 | | - env: |
94 | | - - key: ENV_VAR_1 |
95 | | - value: ENV_VAR_1_value |
96 | | - - key: ENV_VAR_2 |
97 | | - # 'valueCommand' is an external command to execute to get the value for the ENV var |
98 | | - # Either 'value' or 'valueCommand' can be specified for the ENV var, but not both |
99 | | - valueCommand: echo ENV_VAR_2_value |
100 | | - # steps support Go templates |
101 | | - steps: |
102 | | - - atmos terraform plan {{ .Arguments.component }} -s {{ .Flags.stack }} |
103 | | - - name: terraform |
104 | | - description: Execute 'terraform' commands |
105 | | - # subcommands |
106 | | - commands: |
107 | | - - name: provision |
108 | | - description: This command provisions terraform components |
109 | | - arguments: |
110 | | - - name: component |
111 | | - description: Name of the component |
112 | | - flags: |
113 | | - - name: stack |
114 | | - shorthand: s |
115 | | - description: Name of the stack |
116 | | - required: true |
117 | | - # ENV var values support Go templates |
118 | | - env: |
119 | | - - key: ATMOS_COMPONENT |
120 | | - value: "{{ .Arguments.component }}" |
121 | | - - key: ATMOS_STACK |
122 | | - value: "{{ .Flags.stack }}" |
123 | | - steps: |
124 | | - - atmos terraform plan $ATMOS_COMPONENT -s $ATMOS_STACK |
125 | | - - atmos terraform apply $ATMOS_COMPONENT -s $ATMOS_STACK |
126 | | - - name: play |
127 | | - description: This command plays games |
128 | | - steps: |
129 | | - - echo Playing... |
130 | | - # subcommands |
131 | | - commands: |
132 | | - - name: hello |
133 | | - description: This command says Hello world |
134 | | - steps: |
135 | | - - echo Hello world |
136 | | - - name: ping |
137 | | - description: This command plays ping-pong |
138 | | - # If 'verbose' is set to 'true', atmos will output some info messages to the console before executing the command's steps |
139 | | - # If 'verbose' is not defined, it implicitly defaults to 'false' |
140 | | - verbose: true |
141 | | - steps: |
142 | | - - echo Playing ping-pong... |
143 | | - - echo pong |
144 | | - - name: show |
145 | | - description: Execute 'show' commands |
146 | | - # subcommands |
147 | | - commands: |
148 | | - - name: component |
149 | | - description: Execute 'show component' command |
150 | | - arguments: |
151 | | - - name: component |
152 | | - description: Name of the component |
153 | | - flags: |
154 | | - - name: stack |
155 | | - shorthand: s |
156 | | - description: Name of the stack |
157 | | - required: true |
158 | | - # ENV var values support Go templates and have access to {{ .ComponentConfig.xxx.yyy.zzz }} Go template variables |
159 | | - env: |
160 | | - - key: ATMOS_COMPONENT |
161 | | - value: "{{ .Arguments.component }}" |
162 | | - - key: ATMOS_STACK |
163 | | - value: "{{ .Flags.stack }}" |
164 | | - - key: ATMOS_TENANT |
165 | | - value: "{{ .ComponentConfig.vars.tenant }}" |
166 | | - - key: ATMOS_STAGE |
167 | | - value: "{{ .ComponentConfig.vars.stage }}" |
168 | | - - key: ATMOS_ENVIRONMENT |
169 | | - value: "{{ .ComponentConfig.vars.environment }}" |
170 | | - - key: ATMOS_IS_PROD |
171 | | - value: "{{ .ComponentConfig.settings.config.is_prod }}" |
172 | | - # If a custom command defines 'component_config' section with 'component' and 'stack', 'atmos' generates the config for the component in the stack |
173 | | - # and makes it available in {{ .ComponentConfig.xxx.yyy.zzz }} Go template variables, |
174 | | - # exposing all the component sections (which are also shown by 'atmos describe component' command) |
175 | | - component_config: |
176 | | - component: "{{ .Arguments.component }}" |
177 | | - stack: "{{ .Flags.stack }}" |
178 | | - # Steps support using Go templates and can access all configuration settings (e.g. {{ .ComponentConfig.xxx.yyy.zzz }}) |
179 | | - # Steps also have access to the ENV vars defined in the 'env' section of the 'command' |
180 | | - steps: |
181 | | - - 'echo Atmos component from argument: "{{ .Arguments.component }}"' |
182 | | - - 'echo ATMOS_COMPONENT: "$ATMOS_COMPONENT"' |
183 | | - - 'echo Atmos stack: "{{ .Flags.stack }}"' |
184 | | - - 'echo Terraform component: "{{ .ComponentConfig.component }}"' |
185 | | - - 'echo Backend S3 bucket: "{{ .ComponentConfig.backend.bucket }}"' |
186 | | - - 'echo Terraform workspace: "{{ .ComponentConfig.workspace }}"' |
187 | | - - 'echo Namespace: "{{ .ComponentConfig.vars.namespace }}"' |
188 | | - - 'echo Tenant: "{{ .ComponentConfig.vars.tenant }}"' |
189 | | - - 'echo Environment: "{{ .ComponentConfig.vars.environment }}"' |
190 | | - - 'echo Stage: "{{ .ComponentConfig.vars.stage }}"' |
191 | | - - 'echo settings.spacelift.workspace_enabled: "{{ .ComponentConfig.settings.spacelift.workspace_enabled }}"' |
192 | | - - 'echo Dependencies: "{{ .ComponentConfig.deps }}"' |
193 | | - - 'echo settings.config.is_prod: "{{ .ComponentConfig.settings.config.is_prod }}"' |
194 | | - - 'echo ATMOS_IS_PROD: "$ATMOS_IS_PROD"' |
195 | | - |
196 | | -# Integrations |
197 | | -integrations: |
198 | | - # Atlantis integration |
199 | | - # https://www.runatlantis.io/docs/repo-level-atlantis-yaml.html |
200 | | - atlantis: |
201 | | - # Path and name of the Atlantis config file 'atlantis.yaml' |
202 | | - # Supports absolute and relative paths |
203 | | - # All the intermediate folders will be created automatically (e.g. 'path: /config/atlantis/atlantis.yaml') |
204 | | - # Can be overridden on the command line by using '--output-path' command-line argument in 'atmos atlantis generate repo-config' command |
205 | | - # If not specified (set to an empty string/omitted here, and set to an empty string on the command line), the content of the file will be dumped to 'stdout' |
206 | | - # On Linux/macOS, you can also use '--output-path=/dev/stdout' to dump the content to 'stdout' without setting it to an empty string in 'atlantis.path' |
207 | | - path: "atlantis.yaml" |
208 | | - |
209 | | - # Config templates |
210 | | - # Select a template by using the '--config-template <config_template>' command-line argument in 'atmos atlantis generate repo-config' command |
211 | | - config_templates: |
212 | | - config-1: |
213 | | - version: 3 |
214 | | - automerge: true |
215 | | - delete_source_branch_on_merge: true |
216 | | - parallel_plan: true |
217 | | - parallel_apply: true |
218 | | - allowed_regexp_prefixes: |
219 | | - - dev/ |
220 | | - - staging/ |
221 | | - - prod/ |
222 | | - |
223 | | - # Project templates |
224 | | - # Select a template by using the '--project-template <project_template>' command-line argument in 'atmos atlantis generate repo-config' command |
225 | | - project_templates: |
226 | | - project-1: |
227 | | - # generate a project entry for each component in every stack |
228 | | - name: "{tenant}-{environment}-{stage}-{component}" |
229 | | - workspace: "{workspace}" |
230 | | - dir: "{component-path}" |
231 | | - terraform_version: v1.2 |
232 | | - delete_source_branch_on_merge: true |
233 | | - autoplan: |
234 | | - enabled: true |
235 | | - when_modified: |
236 | | - - "**/*.tf" |
237 | | - - "varfiles/$PROJECT_NAME.tfvars.json" |
238 | | - apply_requirements: |
239 | | - - "approved" |
240 | | - |
241 | | - # Workflow templates |
242 | | - # https://www.runatlantis.io/docs/custom-workflows.html#custom-init-plan-apply-commands |
243 | | - # https://www.runatlantis.io/docs/custom-workflows.html#custom-run-command |
244 | | - # Select a template by using the '--workflow-template <workflow_template>' command-line argument in 'atmos atlantis generate repo-config' command |
245 | | - workflow_templates: |
246 | | - workflow-1: |
247 | | - plan: |
248 | | - steps: |
249 | | - - run: terraform init -input=false |
250 | | - # When using workspaces, you need to select the workspace using the $WORKSPACE environment variable |
251 | | - - run: terraform workspace select $WORKSPACE || terraform workspace new $WORKSPACE |
252 | | - # You must output the plan using '-out $PLANFILE' because Atlantis expects plans to be in a specific location |
253 | | - - run: terraform plan -input=false -refresh -out $PLANFILE -var-file varfiles/$PROJECT_NAME.tfvars.json |
254 | | - apply: |
255 | | - steps: |
256 | | - - run: terraform apply $PLANFILE |
257 | | - |
258 | | -# Validation schemas (for validating atmos stacks and components) |
259 | | -schemas: |
260 | | - # https://json-schema.org |
261 | | - jsonschema: |
262 | | - # Can also be set using 'ATMOS_SCHEMAS_JSONSCHEMA_BASE_PATH' ENV var, or '--schemas-jsonschema-dir' command-line arguments |
263 | | - # Supports both absolute and relative paths |
264 | | - base_path: "stacks/schemas/jsonschema" |
265 | | - # https://www.openpolicyagent.org |
266 | | - opa: |
267 | | - # Can also be set using 'ATMOS_SCHEMAS_OPA_BASE_PATH' ENV var, or '--schemas-opa-dir' command-line arguments |
268 | | - # Supports both absolute and relative paths |
269 | | - base_path: "stacks/schemas/opa" |
270 | | - # https://cuelang.org |
271 | | - cue: |
272 | | - # Can also be set using 'ATMOS_SCHEMAS_CUE_BASE_PATH' ENV var, or '--schemas-cue-dir' command-line arguments |
273 | | - # Supports both absolute and relative paths |
274 | | - base_path: "stacks/schemas/cue" |
| 1 | +import: |
| 2 | + - https://raw.githubusercontent.com/cloudposse/.github/refs/heads/main/.github/atmos/github-action.yaml |
0 commit comments