Skip to content

fix: Add count guard to eventarc_pubsub IAM resource#99

Closed
miguelpuiggarcia wants to merge 1 commit into
mainfrom
fix/eventarc-pubsub-count-guard
Closed

fix: Add count guard to eventarc_pubsub IAM resource#99
miguelpuiggarcia wants to merge 1 commit into
mainfrom
fix/eventarc-pubsub-count-guard

Conversation

@miguelpuiggarcia

Copy link
Copy Markdown
Contributor

Summary

  • The eventarc_pubsub resource in gcp/cloud-run-v2/main.tf was unconditionally created (no count guard), while its sibling eventarc_cloud_run resource already had count = length(var.eventarc_triggers) > 0 ? 1 : 0
  • This caused a Terraform dependency cycle when the module was used with create_trigger=true, because the unconditional data.google_project.current lookup created a circular reference through the trigger_provision sub-module
  • Fix: add the same count guard to eventarc_pubsub, matching the existing pattern on eventarc_cloud_run

Impact

This is blocking production Terraform deployments for the AI project (prod-ai-f05cb557).

Test plan

  • Verify terraform plan no longer produces a cycle error
  • Confirm existing services using eventarc triggers are unaffected

🤖 Generated with Claude Code

The eventarc_pubsub resource was unconditionally created (no count guard),
while its sibling eventarc_cloud_run already had one. This caused a
Terraform dependency cycle when the cloud-run-v2 module was used with
create_trigger=true, because the unconditional data.google_project.current
lookup created a circular reference through the trigger_provision module.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@miguelpuiggarcia miguelpuiggarcia deleted the fix/eventarc-pubsub-count-guard branch March 2, 2026 07:42
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.

1 participant