Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example in docs for creating a subscription with a topic in another project #651

Merged
merged 1 commit into from
Oct 30, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions website/docs/r/pubsub_subscription.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ Creates a subscription in Google's pubsub queueing system. For more information
## Example Usage

```hcl
resource "google_pubsub_topic" "default-topic" {
name = "default-topic"
}

resource "google_pubsub_subscription" "default" {
name = "default-subscription"
topic = "default-topic"
topic = "${google_pubsub_topic.default-topic.name}"

ack_deadline_seconds = 20

Expand All @@ -32,14 +36,28 @@ resource "google_pubsub_subscription" "default" {
}
```

If the subscription has a topic in a different project:

```hcl
resource "google_pubsub_topic" "topic-different-project" {
project = "another-project"
name = "topic-different-project"
}

resource "google_pubsub_subscription" "default" {
name = "default-subscription"
topic = "${google_pubsub_topic.topic-different-project.id}"
}
```

## Argument Reference

The following arguments are supported:

* `name` - (Required) A unique name for the resource, required by pubsub.
Changing this forces a new resource to be created.

* `topic` - (Required) A topic to bind this subscription to, required by pubsub.
* `topic` - (Required) The topic name or id to bind this subscription to, required by pubsub.
Changing this forces a new resource to be created.

- - -
Expand Down