You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/basic/README.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,20 +57,23 @@ terraform apply
57
57
58
58
The `.github/workflows/` directory has ready-to-use GitHub Actions workflows:
59
59
60
-
-**`ci.yml`** — runs `terraform plan` on every PR and posts the plan as a comment
61
-
-**`cd.yml`** — runs `terraform apply` when changes merge to main
60
+
-**`ci.yml`** — formats check, validates, plans on every PR, and posts the plan as a comment
61
+
-**`cd.yml`** — applies on merge to main, with an optional approval gate via GitHub Environments
62
+
63
+
Terraform state is stored as an encrypted artifact in GitHub Actions — no remote backend required to get started.
62
64
63
65
Set these GitHub repository secrets (Settings > Secrets and variables > Actions):
64
66
65
67
```
66
68
DBT_ACCOUNT_ID numeric account ID
67
69
DBT_TOKEN dbt Cloud service token
68
70
ENVIRONMENT_CREDENTIALS JSON, e.g. {"analytics_prod":{"credential_type":"databricks","token":"dapi...","catalog":"main","schema":"analytics"}}
71
+
AES_256_ENCRYPTION_KEY random key used to encrypt the state artifact — generate with: openssl rand -hex 16
69
72
```
70
73
71
74
Optional secrets (omit if not used): `DBT_PAT`, `CONNECTION_CREDENTIALS`, `LINEAGE_TOKENS`, `OAUTH_CLIENT_SECRETS`.
72
75
73
-
Add a [Terraform backend](https://developer.hashicorp.com/terraform/language/backend) to `main.tf`before enabling CD so state is stored remotely.
76
+
> **When to graduate off artifact state:** artifact state works well for a single user or small team. When you need concurrent runs, state locking, or a more durable audit trail, add a [Terraform backend](https://developer.hashicorp.com/terraform/language/backend) to `main.tf`and remove the `badgerhobbs/terraform-state` steps from both workflow files.
0 commit comments