Skip to content

ci: plan cluster/scaleway via the org-wide s3-lister role over OIDC#34

Merged
nbrieussel merged 3 commits into
mainfrom
ci/scaleway-plan-via-s3-lister
Jun 15, 2026
Merged

ci: plan cluster/scaleway via the org-wide s3-lister role over OIDC#34
nbrieussel merged 3 commits into
mainfrom
ci/scaleway-plan-via-s3-lister

Conversation

@nbrieussel

Copy link
Copy Markdown
Contributor

Context

Goal: a GitHub Action that reproduces, in CI, what we validated by hand — assume the org-wide s3-lister IAM role and run a terraform plan of cluster/scaleway. Per design, the role is assumed directly via GitHub OIDC (no routing through the bootstrap CI role, whose sole job is creating/updating roles).

Changes

s3-lister-role/ — make the role directly OIDC-assumable, org-wide

  • Add a federated GitHub-OIDC trust statement (sts:AssumeRoleWithWebIdentity, sub StringLike repo:IntegratedDynamic/*) via the module's enable_github_oidc + oidc_wildcard_subjects. Any repo in the GitHub org can assume it keylessly.
  • The existing aws:PrincipalOrgID trust is kept — both doors coexist.
  • use_name_prefix = false → stable name s3-lister / stable ARN (one-time role replacement, applied by s3-lister-role.yml).

.github/workflows/scaleway-plan.yml — the new workflow

  • OIDC → assume s3-lister directly → terraform init + plan on cluster/scaleway.
  • Shaped by the read-only role: plan-only, -lock=false, TF_WORKSPACE=infrastructure (existing workspace, no write), bootstrap_argocd=false (no Infisical/in-cluster providers in CI).
  • Scaleway refresh uses the static SCW_* creds from secrets (Scaleway is not an OIDC relying party).
  • Triggers: PR on cluster/scaleway/**, s3-lister-role/**, the workflow file + workflow_dispatch.

Also set repo variable AWS_S3_LISTER_ROLE_ARN to the stable ARN.

Notes / review points

  • issue: First-PR sequencing — the trust change + role rename are applied by s3-lister-role.yml; ordering vs scaleway-plan on this same PR isn't guaranteed, so the plan job may fail on the very first run (trust not yet applied). Re-run after the apply completes.
  • thought: CI plan is bootstrap_argocd=false (cluster infra only), unlike the full local plan — a deliberate trade-off given the read-only role + no Infisical creds in CI.

Test

  • terraform validate (s3-lister-role) ✓, actionlint
  • terraform plan on s3-lister-role confirms the GithubOidcAuth statement + name change
  • Manual end-to-end (assume role → plan -lock=false on cluster/scaleway) succeeded: 8 to add, 0 to change, 0 to destroy

Nicolas Brieussel and others added 2 commits June 15, 2026 16:08
Add a federated GitHub-OIDC trust statement (sts:AssumeRoleWithWebIdentity,
sub StringLike repo:IntegratedDynamic/*) so any repo in the GitHub org can
assume the role keylessly — without routing through the bootstrap CI role.
The existing aws:PrincipalOrgID trust is kept (the two doors coexist).

Set use_name_prefix=false so the role name is exactly `s3-lister` and its ARN
is stable enough to name in configure-aws-credentials. Forces a one-time role
replacement, applied by the existing s3-lister-role.yml workflow.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New workflow that assumes the org-wide s3-lister role DIRECTLY via GitHub OIDC
and runs a terraform plan of cluster/scaleway. The role is read-only on S3, so
the job is plan-only, -lock=false, selects the existing `infrastructure`
workspace via TF_WORKSPACE (no `workspace new` write), and sets
bootstrap_argocd=false (no Infisical/in-cluster providers in CI). Scaleway API
refresh uses the static SCW key from secrets (Scaleway is not an OIDC RP).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The infisical provider configures (and authenticates) eagerly even with
bootstrap_argocd=false, because the gated data source still pulls it into the
graph. Feed valid creds via TF_VAR_infisical_client_id/secret (scaleway-env
secrets) so the provider configures; no secret is read while bootstrap is off.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@nbrieussel
nbrieussel marked this pull request as ready for review June 15, 2026 14:37
@nbrieussel
nbrieussel merged commit e27a8a5 into main Jun 15, 2026
5 checks passed
@nbrieussel
nbrieussel deleted the ci/scaleway-plan-via-s3-lister branch June 15, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant