Skip to content

Commit a714a60

Browse files
authored
docs: add yaml anchors (#2898)
1 parent b06e3f2 commit a714a60

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

runatlantis.io/docs/repo-level-atlantis-yaml.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ need to be defined.
4343
:::
4444

4545
## Example Using All Keys
46+
4647
```yaml
4748
version: 3
4849
automerge: true
@@ -81,6 +82,35 @@ allowed_regexp_prefixes:
8182
- staging/
8283
```
8384
85+
## Example of DRYing up projects using YAML anchors
86+
87+
```yaml
88+
projects:
89+
- &template
90+
name: template
91+
workflow: custom
92+
autoplan:
93+
enabled: true
94+
when_modified:
95+
- "./terraform/modules/**/*.tf"
96+
- "**/*.tf"
97+
98+
- <<: *template
99+
name: ue1-prod-titan
100+
dir: ./terraform/titan
101+
workspace: ue1-prod
102+
103+
- <<: *template
104+
name: ue1-stage-titan
105+
dir: ./terraform/titan
106+
workspace: ue1-stage
107+
108+
- <<: *template
109+
name: ue1-dev-titan
110+
dir: ./terraform/titan
111+
workspace: ue1-dev
112+
```
113+
84114
## Auto generate projects
85115
86116
This is useful if you have many projects in a repository. This assumes the `default` workspace (or no workspace).

0 commit comments

Comments
 (0)