diff --git a/.changelog/9637.txt b/.changelog/9637.txt new file mode 100644 index 00000000000..8ec013c0699 --- /dev/null +++ b/.changelog/9637.txt @@ -0,0 +1,3 @@ +```release-note:none + +``` diff --git a/google/services/pubsub/resource_pubsub_subscription.go b/google/services/pubsub/resource_pubsub_subscription.go index 92942b62458..9b6734ca984 100644 --- a/google/services/pubsub/resource_pubsub_subscription.go +++ b/google/services/pubsub/resource_pubsub_subscription.go @@ -78,7 +78,9 @@ func ResourcePubsubSubscription() *schema.Resource { Required: true, ForceNew: true, DiffSuppressFunc: tpgresource.CompareSelfLinkOrResourceName, - Description: `A reference to a Topic resource.`, + Description: `A reference to a Topic resource, of the form projects/{project}/topics/{{name}} +(as in the id property of a google_pubsub_topic), or just a topic name if +the topic is in the same project as the subscription.`, }, "ack_deadline_seconds": { Type: schema.TypeInt, diff --git a/google/services/pubsub/resource_pubsub_subscription_generated_test.go b/google/services/pubsub/resource_pubsub_subscription_generated_test.go index 8b7a2d148cf..2e107fd964b 100644 --- a/google/services/pubsub/resource_pubsub_subscription_generated_test.go +++ b/google/services/pubsub/resource_pubsub_subscription_generated_test.go @@ -63,7 +63,7 @@ resource "google_pubsub_topic" "example" { resource "google_pubsub_subscription" "example" { name = "tf-test-example-subscription%{random_suffix}" - topic = google_pubsub_topic.example.name + topic = google_pubsub_topic.example.id ack_deadline_seconds = 20 @@ -115,7 +115,7 @@ resource "google_pubsub_topic" "example" { resource "google_pubsub_subscription" "example" { name = "tf-test-example-subscription%{random_suffix}" - topic = google_pubsub_topic.example.name + topic = google_pubsub_topic.example.id labels = { foo = "bar" @@ -176,7 +176,7 @@ resource "google_pubsub_topic" "example_dead_letter" { resource "google_pubsub_subscription" "example" { name = "tf-test-example-subscription%{random_suffix}" - topic = google_pubsub_topic.example.name + topic = google_pubsub_topic.example.id dead_letter_policy { dead_letter_topic = google_pubsub_topic.example_dead_letter.id @@ -219,7 +219,7 @@ resource "google_pubsub_topic" "example" { resource "google_pubsub_subscription" "example" { name = "tf-test-example-subscription%{random_suffix}" - topic = google_pubsub_topic.example.name + topic = google_pubsub_topic.example.id bigquery_config { table = "${google_bigquery_table.test.project}.${google_bigquery_table.test.dataset_id}.${google_bigquery_table.test.table_id}" @@ -305,7 +305,7 @@ resource "google_pubsub_topic" "example" { resource "google_pubsub_subscription" "example" { name = "tf-test-example-subscription%{random_suffix}" - topic = google_pubsub_topic.example.name + topic = google_pubsub_topic.example.id cloud_storage_config { bucket = google_storage_bucket.example.name @@ -372,7 +372,7 @@ resource "google_pubsub_topic" "example" { resource "google_pubsub_subscription" "example" { name = "tf-test-example-subscription%{random_suffix}" - topic = google_pubsub_topic.example.name + topic = google_pubsub_topic.example.id cloud_storage_config { bucket = google_storage_bucket.example.name diff --git a/website/docs/r/pubsub_subscription.html.markdown b/website/docs/r/pubsub_subscription.html.markdown index e4979c538f5..57157ed4a31 100644 --- a/website/docs/r/pubsub_subscription.html.markdown +++ b/website/docs/r/pubsub_subscription.html.markdown @@ -48,7 +48,7 @@ resource "google_pubsub_topic" "example" { resource "google_pubsub_subscription" "example" { name = "example-subscription" - topic = google_pubsub_topic.example.name + topic = google_pubsub_topic.example.id ack_deadline_seconds = 20 @@ -80,7 +80,7 @@ resource "google_pubsub_topic" "example" { resource "google_pubsub_subscription" "example" { name = "example-subscription" - topic = google_pubsub_topic.example.name + topic = google_pubsub_topic.example.id labels = { foo = "bar" @@ -102,21 +102,6 @@ resource "google_pubsub_subscription" "example" { enable_message_ordering = false } ``` -## Example Usage - Pubsub Subscription Different Project - - -```hcl -resource "google_pubsub_topic" "example" { - project = "topic-project" - name = "example-topic" -} - -resource "google_pubsub_subscription" "example" { - project = "subscription-project" - name = "example-subscription" - topic = google_pubsub_topic.example.name -} -```