Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Estados reales (anonimizados): el formato exacto forma parte del fixture
test/fixtures/
344 changes: 344 additions & 0 deletions docs/adr/0003-state-iac.md

Large diffs are not rendered by default.

54 changes: 54 additions & 0 deletions test/fixtures/state-iac/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# State IaC fixtures

Pulumi DIY (self-managed) backend contents used by the State IaC tests. Each folder is the root
of a bucket (or of a bucket prefix): point an in-memory/local `ObjectStore` at it.

Decisions and format notes: [`docs/adr/0003-state-iac.md`](../../../docs/adr/0003-state-iac.md).

## Origin

Taken from a real GCS bucket (2 Pulumi projects, 3 stacks, 61 updates between May and November 2026,
Pulumi v3.228–v3.276) and **anonymized**:

- Organization, project and domain names → `acme`, `acme-infra`, `acme-platform`, `acme.example`.
- GCP project numbers, public IPs (→ `203.0.113.0/24`), emails, git author/committer, `git.head`,
local paths and PEM certificates replaced. Private (RFC 1918) IPs kept.
- Every `ciphertext`, `secure` and `salt` value replaced by a fake `v1:<nonce>:<ct>` string. Each
occurrence is different, just like real Pulumi re-encrypts secrets with a fresh nonce on every write,
so the diff tests see the same noise as production.
- Resources cut down to a representative subset (49 of 149 in prod, 45 of 114 in staging): stack, provider, components,
service APIs, IAM, Cloud SQL (with secret passwords), load balancer, Secret Manager, buckets
(resource references) and DNS. The DNS component's `records` input is synthetic.

JSON formatting is kept as Pulumi wrote it (compact checkpoints, 4-space indented history and
empty stack), which is why `test/fixtures/` is in `.prettierignore`. Do not reformat these files.

## Contents

### `project-layout/.pulumi` (meta.yaml `version: 1`)

| Path | What it covers |
| --- | --- |
| `stacks/acme-infra/prod.json` | Current state, compact JSON, 49 resources, stack outputs |
| `stacks/acme-infra/prod.json.bak` | Previous state (must be ignored when listing stacks) |
| `stacks/acme-infra/prod.json.<ns>` | **Synthetic** `PULUMI_RETAIN_CHECKPOINTS` copy (must be ignored when listing) |
| `stacks/acme-infra/staging.json.gz` | **Synthetic gzip** (`PULUMI_DIY_BACKEND_GZIP`) of a real state |
| `stacks/acme-platform/dev.json` (+ `.bak`) | Empty stack: no `resources` key; `.bak` is `version: 0` from `stack init` |
| `history/acme-infra/prod/prod-<ns>.{history,checkpoint}.json` | 4 real updates, in order: **failed** (CI, Linux, UTC times), provider bump with 38 creates and 1 replace, a replace (managed certificate), and a 2-resource update. Each checkpoint is the state *after* that update |
| `history/acme-infra/staging/*.json.gz` | **Synthetic gzip** of one real `refresh` and one real `resource-import` |
| `backups/acme-infra/prod/prod.<ns>.json` | Backup written right after the last update (same content as its checkpoint) |
| `locks/organization/acme-infra/prod/<uuid>.json` | **Synthetic** lock (`pid`, `username`, `hostname`, `timestamp`) |

### `legacy-layout/.pulumi` (no meta.yaml)

**Synthetic**, derived from the prod data: `stacks/prod.json` and `history/prod/…`, with
`checkpoint.stack: "prod"` and the project `acme-legacy` only in the URNs
(`urn:pulumi:prod::acme-legacy::…`), which is the only place a reader can find it.

## Expected values (for assertions)

- Stacks: `acme-infra/prod`, `acme-infra/staging`, `acme-platform/dev` (project layout);
`prod` → project `acme-legacy` (legacy).
- Normalized diff between consecutive prod checkpoints (rules in the ADR): `…2066…` → `…2803…`
changes 4 resources (`lb-prod-cert` is a **replace**: same URN, new `id`); `…2803…` → `…4216…`
changes 2 resources (`cloud-sql-acme-prod`, `acme-prod`). A raw JSON comparison flags ~30 in both.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"kind": "update",
"startTime": 1795602713,
"message": "SA backoffice admin in cloud storage private",
"environment": {
"exec.kind": "cli",
"git.author": "Jane Doe",
"git.author.email": "jane@example.com",
"git.committer": "Jane Doe",
"git.committer.email": "jane@example.com",
"git.dirty": "true",
"git.head": "30103f358f17a3c2f6021e3c21a71e8cb466075c",
"git.headName": "refs/heads/main",
"pulumi.arch": "arm64",
"pulumi.os": "darwin",
"pulumi.version": "v3.276.0",
"runtime.executable": "/usr/local/bin/node",
"runtime.metadata.packagemanager": "npm",
"runtime.metadata.packagemanagerVersion": "11.20.0",
"runtime.metadata.typescriptVersion": "5.9.3",
"runtime.name": "nodejs",
"runtime.version": "v26.12.1",
"stack.environments": "[]",
"updatePlan": "false",
"vcs.kind": "github.com",
"vcs.owner": "Acme",
"vcs.repo": "acme-infra",
"vcs.root": "."
},
"config": {
"gcp:project": "acme-prod",
"pulumi:tags": {
"pulumi:template": "gcp-typescript"
},
"acme-legacy:artifactRegistryName": "acme-artifact-registry-prod",
"acme-legacy:artifactRepositoryId": "acme-prod",
"acme-legacy:assetsBucketName": "acme-assets-prod",
"acme-legacy:dnsDomain": "acme.example.",
"acme-legacy:dnsSubdomains": "api,ops-bo,static",
"acme-legacy:dnsZoneName": "acme-com",
"acme-legacy:environment": "prod",
"acme-legacy:privateBucketName": "acme-private-prod",
"acme-legacy:project": "acme-prod",
"acme-legacy:pulseBucketName": "acme-pulse-data-prod",
"acme-legacy:redisInstanceName": "acme-redis-prod",
"acme-legacy:redisMaintenanceDay": "MONDAY",
"acme-legacy:redisMaintenanceHour": "3",
"acme-legacy:redisMemorySizeGb": "2",
"acme-legacy:redisTier": "STANDARD_HA",
"acme-legacy:region": "europe-west1",
"acme-legacy:sqlApiUserPassword": {
"secure": "v1:kJHYABuh:Zml4dHVyZS1jaXBoZXJ0ZXh0LTQ0Nw=="
},
"acme-legacy:sqlAvailabilityType": "REGIONAL",
"acme-legacy:sqlBackofficeUserPassword": {
"secure": "v1:yJPTAfKV:Zml4dHVyZS1jaXBoZXJ0ZXh0LTQ0OA=="
},
"acme-legacy:sqlBackupEnabled": "true",
"acme-legacy:sqlBackupRetentionDays": "7",
"acme-legacy:sqlDatabases": "acme_api_prod,acme_backoffice_prod",
"acme-legacy:sqlDeletionProtection": "true",
"acme-legacy:sqlDiskAutoresizeLimit": "100",
"acme-legacy:sqlInstanceName": "acme-prod",
"acme-legacy:sqlMaintenanceDay": "1",
"acme-legacy:sqlMaintenanceHour": "3",
"acme-legacy:sqlPointInTimeRecoveryEnabled": "true",
"acme-legacy:sqlTier": "db-custom-4-15360",
"acme-legacy:vpcConnectorIpCidrRange": "10.11.8.0/28",
"acme-legacy:vpcConnectorMaxThroughput": "1000",
"acme-legacy:vpcConnectorMinThroughput": "200",
"acme-legacy:vpcIpCidrRange": "10.11.0.0/24"
},
"version": 0,
"result": "succeeded",
"endTime": 1795602802,
"resourceChanges": {
"replace": 1,
"same": 144,
"update": 3
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"kind": "update",
"startTime": 1795604139,
"message": "SA backoffice admin in cloud storage private",
"environment": {
"exec.kind": "cli",
"git.author": "Jane Doe",
"git.author.email": "jane@example.com",
"git.committer": "Jane Doe",
"git.committer.email": "jane@example.com",
"git.dirty": "true",
"git.head": "30103f358f17a3c2f6021e3c21a71e8cb466075c",
"git.headName": "refs/heads/main",
"pulumi.arch": "arm64",
"pulumi.os": "darwin",
"pulumi.version": "v3.276.0",
"runtime.executable": "/usr/local/bin/node",
"runtime.metadata.packagemanager": "npm",
"runtime.metadata.packagemanagerVersion": "11.20.0",
"runtime.metadata.typescriptVersion": "5.9.3",
"runtime.name": "nodejs",
"runtime.version": "v26.12.1",
"stack.environments": "[]",
"updatePlan": "false",
"vcs.kind": "github.com",
"vcs.owner": "Acme",
"vcs.repo": "acme-infra",
"vcs.root": "."
},
"config": {
"gcp:project": "acme-prod",
"pulumi:tags": {
"pulumi:template": "gcp-typescript"
},
"acme-legacy:artifactRegistryName": "acme-artifact-registry-prod",
"acme-legacy:artifactRepositoryId": "acme-prod",
"acme-legacy:assetsBucketName": "acme-assets-prod",
"acme-legacy:dnsDomain": "acme.example.",
"acme-legacy:dnsSubdomains": "api,ops-bo,static",
"acme-legacy:dnsZoneName": "acme-com",
"acme-legacy:environment": "prod",
"acme-legacy:privateBucketName": "acme-private-prod",
"acme-legacy:project": "acme-prod",
"acme-legacy:pulseBucketName": "acme-pulse-data-prod",
"acme-legacy:redisInstanceName": "acme-redis-prod",
"acme-legacy:redisMaintenanceDay": "MONDAY",
"acme-legacy:redisMaintenanceHour": "3",
"acme-legacy:redisMemorySizeGb": "2",
"acme-legacy:redisTier": "STANDARD_HA",
"acme-legacy:region": "europe-west1",
"acme-legacy:sqlApiUserPassword": {
"secure": "v1:4mdfEq5Q:Zml4dHVyZS1jaXBoZXJ0ZXh0LTQ4Nw=="
},
"acme-legacy:sqlAvailabilityType": "REGIONAL",
"acme-legacy:sqlBackofficeUserPassword": {
"secure": "v1:kOnmyjxk:Zml4dHVyZS1jaXBoZXJ0ZXh0LTQ4OA=="
},
"acme-legacy:sqlBackupEnabled": "true",
"acme-legacy:sqlBackupRetentionDays": "7",
"acme-legacy:sqlDatabases": "acme_api_prod,acme_backoffice_prod",
"acme-legacy:sqlDeletionProtection": "true",
"acme-legacy:sqlDiskAutoresizeLimit": "100",
"acme-legacy:sqlInstanceName": "acme-prod",
"acme-legacy:sqlMaintenanceDay": "1",
"acme-legacy:sqlMaintenanceHour": "3",
"acme-legacy:sqlPointInTimeRecoveryEnabled": "true",
"acme-legacy:sqlPublicIp": "true",
"acme-legacy:sqlTier": "db-custom-4-15360",
"acme-legacy:vpcConnectorIpCidrRange": "10.11.8.0/28",
"acme-legacy:vpcConnectorMaxThroughput": "1000",
"acme-legacy:vpcConnectorMinThroughput": "200",
"acme-legacy:vpcIpCidrRange": "10.11.0.0/24"
},
"version": 0,
"result": "succeeded",
"endTime": 1795604215,
"resourceChanges": {
"same": 146,
"update": 2
}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"kind": "update",
"startTime": 1789061060,
"message": "github action deploy",
"environment": {
"ci.build.id": "34507828519",
"ci.build.number": "2",
"ci.build.type": "workflow_dispatch",
"ci.build.url": "https://github.com/Acme/acme-infra/actions/runs/34507828519",
"ci.pr.headSHA": "55cb3fd238f9172e2b62fdaee2fa0b398924008c",
"ci.system": "GitHub Actions",
"exec.kind": "cli",
"git.author": "Jane Doe",
"git.author.email": "jane@example.com",
"git.committer": "Jane Doe",
"git.committer.email": "jane@example.com",
"git.dirty": "true",
"git.head": "8f4ac1ce1c4c2f7c53b773c65a90b0e27bfbd8d3",
"git.headName": "refs/heads/main",
"pulumi.arch": "amd64",
"pulumi.env.PULUMI_CONFIG_PASSPHRASE": "set",
"pulumi.flag.yes": "true",
"pulumi.os": "linux",
"pulumi.version": "v3.261.0",
"runtime.executable": "/usr/local/bin/node",
"runtime.metadata.packagemanager": "npm",
"runtime.metadata.packagemanagerVersion": "10.8.2",
"runtime.metadata.typescriptVersion": "5.9.3",
"runtime.name": "nodejs",
"runtime.version": "v20.20.2",
"stack.environments": "[]",
"updatePlan": "false",
"vcs.kind": "github.com",
"vcs.owner": "Acme",
"vcs.repo": "acme-infra",
"vcs.root": "."
},
"config": {
"gcp:project": "acme-prod",
"pulumi:tags": {
"pulumi:template": "gcp-typescript"
},
"acme-infra:artifactRegistryName": "acme-artifact-registry-prod",
"acme-infra:artifactRepositoryId": "acme-prod",
"acme-infra:assetsBucketName": "acme-assets-prod",
"acme-infra:dnsDomain": "acme.example.",
"acme-infra:dnsSubdomains": "api,ops-bo",
"acme-infra:dnsZoneName": "acme-com",
"acme-infra:environment": "prod",
"acme-infra:privateBucketName": "acme-private-prod",
"acme-infra:project": "acme-prod",
"acme-infra:pulseBucketName": "acme-pulse-data-prod",
"acme-infra:redisInstanceName": "acme-redis-prod",
"acme-infra:redisMaintenanceDay": "MONDAY",
"acme-infra:redisMaintenanceHour": "3",
"acme-infra:redisMemorySizeGb": "2",
"acme-infra:redisTier": "STANDARD_HA",
"acme-infra:region": "europe-west1",
"acme-infra:sqlApiUserPassword": {
"secure": "v1:UIevU5O+:Zml4dHVyZS1jaXBoZXJ0ZXh0LTE="
},
"acme-infra:sqlAvailabilityType": "REGIONAL",
"acme-infra:sqlBackofficeUserPassword": {
"secure": "v1:q8/fFA1n:Zml4dHVyZS1jaXBoZXJ0ZXh0LTI="
},
"acme-infra:sqlBackupEnabled": "true",
"acme-infra:sqlBackupRetentionDays": "7",
"acme-infra:sqlDatabases": "acme_api_prod,acme_backoffice_prod",
"acme-infra:sqlDeletionProtection": "true",
"acme-infra:sqlDiskAutoresizeLimit": "100",
"acme-infra:sqlInstanceName": "acme-prod",
"acme-infra:sqlMaintenanceDay": "1",
"acme-infra:sqlMaintenanceHour": "3",
"acme-infra:sqlPointInTimeRecoveryEnabled": "true",
"acme-infra:sqlTier": "db-custom-4-15360",
"acme-infra:vpcConnectorIpCidrRange": "10.11.8.0/28",
"acme-infra:vpcConnectorMaxThroughput": "1000",
"acme-infra:vpcConnectorMinThroughput": "200",
"acme-infra:vpcIpCidrRange": "10.11.0.0/24"
},
"version": 0,
"result": "failed",
"endTime": 1789061076,
"resourceChanges": {
"same": 111
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"kind": "update",
"startTime": 1795601876,
"message": "SA backoffice admin in cloud storage private",
"environment": {
"exec.kind": "cli",
"git.author": "Jane Doe",
"git.author.email": "jane@example.com",
"git.committer": "Jane Doe",
"git.committer.email": "jane@example.com",
"git.dirty": "true",
"git.head": "30103f358f17a3c2f6021e3c21a71e8cb466075c",
"git.headName": "refs/heads/main",
"pulumi.arch": "arm64",
"pulumi.os": "darwin",
"pulumi.version": "v3.276.0",
"runtime.executable": "/usr/local/bin/node",
"runtime.metadata.packagemanager": "npm",
"runtime.metadata.packagemanagerVersion": "11.20.0",
"runtime.metadata.typescriptVersion": "5.9.3",
"runtime.name": "nodejs",
"runtime.version": "v26.12.1",
"stack.environments": "[]",
"updatePlan": "false",
"vcs.kind": "github.com",
"vcs.owner": "Acme",
"vcs.repo": "acme-infra",
"vcs.root": "."
},
"config": {
"gcp:project": "acme-prod",
"pulumi:tags": {
"pulumi:template": "gcp-typescript"
},
"acme-infra:artifactRegistryName": "acme-artifact-registry-prod",
"acme-infra:artifactRepositoryId": "acme-prod",
"acme-infra:assetsBucketName": "acme-assets-prod",
"acme-infra:dnsDomain": "acme.example.",
"acme-infra:dnsSubdomains": "api,ops-bo,static",
"acme-infra:dnsZoneName": "acme-com",
"acme-infra:environment": "prod",
"acme-infra:privateBucketName": "acme-private-prod",
"acme-infra:project": "acme-prod",
"acme-infra:pulseBucketName": "acme-pulse-data-prod",
"acme-infra:redisInstanceName": "acme-redis-prod",
"acme-infra:redisMaintenanceDay": "MONDAY",
"acme-infra:redisMaintenanceHour": "3",
"acme-infra:redisMemorySizeGb": "2",
"acme-infra:redisTier": "STANDARD_HA",
"acme-infra:region": "europe-west1",
"acme-infra:sqlApiUserPassword": {
"secure": "v1:mkU8uL7X:Zml4dHVyZS1jaXBoZXJ0ZXh0LTQx"
},
"acme-infra:sqlAvailabilityType": "REGIONAL",
"acme-infra:sqlBackofficeUserPassword": {
"secure": "v1:dN0X+PWt:Zml4dHVyZS1jaXBoZXJ0ZXh0LTQy"
},
"acme-infra:sqlBackupEnabled": "true",
"acme-infra:sqlBackupRetentionDays": "7",
"acme-infra:sqlDatabases": "acme_api_prod,acme_backoffice_prod",
"acme-infra:sqlDeletionProtection": "true",
"acme-infra:sqlDiskAutoresizeLimit": "100",
"acme-infra:sqlInstanceName": "acme-prod",
"acme-infra:sqlMaintenanceDay": "1",
"acme-infra:sqlMaintenanceHour": "3",
"acme-infra:sqlPointInTimeRecoveryEnabled": "true",
"acme-infra:sqlTier": "db-custom-4-15360",
"acme-infra:vpcConnectorIpCidrRange": "10.11.8.0/28",
"acme-infra:vpcConnectorMaxThroughput": "1000",
"acme-infra:vpcConnectorMinThroughput": "200",
"acme-infra:vpcIpCidrRange": "10.11.0.0/24"
},
"version": 0,
"result": "succeeded",
"endTime": 1795602066,
"resourceChanges": {
"create": 38,
"delete": 1,
"replace": 1,
"same": 36,
"update": 73
}
}

Large diffs are not rendered by default.

Loading
Loading