Skip to content

One-time cloud setup needed before infra/terraform-test and infra/terraform-staging can be applied #31

Description

@amar-python

Context

infra/terraform-test/ and infra/terraform-staging/ were added, mirroring infra/terraform-prod/'s architecture tier (managed Postgres Flexible Server, private VNet, private endpoints, Container Apps Job). They're code only — no Azure resources exist yet, and terraform init/apply won't work until the one-time setup below is done. This issue is the reminder to do that setup before actioning (applying) either stack.

Follow docs/PROD_DEPLOY.md's "One-time setup" section as the template, substituting test/staging for prod throughout.

Checklist — Test environment

  • Create Terraform state storage (storage account + tfstate container) for test
  • Uncomment the backend "azurerm" block in infra/terraform-test/main.tf and fill in the real storage_account_name
  • Create a Test-only service principal with OIDC (separate from Dev/Staging/Prod's SPs)
  • Configure a GitHub test Environment + secrets (mirroring the production Environment setup in docs/PROD_DEPLOY.md)
  • terraform init / plan — review the plan and cost impact before apply

Checklist — Staging environment

  • Create Terraform state storage (storage account + tfstate container) for staging
  • Uncomment the backend "azurerm" block in infra/terraform-staging/main.tf and fill in the real storage_account_name
  • Create a Staging-only service principal with OIDC
  • Configure a GitHub staging Environment + secrets
  • terraform init / plan — review the plan and cost impact before apply

Cost warning

Each stack runs the same architecture tier as Prod — roughly AUD 285-385/mo per environment at default sizing (see the cost estimate in each main.tf header). Applying both Test and Staging on top of the existing Dev + Prod stacks meaningfully increases total Azure spend. Review terraform plan and the SKU/HA/backup defaults in each variables.tf before running apply.

Do not apply casually

terraform apply in either stack provisions real, billed Azure resources (Flexible Server, VNet, private endpoints, Key Vault, ACR Premium, Log Analytics). Don't run it until the setup above is complete and the plan has been reviewed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions