Skip to content

Add Cloud Run redirect service IaC - #154

Closed
jirhiker wants to merge 1 commit into
productionfrom
add-cloudrun-redirect-iac
Closed

Add Cloud Run redirect service IaC#154
jirhiker wants to merge 1 commit into
productionfrom
add-cloudrun-redirect-iac

Conversation

@jirhiker

Copy link
Copy Markdown
Contributor

What

Terraform for a Cloud Run service that 301-redirects all requests to https://metermanager.pvacd.com, path + query preserved. Lives in iac/cloudrun-redirect/.

How

  • Prebuilt public image schmunk42/nginx-redirect (Docker Hub, pulled directly by Cloud Run) — no image to build/maintain.
  • google_cloud_run_v2_service + allUsers run.invoker IAM so browsers can reach it.
  • Redirect target/scheme/code are variables (default https / metermanager.pvacd.com / 301).
  • Service only — no domain mapping. Emits the run.app URL; point DNS / Cloud Run domain mapping at it separately.

Notes

  • Does not touch docker-compose.production.yml — existing prod deployment unchanged.
  • iam.allowedPolicyMemberDomains org policy can block allUsers; likely failure point if IAM apply errors.
  • Image tag is :latest — pin a tag/digest for reproducible deploys.

Verify

```sh
terraform init && terraform apply
curl -sI "$(terraform output -raw service_url)/x?q=1"

HTTP/2 301 -> location: https://metermanager.pvacd.com/x?q=1

```

🤖 Generated with Claude Code

Terraform for a Cloud Run service that 301-redirects all requests to
https://metermanager.pvacd.com (path + query preserved), using the prebuilt
schmunk42/nginx-redirect image. Service only; domain mapping left to the
operator.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jirhiker
jirhiker marked this pull request as draft July 10, 2026 21:52
@TylerAdamMartinez
TylerAdamMartinez deleted the add-cloudrun-redirect-iac branch August 4, 2026 22:48
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