diff --git a/builtin/providers/google/resource_pubsub_subscription.go b/builtin/providers/google/resource_pubsub_subscription.go index 432d48ee2f..6afd7c5cd9 100644 --- a/builtin/providers/google/resource_pubsub_subscription.go +++ b/builtin/providers/google/resource_pubsub_subscription.go @@ -38,6 +38,11 @@ func resourcePubsubSubscription() *schema.Resource { ForceNew: true, }, + "path": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "push_config": &schema.Schema{ Type: schema.TypeList, Optional: true, @@ -113,6 +118,7 @@ func resourcePubsubSubscriptionCreate(d *schema.ResourceData, meta interface{}) } d.SetId(res.Name) + d.Set("path", name) return nil } diff --git a/builtin/providers/google/resource_pubsub_subscription_test.go b/builtin/providers/google/resource_pubsub_subscription_test.go index 80dc0aa67c..01230656f0 100644 --- a/builtin/providers/google/resource_pubsub_subscription_test.go +++ b/builtin/providers/google/resource_pubsub_subscription_test.go @@ -16,11 +16,12 @@ func TestAccPubsubSubscriptionCreate(t *testing.T) { Providers: testAccProviders, CheckDestroy: testAccCheckPubsubSubscriptionDestroy, Steps: []resource.TestStep{ - resource.TestStep{ + { Config: testAccPubsubSubscription, Check: resource.ComposeTestCheckFunc( testAccPubsubSubscriptionExists( "google_pubsub_subscription.foobar_sub"), + resource.TestCheckResourceAttrSet("google_pubsub_subscription.foobar_sub", "path"), ), }, }, diff --git a/website/source/docs/providers/google/r/pubsub_subscription.html.markdown b/website/source/docs/providers/google/r/pubsub_subscription.html.markdown index ce375b12d1..e5cf641d20 100644 --- a/website/source/docs/providers/google/r/pubsub_subscription.html.markdown +++ b/website/source/docs/providers/google/r/pubsub_subscription.html.markdown @@ -68,4 +68,4 @@ The optional `push_config` block supports: ## Attributes Reference -Only the arguments listed above are exposed as attributes. +* `path` - Path of the subscription in the format `projects/{project}/subscriptions/{sub}`