Skip to content

Commit

Permalink
Add support for google_pubsub_lite_subscription (GoogleCloudPlatform#…
Browse files Browse the repository at this point in the history
  • Loading branch information
iyabchen authored and betsy-lichtenberg committed Apr 25, 2022
1 parent 1da2a75 commit 9cdf812
Show file tree
Hide file tree
Showing 4 changed files with 164 additions and 0 deletions.
1 change: 1 addition & 0 deletions mmv1/templates/validator/resource_converters.go.erb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func ResourceConverters() map[string][]ResourceConverter {
"google_spanner_instance_iam_binding": {resourceConverterSpannerInstanceIamBinding()},
"google_spanner_instance_iam_member": {resourceConverterSpannerInstanceIamMember()},
"google_project_service": {resourceConverterServiceUsage()},
"google_pubsub_lite_subscription": {resourceConverterPubsubLiteSubscription()},
"google_pubsub_lite_topic": {resourceConverterPubsubLiteTopic()},
"google_pubsub_schema": {resourceConverterPubsubSchema()},
"google_pubsub_subscription": {resourceConverterPubsubSubscription()},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[
{
"name": "//pubsublite.googleapis.com/projects/{{.Provider.project}}/locations/us-central1a/subscriptions/example-subscription",
"asset_type": "pubsublite.googleapis.com/Subscription",
"ancestry_path": "{{.Ancestry}}/project/{{.Provider.project}}",
"resource": {
"version": "admin",
"discovery_document_uri": "https://www.googleapis.com/discovery/v1/apis/pubsublite/admin/rest",
"discovery_name": "Subscription",
"parent": "//cloudresourcemanager.googleapis.com/projects/{{.Provider.project}}",
"data": {
"deliveryConfig": {
"deliveryRequirement": "DELIVER_AFTER_STORED"
},
"topic": "projects/{{.Provider.project}}/locations/us-central1a/topics/my-topic"
}
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> {{.Provider.version}}"
}
}
}

provider "google" {
{{if .Provider.credentials }}credentials = "{{.Provider.credentials}}"{{end}}
}

resource "google_pubsub_lite_subscription" "example" {
name = "example-subscription"
topic = "my-topic"
zone = "us-central1a"
delivery_config {
delivery_requirement = "DELIVER_AFTER_STORED"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"format_version": "0.2",
"terraform_version": "1.0.10",
"planned_values": {
"root_module": {
"resources": [
{
"address": "google_pubsub_lite_subscription.example",
"mode": "managed",
"type": "google_pubsub_lite_subscription",
"name": "example",
"provider_name": "registry.terraform.io/hashicorp/google",
"schema_version": 0,
"values": {
"delivery_config": [
{
"delivery_requirement": "DELIVER_AFTER_STORED"
}
],
"name": "example-subscription",
"region": null,
"timeouts": null,
"topic": "my-topic",
"zone": "us-central1a"
},
"sensitive_values": {
"delivery_config": [
{}
]
}
}
]
}
},
"resource_changes": [
{
"address": "google_pubsub_lite_subscription.example",
"mode": "managed",
"type": "google_pubsub_lite_subscription",
"name": "example",
"provider_name": "registry.terraform.io/hashicorp/google",
"change": {
"actions": [
"create"
],
"before": null,
"after": {
"delivery_config": [
{
"delivery_requirement": "DELIVER_AFTER_STORED"
}
],
"name": "example-subscription",
"region": null,
"timeouts": null,
"topic": "my-topic",
"zone": "us-central1a"
},
"after_unknown": {
"delivery_config": [
{}
],
"id": true,
"project": true
},
"before_sensitive": false,
"after_sensitive": {
"delivery_config": [
{}
]
}
}
}
],
"configuration": {
"root_module": {
"resources": [
{
"address": "google_pubsub_lite_subscription.example",
"mode": "managed",
"type": "google_pubsub_lite_subscription",
"name": "example",
"provider_config_key": "google",
"expressions": {
"delivery_config": [
{
"delivery_requirement": {
"constant_value": "DELIVER_AFTER_STORED"
}
}
],
"name": {
"constant_value": "example-subscription"
},
"topic": {
"constant_value": "my-topic"
},
"zone": {
"constant_value": "us-central1a"
}
},
"schema_version": 0
}
]
}
}
}

0 comments on commit 9cdf812

Please sign in to comment.