Skip to content

feat(03-backup): Scaleway backup S3 bucket foundation#41

Merged
nbrieussel merged 5 commits into
mainfrom
feat/03-backup-s3-foundation
Jun 21, 2026
Merged

feat(03-backup): Scaleway backup S3 bucket foundation#41
nbrieussel merged 5 commits into
mainfrom
feat/03-backup-s3-foundation

Conversation

@nbrieussel

Copy link
Copy Markdown
Contributor

Summary

Stacked on #40 (Spec Kit setup) — merge that first.

  • New Terraform root 03-backup/scaleway/ — Object Storage bucket with AES-256 SSE, versioning, configurable lifecycle rules (retention, noncurrent expiry, GLACIER transition), and a scoped workload IAM identity
  • Extends 01-iam/bootstrap/scaleway with ObjectStorage + IAM management permissions for the github-ci identity
  • CI workflow backup_scaleway.yml: plan on PR, apply on push to main, no scheduled destroy (FR-013)
  • Workload credentials written to Infisical /backup/ for future ESO consumption
  • Lifecycle validation gate (FR-016): terraform plan fails if cold_storage_transition_days >= retention_days
  • prevent_destroy = true protects bucket from Terraform-level destruction (Scaleway bucket policies do not support s3:DeleteBucket)

Test plan

  • CI plan job passes on this PR
  • scw object bucket get backup-dev-id --region fr-par returns bucket metadata (verified locally)
  • On merge → apply job + post-apply scw object bucket get check passes

🤖 Generated with Claude Code

Base automatically changed from chore/spec-kit-setup to main June 21, 2026 01:23
Nicolas Brieussel and others added 2 commits June 21, 2026 03:27
Provisions a Scaleway Object Storage bucket with independent lifecycle from
the cluster, scoped workload credentials, configurable retention/lifecycle
rules, and a dedicated CI workflow (plan on PR, apply on push, no destroy).

- 03-backup/scaleway/: new Terraform root (bucket + SSE + IAM workload
  identity + Infisical secret storage + lifecycle rules)
- 01-iam/bootstrap/scaleway: extend github-ci with ObjectStorage +
  IAMApplicationManager + IAMPolicyManager permissions
- .github/workflows/backup_scaleway.yml: CI workflow, no scheduled destroy
- Spec Kit artifacts: spec, plan, research, data-model, tasks, quickstart

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nbrieussel
nbrieussel force-pushed the feat/03-backup-s3-foundation branch from 48e4dce to cfa6fc3 Compare June 21, 2026 01:28
Comment thread 03-backup/scaleway/iam.tf Outdated
Comment thread .github/workflows/backup_scaleway.yml Outdated
Comment thread .github/workflows/backup_scaleway.yml Outdated
Comment thread .github/workflows/backup_scaleway.yml Outdated
Comment thread .github/workflows/backup_scaleway.yml Outdated
Comment thread .github/workflows/backup_scaleway.yml
Comment thread 01-iam/bootstrap/scaleway/main.tf Outdated
Comment thread 03-backup/scaleway/main.tf
- Rename IAM resources workload → kubernetes (reflects the k8s workload
  context for the backup identity, not a generic machine identity)
- Workflow: document no-destroy domain restriction with layered rationale,
  fix concurrency group to workspace name (not branch), cancel-in-progress=false
  to avoid state corruption, add comment on command-resolution logic
- Workflow: BUCKET_NAME / BUCKET_REGION → vars.BACKUP_BUCKET_NAME / BACKUP_BUCKET_REGION
- main.tf: add FinOps comment on noncurrent_version_expiration
- 01-iam/bootstrap/scaleway: fix stale reference to policy.tf (removed earlier)
- .gitignore: ignore specs/ to reduce PR noise; untrack existing specs files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The backup bucket is permanently deployed — state always exists regardless
of the terraform command. Read outputs unconditionally via terraform output
-json instead of hardcoded GitHub vars, so the verify step always gets
live values from state.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread .github/workflows/backup_scaleway.yml Fixed
Comment thread .github/workflows/backup_scaleway.yml Fixed
…ction

zizmor flagged `${{ steps.tf-outputs.outputs.* }}` expanded inline in a
`run:` block as template-injection risk. Values now passed via `env:` on
the verify step so the runner sets them as environment variables before
shell execution.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nbrieussel
nbrieussel marked this pull request as ready for review June 21, 2026 12:53
@nbrieussel
nbrieussel merged commit 657269d into main Jun 21, 2026
9 checks passed
nbrieussel pushed a commit that referenced this pull request Jun 21, 2026
- Rename IAM resources workload → kubernetes (reflects the k8s workload
  context for the backup identity, not a generic machine identity)
- Workflow: document no-destroy domain restriction with layered rationale,
  fix concurrency group to workspace name (not branch), cancel-in-progress=false
  to avoid state corruption, add comment on command-resolution logic
- Workflow: BUCKET_NAME / BUCKET_REGION → vars.BACKUP_BUCKET_NAME / BACKUP_BUCKET_REGION
- main.tf: add FinOps comment on noncurrent_version_expiration
- 01-iam/bootstrap/scaleway: fix stale reference to policy.tf (removed earlier)
- .gitignore: ignore specs/ to reduce PR noise; untrack existing specs files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nbrieussel
nbrieussel deleted the feat/03-backup-s3-foundation branch June 21, 2026 12:54
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.

2 participants