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

Replace "Pubsub Subscription Different Project" example with making all examples cross-project-friendly #9637

Merged
merged 3 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
13 changes: 3 additions & 10 deletions mmv1/products/pubsub/Subscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ examples:
vars:
topic_name: 'example-topic'
subscription_name: 'example-subscription'
- !ruby/object:Provider::Terraform::Examples
name: 'pubsub_subscription_different_project'
primary_resource_id: 'example'
skip_test: true
vars:
topic_name: 'example-topic'
topic_project: 'topic-project'
subscription_name: 'example-subscription'
subscription_project: 'subscription-project'
- !ruby/object:Provider::Terraform::Examples
name: 'pubsub_subscription_dead_letter'
primary_resource_id: 'example'
Expand Down Expand Up @@ -101,7 +92,9 @@ properties:
resource: 'Topic'
imports: 'name'
description: |
A reference to a Topic resource.
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.
required: true
immutable: true
pattern: 'projects/{{project}}/topics/{{topic}}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resource "google_pubsub_topic" "<%= ctx[:primary_resource_id] %>_dead_letter" {

resource "google_pubsub_subscription" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['subscription_name'] %>"
topic = google_pubsub_topic.<%= ctx[:primary_resource_id] %>.name
topic = google_pubsub_topic.<%= ctx[:primary_resource_id] %>.it
melinath marked this conversation as resolved.
Show resolved Hide resolved

dead_letter_policy {
dead_letter_topic = google_pubsub_topic.<%= ctx[:primary_resource_id] %>_dead_letter.id
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resource "google_pubsub_topic" "<%= ctx[:primary_resource_id] %>" {

resource "google_pubsub_subscription" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['subscription_name'] %>"
topic = google_pubsub_topic.<%= ctx[:primary_resource_id] %>.name
topic = google_pubsub_topic.<%= ctx[:primary_resource_id] %>.id

labels = {
foo = "bar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resource "google_pubsub_topic" "<%= ctx[:primary_resource_id] %>" {

resource "google_pubsub_subscription" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['subscription_name'] %>"
topic = google_pubsub_topic.<%= ctx[:primary_resource_id] %>.name
topic = google_pubsub_topic.<%= ctx[:primary_resource_id] %>.id

ack_deadline_seconds = 20

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resource "google_pubsub_topic" "<%= ctx[:primary_resource_id] %>" {

resource "google_pubsub_subscription" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['subscription_name'] %>"
topic = google_pubsub_topic.<%= ctx[:primary_resource_id] %>.name
topic = google_pubsub_topic.<%= ctx[:primary_resource_id] %>.id

bigquery_config {
table = "${google_bigquery_table.test.project}.${google_bigquery_table.test.dataset_id}.${google_bigquery_table.test.table_id}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource "google_pubsub_topic" "<%= ctx[:primary_resource_id] %>" {

resource "google_pubsub_subscription" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['subscription_name'] %>"
topic = google_pubsub_topic.<%= ctx[:primary_resource_id] %>.name
topic = google_pubsub_topic.<%= ctx[:primary_resource_id] %>.id

cloud_storage_config {
bucket = google_storage_bucket.<%= ctx[:primary_resource_id] %>.name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource "google_pubsub_topic" "<%= ctx[:primary_resource_id] %>" {

resource "google_pubsub_subscription" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['subscription_name'] %>"
topic = google_pubsub_topic.<%= ctx[:primary_resource_id] %>.name
topic = google_pubsub_topic.<%= ctx[:primary_resource_id] %>.id

cloud_storage_config {
bucket = google_storage_bucket.<%= ctx[:primary_resource_id] %>.name
Expand Down