feat(gcp): add support for verifying Pub/Sub Topics and Subscriptions#1680
Conversation
6629204 to
10be290
Compare
|
A couple of minor, non-blocking suggestions: The strings.ToLower() calls in the test (lines 31-32) are unnecessary since random.UniqueId() already returns lowercase strings. You can drop those and the "strings" import. Also, it'd be nice to see a negative test case (e.g., asserting that a non-existent topic returns an error), though that can be a follow-up. The Terraform version comment in main.tf saying "only being tested with 0.13.x" is stale, but that's consistent with other examples in the repo so not worth blocking on. Overall this looks good to merge. |
|
You probably need to rebase the change anyway so if you can address those minor comments, it would be great. |
Friendly ping in order for us to merge this change @Amit2465 . |
10be290 to
6785de0
Compare
- Added AssertTopicExists and AssertTopicExistsE to modules/gcp - Added AssertSubscriptionExists and AssertSubscriptionExistsE to modules/gcp - Created integration test fixture in examples/terraform-gcp-pubsub-example - Added automated test TestTerraformGcpPubSubExample in test/gcp
6785de0 to
cffb7e9
Compare
|
Thanks for the feedback! Here's what was addressed:
|
|
Thanks for addressing all the feedback, this looks good to merge. One minor note: TestAssertTopicAndSubscriptionExist largely duplicates TestAssertSubscriptionExistsNoFalseNegative; consider folding the subscription-topic linkage check into that test and dropping the duplicate. Not a blocker though. LGTM. |
Description
This PR adds support for Google Cloud Pub/Sub to the GCP module. It introduces helper functions to verify the existence of Pub/Sub Topics and Subscriptions, along with a complete Terraform example and automated integration tests.
This is a new feature addition and does not introduce any backward-incompatible changes.
TODOs
Read the Gruntwork contribution guidelines.
Release Notes (draft)
Added support for verifying Google Cloud Pub/Sub Topics and Subscriptions in the GCP module.
Migration Guide
No backward incompatible changes were introduced.
Verification Results
I have verified this PR locally against a real GCP project:
golangci-lint run.go fmtandterraform fmt.TestTerraformGcpPubSubExample.Test Output Snippet: