diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27ec4d2..009c982 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: fetch-depth: 0 - uses: sourceplane/orun-action@v1.2.0 with: - version: v2.20.0 + version: v2.39.0 - env: # Surface the best-effort catalog auto-sync (execution.state.autopushCatalog). # A successful push prints "✓ pushed catalog …"; ORUN_VERBOSE also makes @@ -79,7 +79,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - uses: sourceplane/orun-action@v1.2.0 with: - version: v2.20.0 + version: v2.39.0 - run: | orun run \ --plan plan.json \ @@ -90,11 +90,19 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # CLOUDFLARE_API_TOKEN is now an orun-managed brokered secret + # (secret://lumen/lumen//CLOUDFLARE_API_TOKEN, minted fresh per + # run from the Cloudflare integration): worker deploys receive it via + # the deploy profile's secretBindings, cloudflare-kv via its + # component secretEnv — the resolved value overrides this ambient one. + # The ambient copy remains ONLY for cloudflare-hyperdrive and + # cloudflare-domain, whose Terraform needs Hyperdrive/DNS permissions + # the workers-deploy broker template does not mint yet. Remove it when + # those two components migrate. CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} SUPABASE_API_KEY: ${{ secrets.SUPABASE_API_KEY }} SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_API_KEY }} - TF_VAR_cloudflare_api_token: ${{ secrets.CLOUDFLARE_API_TOKEN }} TF_VAR_cloudflare_account_id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} # Supabase org id is environment/account-specific, so it comes from a # CI secret rather than a committed component parameter. Used by the diff --git a/infra/terraform/cloudflare-domain/component.yaml b/infra/terraform/cloudflare-domain/component.yaml index c1a432a..b60145c 100644 --- a/infra/terraform/cloudflare-domain/component.yaml +++ b/infra/terraform/cloudflare-domain/component.yaml @@ -42,19 +42,28 @@ spec: dependsOn: - component: web-console-next + # PARKED — no environment subscriptions, so no jobs are planned. The zone + # this stack manages (baseDomain lumen.app) is not delegated to Cloudflare + # and does not exist in the connected account (the domain is parked at + # dns.ws — a rebrand artifact), so `data.cloudflare_zone.existing` fails + # every plan with "no zone found". Restore the subscribe block below once + # the zone exists in the account (and finish the 0085b v5 re-import). + # + # subscribe: + # environments: + # - name: stage + # profile: plan-only + # profileRules: + # - profile: apply + # when: + # triggerRef: github-push-main + # + # - name: prod + # profile: plan-only + # profileRules: + # - profile: apply + # when: + # triggerRef: github-push-main subscribe: - environments: - - name: stage - profile: plan-only - profileRules: - - profile: apply - when: - triggerRef: github-push-main - - - name: prod - profile: plan-only - profileRules: - - profile: apply - when: - triggerRef: github-push-main + environments: [] # ci: trigger full-component verification (orun v2.12.0 upgrade — PR #183) diff --git a/infra/terraform/cloudflare-domain/terraform/main.tf b/infra/terraform/cloudflare-domain/terraform/main.tf index bc5f20b..98dd5b9 100644 --- a/infra/terraform/cloudflare-domain/terraform/main.tf +++ b/infra/terraform/cloudflare-domain/terraform/main.tf @@ -34,9 +34,10 @@ provider "aws" { } } -provider "cloudflare" { - api_token = var.cloudflare_api_token -} +# Authenticates via the CLOUDFLARE_API_TOKEN env var (provider-native): the +# token is an orun-managed secret resolved into the job env at run time, so it +# never transits Terraform variables. +provider "cloudflare" {} # --- Variables (standard Orun parameters) --- @@ -45,13 +46,6 @@ variable "awsRegion" { default = "us-east-1" } -variable "cloudflare_api_token" { - type = string - sensitive = true - default = "" - description = "Cloudflare API token (from CLOUDFLARE_API_TOKEN env var)" -} - variable "cloudflare_account_id" { type = string sensitive = true diff --git a/infra/terraform/cloudflare-hyperdrive/terraform/main.tf b/infra/terraform/cloudflare-hyperdrive/terraform/main.tf index 8177494..0152882 100644 --- a/infra/terraform/cloudflare-hyperdrive/terraform/main.tf +++ b/infra/terraform/cloudflare-hyperdrive/terraform/main.tf @@ -34,10 +34,10 @@ provider "aws" { } } -# Authenticates via CLOUDFLARE_API_TOKEN env var -provider "cloudflare" { - api_token = var.cloudflare_api_token -} +# Authenticates via the CLOUDFLARE_API_TOKEN env var (provider-native): the +# token is an orun-managed secret resolved into the job env at run time, so it +# never transits Terraform variables. +provider "cloudflare" {} # --- Variables (standard Orun parameters) --- @@ -46,13 +46,6 @@ variable "awsRegion" { default = "us-east-1" } -variable "cloudflare_api_token" { - type = string - sensitive = true - default = "" - description = "Cloudflare API token with Hyperdrive permissions (from CLOUDFLARE_API_TOKEN env var)" -} - variable "cloudflare_account_id" { type = string sensitive = true diff --git a/infra/terraform/cloudflare-kv/README.md b/infra/terraform/cloudflare-kv/README.md index e2ed188..6f460f9 100644 --- a/infra/terraform/cloudflare-kv/README.md +++ b/infra/terraform/cloudflare-kv/README.md @@ -61,7 +61,6 @@ Standard Orun parameters (matching `cloudflare-hyperdrive`): | Name | Type | Default | Description | |---|---|---|---| | `awsRegion` | string | `us-east-1` | AWS region for Terraform state backend | -| `cloudflare_api_token` | string (sensitive) | `""` | From `CLOUDFLARE_API_TOKEN` env var | | `cloudflare_account_id` | string (sensitive) | `""` | From `CLOUDFLARE_ACCOUNT_ID` env var | | `orgName` | string | `lumen` | Org identifier | | `owner` | string | `lumen` | GitHub owner | diff --git a/infra/terraform/cloudflare-kv/component.yaml b/infra/terraform/cloudflare-kv/component.yaml index e1612ce..7e37f02 100644 --- a/infra/terraform/cloudflare-kv/component.yaml +++ b/infra/terraform/cloudflare-kv/component.yaml @@ -23,6 +23,12 @@ spec: env: AWS_EC2_METADATA_DISABLED: "true" + # The Cloudflare Terraform provider authenticates via the CLOUDFLARE_API_TOKEN + # env var, resolved by orun from the project-rung brokered secret (fresh per + # run, Deploy Workers scope). Declared at component level because plan-only + # lanes refresh against the live Cloudflare API too, not just apply. + secretEnv: + CLOUDFLARE_API_TOKEN: "secret://lumen/lumen/{{ .environment }}/CLOUDFLARE_API_TOKEN" subscribe: environments: diff --git a/infra/terraform/cloudflare-kv/terraform/main.tf b/infra/terraform/cloudflare-kv/terraform/main.tf index e51aae4..f01290b 100644 --- a/infra/terraform/cloudflare-kv/terraform/main.tf +++ b/infra/terraform/cloudflare-kv/terraform/main.tf @@ -34,10 +34,10 @@ provider "aws" { } } -# Authenticates via CLOUDFLARE_API_TOKEN env var -provider "cloudflare" { - api_token = var.cloudflare_api_token -} +# Authenticates via the CLOUDFLARE_API_TOKEN env var (provider-native): the +# token is an orun-managed secret resolved into the job env at run time, so it +# never transits Terraform variables. +provider "cloudflare" {} # --- Variables (standard Orun parameters) --- @@ -46,13 +46,6 @@ variable "awsRegion" { default = "us-east-1" } -variable "cloudflare_api_token" { - type = string - sensitive = true - default = "" - description = "Cloudflare API token with Workers KV permissions (from CLOUDFLARE_API_TOKEN env var)" -} - variable "cloudflare_account_id" { type = string sensitive = true diff --git a/intent.yaml b/intent.yaml index e593de6..859051d 100644 --- a/intent.yaml +++ b/intent.yaml @@ -31,7 +31,7 @@ compositions: # a commit here. Bumping the tag is the deliberate upgrade step. - name: stack-tectonic kind: oci - ref: oci://ghcr.io/sourceplane/stack-tectonic:0.13.0 + ref: oci://ghcr.io/sourceplane/stack-tectonic:0.14.0 resolution: precedence: - stack-tectonic