Skip to content

Commit 1c97277

Browse files
authored
chore: Replace Makefile with atmos.yaml (#105)
1 parent bbba2f3 commit 1c97277

File tree

4 files changed

+65
-93
lines changed

4 files changed

+65
-93
lines changed

Makefile

Lines changed: 0 additions & 6 deletions
This file was deleted.

README.yaml

Lines changed: 53 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
#
32
# This is the canonical configuration for the `README.md`
43
# Run `make readme` to rebuild the `README.md`
@@ -17,13 +16,17 @@ license: "APACHE2"
1716
github_repo: cloudposse/github-action-atmos-terraform-plan
1817

1918
badges:
20-
- name: "Latest Release"
21-
image: "https://img.shields.io/github/release/cloudposse/github-action-atmos-terraform-plan.svg"
22-
url: "https://github.com/cloudposse/github-action-atmos-terraform-plan/releases/latest"
23-
- name: "Slack Community"
24-
image: "https://slack.cloudposse.com/badge.svg"
25-
url: "https://slack.cloudposse.com"
26-
19+
- name: Latest Release
20+
image: https://img.shields.io/github/release/cloudposse/github-action-atmos-terraform-plan.svg?style=for-the-badge
21+
url: https://github.com/cloudposse/github-action-atmos-terraform-plan/releases/latest
22+
- name: Last Updated
23+
image: https://img.shields.io/github/last-commit/cloudposse/github-action-atmos-terraform-plan.svg?style=for-the-badge
24+
url: https://github.com/cloudposse/github-action-atmos-terraform-plan/commits
25+
- name: Slack Community
26+
image: https://slack.cloudposse.com/for-the-badge.svg
27+
url: https://cloudposse.com/slack
28+
29+
# List any related terraform modules that this module may be used with or that this module depends on.
2730
related: []
2831

2932
description: This Github Action is used to run Terraform plan for a single, Atmos-supported component and save the given planfile to S3 and DynamoDB.
@@ -62,15 +65,15 @@ usage: |-
6265
> If you are using `atmos < 1.63.0` please use `v1` version of this action.
6366
6467
The action expects the atmos configuration file `atmos.yaml` to be present in the repository.
65-
68+
6669
The action supports AWS and Azure to store Terraform plan files.
6770
You can read more about plan storage in the [cloudposse/github-action-terraform-plan-storage](https://github.com/cloudposse/github-action-terraform-plan-storage?tab=readme-ov-file#aws-default) documentation.
6871
Depending on the cloud provider, the following fields should be set in the `atmos.yaml`:
69-
72+
7073
#### AWS
71-
74+
7275
The config should have the following structure:
73-
76+
7477
```yaml
7578
integrations:
7679
github:
@@ -95,9 +98,9 @@ usage: |-
9598
```
9699
97100
#### Azure
98-
101+
99102
The config should have the following structure:
100-
103+
101104
```yaml
102105
integrations:
103106
github:
@@ -144,29 +147,29 @@ usage: |-
144147
plan: arn:aws:iam::yyyyyyyyyyyy:role/cptest-plat-gbl-identity-gitops
145148
apply: arn:aws:iam::yyyyyyyyyyyy:role/cptest-plat-gbl-identity-gitops
146149
```
147-
150+
148151
### Support OpenTofu
149-
152+
150153
This action supports [OpenTofu](https://opentofu.org/).
151-
154+
152155
> [!IMPORTANT]
153156
> **Please note!** OpenTofu supported by Atmos `>= 1.73.0`.
154157
> For details [read](https://atmos.tools/core-concepts/projects/configuration/opentofu/)
155-
158+
156159
To enable OpenTofu add the following settings to `atmos.yaml`
157160
* Set the `opentofu-version` in the `atmos.yaml` to the desired version
158161
* Set `components.terraform.command` to `tofu`
159-
162+
160163
#### Example
161-
164+
162165
```yaml
163-
166+
164167
components:
165168
terraform:
166169
command: tofu
167-
170+
168171
...
169-
172+
170173
integrations:
171174
github:
172175
gitops:
@@ -208,13 +211,13 @@ usage: |-
208211
```
209212
210213
### Migrating from `v4` to `v5`
211-
214+
212215
The notable changes in `v5` are:
213216
- `v5` works only with `atmos >= 1.158.0`
214217
- `v5` supports atnos `templates` and `functions`
215-
218+
216219
### Migrating from `v3` to `v4`
217-
220+
218221
The notable changes in `v4` are:
219222
220223
- `v4` works only with `atmos >= 1.99.0`
@@ -226,7 +229,7 @@ usage: |-
226229
The only required migration step is updating atmos version to `>= 1.99.0`
227230
228231
### Migrating from `v2` to `v3`
229-
232+
230233
The notable changes in `v3` are:
231234
232235
- `v3` use `actions/upload-artifact@v4` to share artifacts so it is not compatible with `cloudposse/github-action-atmos-terraform-drift-detection` `< v2.0.0`
@@ -236,23 +239,23 @@ usage: |-
236239
No special migration steps required
237240
238241
### Migrating from `v1` to `v2`
239-
242+
240243
The notable changes in `v2` are:
241244
242245
- `v2` works only with `atmos >= 1.63.0`
243246
- `v2` drops `install-terraform` input because terraform is not required for affected stacks call
244247
- `v2` drops `atmos-gitops-config-path` input and the `./.github/config/atmos-gitops.yaml` config file. Now you have to use GitHub Actions environment variables to specify the location of the `atmos.yaml`.
245-
248+
246249
The following configuration fields now moved to GitHub action inputs with the same names
247-
250+
248251
| name |
249252
|-------------------------|
250253
| `atmos-version` |
251254
| `atmos-config-path` |
252-
253-
255+
256+
254257
The following configuration fields moved to the `atmos.yaml` configuration file.
255-
258+
256259
| name | YAML path in `atmos.yaml` |
257260
|--------------------------|-------------------------------------------------|
258261
| `aws-region` | `integrations.github.gitops.artifact-storage.region` |
@@ -265,14 +268,14 @@ usage: |-
265268
| `enable-infracost` | `integrations.github.gitops.infracost-enabled` |
266269
| `sort-by` | `integrations.github.gitops.matrix.sort-by` |
267270
| `group-by` | `integrations.github.gitops.matrix.group-by` |
268-
269-
271+
272+
270273
For example, to migrate from `v1` to `v2`, you should have something similar to the following in your `atmos.yaml`:
271-
274+
272275
`./.github/config/atmos.yaml`
273276
```yaml
274277
# ... your existing configuration
275-
278+
276279
integrations:
277280
github:
278281
gitops:
@@ -290,7 +293,7 @@ usage: |-
290293
sort-by: .stack_slug
291294
group-by: .stack_slug | split("-") | [.[0], .[2]] | join("-")
292295
```
293-
296+
294297
`.github/workflows/main.yaml`
295298
```yaml
296299
- name: Plan Atmos Component
@@ -301,9 +304,9 @@ usage: |-
301304
atmos-config-path: ./rootfs/usr/local/etc/atmos/
302305
atmos-version: 1.63.0
303306
```
304-
307+
305308
This corresponds to the `v1` configuration (deprecated) below.
306-
309+
307310
The `v1` configuration file `./.github/config/atmos-gitops.yaml` looked like this:
308311
```yaml
309312
atmos-version: 1.45.3
@@ -319,9 +322,9 @@ usage: |-
319322
sort-by: .stack_slug
320323
group-by: .stack_slug | split("-") | [.[0], .[2]] | join("-")
321324
```
322-
325+
323326
And the `v1` GitHub Action Workflow looked like this.
324-
327+
325328
`.github/workflows/main.yaml`
326329
```yaml
327330
- name: Plan Atmos Component
@@ -333,7 +336,7 @@ usage: |-
333336
```
334337
335338
### Migrating from `v1` to `v2`
336-
339+
337340
1. `v2` drops the `component-path` variable and instead fetches if directly from the [`atmos.yaml` file](https://atmos.tools/cli/configuration/) automatically. Simply remove the `component-path` argument from your invocations of the `cloudposse/github-action-atmos-terraform-plan` action.
338341
2. `v2` moves most of the `inputs` to the Atmos GitOps config path `./.github/config/atmos-gitops.yaml`. Simply create this file, transfer your settings to it, then remove the corresponding arguments from your invocations of the `cloudposse/github-action-atmos-terraform-plan` action.
339342
| name |
@@ -348,10 +351,10 @@ usage: |-
348351
| `terraform-version` |
349352
| `aws-region` |
350353
| `enable-infracost` |
351-
352-
354+
355+
353356
If you want the same behavior in `v2` as in `v1` you should create config `./.github/config/atmos-gitops.yaml` with the same variables as in `v1` inputs.
354-
357+
355358
```yaml
356359
- name: Plan Atmos Component
357360
uses: cloudposse/github-action-atmos-terraform-plan@v1
@@ -360,9 +363,9 @@ usage: |-
360363
stack: "plat-ue2-sandbox"
361364
atmos-gitops-config-path: ./.github/config/atmos-gitops.yaml
362365
```
363-
366+
364367
Which would produce the same behavior as in `v1`, doing this:
365-
368+
366369
```yaml
367370
- name: Plan Atmos Component
368371
uses: cloudposse/github-action-atmos-terraform-plan@v1
@@ -376,14 +379,7 @@ usage: |-
376379
terraform-state-table: "acme-core-ue2-auto-gitops"
377380
aws-region: "us-east-2"
378381
```
379-
380382
381-
include:
382-
- "docs/github-action.md"
383383
384-
# Contributors to this project
385-
contributors:
386-
- name: "Erik Osterman"
387-
github: "osterman"
388-
- name: "Daniel Miller"
389-
github: "milldr"
384+
include: []
385+
contributors: []

atmos.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Atmos Configuration — powered by https://atmos.tools
2+
#
3+
# This configuration enables centralized, DRY, and consistent project scaffolding using Atmos.
4+
#
5+
# Included features:
6+
# - Organizational custom commands: https://atmos.tools/core-concepts/custom-commands
7+
# - Automated README generation: https://atmos.tools/cli/commands/docs/generate
8+
#
9+
10+
# Import shared configuration used by all modules
11+
import:
12+
- https://raw.githubusercontent.com/cloudposse/.github/refs/heads/main/.github/atmos/terraform-module.yaml

docs/github-action.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)