Skip to content

fix(pubsub): add explicit dependency for dead letter topic IAM permission#11

Merged
nathanknowles merged 1 commit intomainfrom
deadletter-permissions-fix
Jan 26, 2026
Merged

fix(pubsub): add explicit dependency for dead letter topic IAM permission#11
nathanknowles merged 1 commit intomainfrom
deadletter-permissions-fix

Conversation

@nathanknowles
Copy link
Copy Markdown
Contributor

The Pub/Sub subscription with a dead letter policy could be created before
the Pub/Sub service account was granted publish permission on the dead letter
topic. Terraform was creating the subscription and IAM binding in parallel,
which caused a race condition.

Add an explicit depends_on from the subscription to the
google_pubsub_topic_iam_member resource to ensure the publisher permission
is granted before the subscription is created.

This prevents failed messages from being dropped due to missing permissions
on the dead letter topic.

…sion

The Pub/Sub subscription with a dead letter policy could be created before
the Pub/Sub service account was granted publish permission on the dead letter
topic. Terraform was creating the subscription and IAM binding in parallel,
which caused a race condition.

Add an explicit depends_on from the subscription to the
google_pubsub_topic_iam_member resource to ensure the publisher permission
is granted before the subscription is created.

This prevents failed messages from being dropped due to missing permissions
on the dead letter topic.
Copy link
Copy Markdown
Member

@JustinCarmony JustinCarmony left a comment

Choose a reason for hiding this comment

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

Thank you!

@nathanknowles nathanknowles merged commit 18203b6 into main Jan 26, 2026
1 check passed
@nathanknowles nathanknowles deleted the deadletter-permissions-fix branch January 26, 2026 18:51
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