Skip to content

Commit 89bd6d9

Browse files
authored
chore: Replace Makefile with atmos.yaml (#73)
1 parent 2d7e667 commit 89bd6d9

File tree

4 files changed

+66
-85
lines changed

4 files changed

+66
-85
lines changed

Makefile

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

README.yaml

Lines changed: 54 additions & 54 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-apply
1817

1918
badges:
20-
- name: "Latest Release"
21-
image: "https://img.shields.io/github/release/cloudposse/github-action-atmos-terraform-apply.svg"
22-
url: "https://github.com/cloudposse/github-action-atmos-terraform-apply/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-apply.svg?style=for-the-badge
21+
url: https://github.com/cloudposse/github-action-atmos-terraform-apply/releases/latest
22+
- name: Last Updated
23+
image: https://img.shields.io/github/last-commit/cloudposse/github-action-atmos-terraform-apply.svg?style=for-the-badge
24+
url: https://github.com/cloudposse/github-action-atmos-terraform-apply/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 apply for a single, Atmos-supported component with a saved planfile in S3 and DynamoDB.
@@ -68,15 +71,15 @@ usage: |-
6871
> If you are using `atmos < 1.63.0` please use `v1` version of this action.
6972
7073
The action expects the atmos configuration file `atmos.yaml` to be present in the repository.
71-
74+
7275
The action supports AWS and Azure to store Terraform plan files.
7376
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.
7477
Depends of cloud provider the following fields should be set in the `atmos.yaml`:
75-
78+
7679
#### AWS
77-
80+
7881
The config should have the following structure:
79-
82+
8083
```yaml
8184
integrations:
8285
github:
@@ -99,9 +102,9 @@ usage: |-
99102
```
100103
101104
#### Azure
102-
105+
103106
The config should have the following structure:
104-
107+
105108
```yaml
106109
integrations:
107110
github:
@@ -150,27 +153,27 @@ usage: |-
150153
```
151154
152155
### Support OpenTofu
153-
156+
154157
This action supports [OpenTofu](https://opentofu.org/).
155-
158+
156159
> [!IMPORTANT]
157160
> **Please note!** OpenTofu supported by Atmos `>= 1.73.0`.
158161
> For details [read](https://atmos.tools/core-concepts/projects/configuration/opentofu/)
159-
162+
160163
To enable OpenTofu add the following settings to `atmos.yaml`
161164
* Set the `opentofu-version` in the `atmos.yaml` to the desired version
162165
* Set `components.terraform.command` to `tofu`
163-
166+
164167
#### Example
165-
168+
166169
```yaml
167-
170+
168171
components:
169172
terraform:
170173
command: tofu
171-
174+
172175
...
173-
176+
174177
integrations:
175178
github:
176179
gitops:
@@ -181,7 +184,7 @@ usage: |-
181184
### Workflow example
182185
183186
In this example, the action is triggered when certain events occur, such as a manual workflow dispatch or the opening, synchronization, or reopening of a pull request, specifically on the main branch. It specifies specific permissions related to assuming roles in AWS. Within the "apply" job, the "component" and "stack" are hardcoded (`foobar` and `plat-ue2-sandbox`). In practice, these are usually derived from another action.
184-
187+
185188
> [!TIP]
186189
We recommend combining this action with the [`affected-stacks`](https://atmos.tools/integrations/github-actions/affected-stacks) GitHub Action inside a matrix to plan all affected stacks in parallel.
187190
@@ -213,14 +216,14 @@ usage: |-
213216
atmos-config-path: ./rootfs/usr/local/etc/atmos/
214217
```
215218
### Migrating from `v3` to `v4`
216-
219+
217220
The notable changes in `v4` are:
218221
219222
- `v4` works only with `atmos >= 1.158.0`
220223
- `v4` supports atnos `templates` and `functions`
221224
222225
### Migrating from `v2` to `v3`
223-
226+
224227
The notable changes in `v3` are:
225228
226229
- `v3` works only with `atmos >= 1.99.0`
@@ -231,23 +234,23 @@ usage: |-
231234
The only required migration step is updating atmos version to `>= 1.99.0`
232235
233236
### Migrating from `v1` to `v2`
234-
237+
235238
The notable changes in `v2` are:
236-
239+
237240
- `v2` works only with `atmos >= 1.63.0`
238241
- `v2` drops `install-terraform` input because terraform is not required for affected stacks call
239242
- `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`.
240-
243+
241244
The following configuration fields now moved to GitHub action inputs with the same names
242-
245+
243246
| name |
244247
|-------------------------|
245248
| `atmos-version` |
246249
| `atmos-config-path` |
247-
248-
250+
251+
249252
The following configuration fields moved to the `atmos.yaml` configuration file.
250-
253+
251254
| name | YAML path in `atmos.yaml` |
252255
|--------------------------|-------------------------------------------------|
253256
| `aws-region` | `integrations.github.gitops.artifact-storage.region` |
@@ -260,14 +263,14 @@ usage: |-
260263
| `enable-infracost` | `integrations.github.gitops.infracost-enabled` |
261264
| `sort-by` | `integrations.github.gitops.matrix.sort-by` |
262265
| `group-by` | `integrations.github.gitops.matrix.group-by` |
263-
264-
266+
267+
265268
For example, to migrate from `v1` to `v2`, you should have something similar to the following in your `atmos.yaml`:
266-
269+
267270
`./.github/config/atmos.yaml`
268271
```yaml
269272
# ... your existing configuration
270-
273+
271274
integrations:
272275
github:
273276
gitops:
@@ -285,7 +288,7 @@ usage: |-
285288
sort-by: .stack_slug
286289
group-by: .stack_slug | split("-") | [.[0], .[2]] | join("-")
287290
```
288-
291+
289292
`.github/workflows/main.yaml`
290293
```yaml
291294
- name: Plan Atmos Component
@@ -296,11 +299,11 @@ usage: |-
296299
atmos-config-path: ./rootfs/usr/local/etc/atmos/
297300
atmos-version: 1.63.0
298301
```
299-
302+
300303
This corresponds to the `v1` configuration (deprecated) below.
301-
304+
302305
The `v1` configuration file `./.github/config/atmos-gitops.yaml` looked like this:
303-
306+
304307
```yaml
305308
atmos-version: 1.45.3
306309
atmos-config-path: ./rootfs/usr/local/etc/atmos/
@@ -315,9 +318,9 @@ usage: |-
315318
sort-by: .stack_slug
316319
group-by: .stack_slug | split("-") | [.[0], .[2]] | join("-")
317320
```
318-
321+
319322
And the `v1` GitHub Action Workflow looked like this.
320-
323+
321324
`.github/workflows/main.yaml`
322325
```yaml
323326
- name: Plan Atmos Component
@@ -327,9 +330,9 @@ usage: |-
327330
stack: "plat-ue2-sandbox"
328331
atmos-gitops-config-path: ./.github/config/atmos-gitops.yaml
329332
```
330-
333+
331334
### Migrating from `v0` to `v1`
332-
335+
333336
1. `v1` 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-apply` action.
334337
2. `v1` 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-apply` action.
335338
@@ -345,10 +348,10 @@ usage: |-
345348
| `terraform-version` |
346349
| `aws-region` |
347350
| `enable-infracost` |
348-
349-
351+
352+
350353
If you want the same behavior in `v1` as in `v0` you should create config `./.github/config/atmos-gitops.yaml` with the same variables as in `v0` inputs.
351-
354+
352355
```yaml
353356
- name: Terraform apply
354357
uses: cloudposse/github-action-atmos-terraform-apply@v1
@@ -357,9 +360,9 @@ usage: |-
357360
component: "foobar"
358361
stack: "plat-ue2-sandbox"
359362
```
360-
363+
361364
Which would produce the same behavior as in `v0`, doing this:
362-
365+
363366
```yaml
364367
- name: Terraform apply
365368
uses: cloudposse/github-action-atmos-terraform-apply@v0
@@ -374,8 +377,5 @@ usage: |-
374377
aws-region: "us-east-2"
375378
```
376379
377-
include:
378-
- "docs/github-action.md"
379-
380-
# Contributors to this project
381-
contributors:
380+
include: []
381+
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 & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)