Skip to content

REGBACKLOG-336: manage STRR dev infrastructure with Terraform - #1790

Open
Jacky-Pham wants to merge 3 commits into
mainfrom
Jacky/regbacklog-336-terraform
Open

REGBACKLOG-336: manage STRR dev infrastructure with Terraform#1790
Jacky-Pham wants to merge 3 commits into
mainfrom
Jacky/regbacklog-336-terraform

Conversation

@Jacky-Pham

Copy link
Copy Markdown
Collaborator

Summary

  • add a dev-only Terraform root in the STRR repository
  • adopt the existing STRR email Pub/Sub resources and bulk-validation Eventarc trigger with import blocks
  • store state in strr-tools-terraform-state under the strr/dev prefix
  • add a manually dispatched, keyless GitHub Actions plan/apply workflow
  • keep IAM bootstrap in bcgov/bcregistry-sre and leave BigQuery resources unchanged

Safety boundary

This first change transfers existing dev resources into Terraform state. It does not add the missing cross-environment parity resources. Those changes will be reviewed separately after the import produces a clean plan. Apply is restricted to main.

Dependencies

Both IAM changes must be applied and merged before running this workflow.

Local validation

  • terraform fmt -check -diff -recursive
  • terraform init -backend=false -input=false
  • terraform validate
  • workflow YAML parsed successfully

Initial rollout

  1. Merge the IAM changes above.
  2. Merge this workflow to main.
  3. Run STRR Terraform with action=plan.
  4. Require only the expected imports and 0 to add, 0 to change, 0 to destroy.
  5. Run action=apply from main to record the imports.
  6. Run action=plan again and require no changes.

Ticket: https://hous-hpb.atlassian.net/browse/REGBACKLOG-336

Comment thread .github/workflows/strr-terraform.yaml Fixed
Comment thread .github/workflows/strr-terraform.yaml Fixed
@Jacky-Pham
Jacky-Pham marked this pull request as ready for review August 25, 2026 21:02
Comment thread .github/workflows/strr-terraform.yaml Outdated
@Jacky-Pham

Copy link
Copy Markdown
Collaborator Author

hey Jimmy, the SRE IAM changes are merged and applied now. when you have a chance can you review this so I can run the terraform plan?

@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds dev-only Terraform management for existing STRR Pub/Sub and Eventarc infrastructure.

Changes:

  • Defines and imports existing dev resources.
  • Configures remote state and keyless authentication.
  • Adds manual Terraform plan/apply automation.
File summaries
File Description
terraform/versions.tf Configures Terraform, provider, and backend.
terraform/variables.tf Defines dev infrastructure inputs.
terraform/README.md Documents scope and rollout.
terraform/pubsub.tf Manages and imports Pub/Sub resources.
terraform/eventarc.tf Manages and imports the Eventarc trigger.
terraform/dev.tfvars Supplies dev environment values.
terraform/data.tf Resolves the Pub/Sub service agent.
terraform/.terraform.lock.hcl Locks the Google provider.
.gitignore Excludes Terraform working directories.
.github/workflows/strr-terraform.yaml Adds manual plan/apply automation.
Review details

Files not reviewed (1)

  • terraform/.terraform.lock.hcl: Generated file
  • Files reviewed: 8/10 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +69 to +71
- name: Terraform apply
if: inputs.action == 'apply'
run: terraform apply -input=false -auto-approve tfplan
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.

4 participants