infraops

🛠️ Pulumi and providers

← Back to README

🔑 Pulumi access

Install the Pulumi CLI and configure access for the area you are changing.

Area Required access
apps Intended kubeconfig context. See deployment prerequisites.
cf CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID
do DIGITALOCEAN_TOKEN
gh GITHUB_TOKEN

🚀 Pulumi workflow

Run from the repository root. Review the preview before applying changes.

make pulumi-login
make area=cf pulumi-preview
make area=cf pulumi-update

Set area to apps, cf, do, or gh. The targets select alexfalkowski/<area>/prod and read the area configuration from area/<area>. Follow the application deployment guide for post-update checks on the apps stack, and the cluster add-on guide for the manual Helm workflow.

[!WARNING] Update, refresh, and cancel targets change remote infrastructure or stack state and pass --yes. pulumi-delete uses pulumi stack rm --force, removing stack state and potentially orphaning live resources.

🪣 Cloudflare R2

Configure buckets in cf.hjson. Omit zone to keep a bucket without a public custom domain. When zone is supplied, the custom domain waits for bucket creation in the same update.

⏳ R2 object expiration

Set expiration on a bucket to expire completed objects and abort incomplete multipart uploads. The age starts at upload for completed objects and at initiation for incomplete uploads. This example sets both to seven days.

{
  version: "2.0"
  buckets: [
    {
      name: example-archive
      region: EEUR
      expiration: 168h
    }
  ]
}

Use a positive whole number of seconds in Go duration syntax. Use hours for days, as in 168h or 24h. Fractional hours such as 1.5h are valid because they resolve to whole seconds. Invalid durations fail before bucket registration. Omission creates no lifecycle resource. See the Bucket schema.

The rule uses object age regardless of event timestamps in contents or day prefixes in keys. Cloudflare applies changes asynchronously to existing objects. Shortening the duration can make existing objects eligible for deletion. See Cloudflare object lifecycles.

Use a Cloudflare token with Workers R2 Storage Write permission. The lifecycle resource replaces the complete rule set. Review existing rules before adopting it. See the Cloudflare lifecycle API.

[!WARNING] Removing a previously applied expiration value, including during a rollback, removes the resource from Pulumi state and leaves the remote rules active. To stop expiration, first disable or remove expire-objects in Cloudflare, then omit the field, review the preview, and verify the remote rules after applying. Retain multipart upload cleanup separately if needed. Pending deletion may continue and deleted objects cannot be restored. Reapplying the old value reinstates expiration. See the pinned provider’s lifecycle deletion behavior.

🔒 R2 bucket locks

Set lock_duration: 168h to protect every object from deletion and overwrites for seven days from upload. It uses the same positive whole-second Go durations as expiration. If a lock lasts longer than expiration, Cloudflare waits for the lock to expire before deleting the object. See Cloudflare bucket locks.

The Pulumi resource replaces the full lock rule set with a single protect-objects rule. Before adopting a lock, check that the rule covers the protection you need. To disable a managed lock, first stop any app eviction that depends on it. Remove the rule in Cloudflare before omitting lock_duration and check the resulting remote rules after applying. The provider leaves remote lock rules active when Pulumi removes the resource. See the pinned provider’s lock deletion behavior.

🌊 DigitalOcean

The Kubernetes version is pinned in internal/do/do.go. Apply patch updates in code. Initiate minor or major upgrades in DigitalOcean, then align the code. See the control-plane decision before changing the cluster’s HA setting.

🐙 GitHub

Set at least one checks entry for strict branch protection on master. Required checks are the merge gate. The solo-maintainer workflow requires zero approving reviews.

You can configure Pages and collaborators when creating a repository. Pulumi waits for the repository before setting vulnerability alerts, Pages, and collaborators. Templates owned by alexfalkowski and defined in gh.hjson are created before their consumers, including nested templates. External templates must exist beforehand. Template cycles and duplicate repository names are rejected.

make area=gh pulumi-preview
make area=gh pulumi-update

[!CAUTION] To delete a repository, remove its entry from gh.hjson, then preview and apply the update. Applying the removal permanently deletes the repository and its managed settings.

See the repository schema and implementation for settings and labels.