Skip to content

Latest commit

 

History

History
169 lines (137 loc) · 3.17 KB

File metadata and controls

169 lines (137 loc) · 3.17 KB

google_pubsub_lite_subscription

back

Index

Terraform

terraform {
  required_providers {
    google-beta = ">= 3.63.0"
  }
}

top

Example Usage

module "google_pubsub_lite_subscription" {
  source = "./modules/google-beta/r/google_pubsub_lite_subscription"

  # name - (required) is a type of string
  name = null
  # project - (optional) is a type of string
  project = null
  # region - (optional) is a type of string
  region = null
  # topic - (required) is a type of string
  topic = null
  # zone - (optional) is a type of string
  zone = null

  delivery_config = [{
    delivery_requirement = null
  }]

  timeouts = [{
    create = null
    delete = null
    update = null
  }]
}

top

Variables

variable "name" {
  description = "(required) - Name of the subscription."
  type        = string
}

variable "project" {
  description = "(optional)"
  type        = string
  default     = null
}

variable "region" {
  description = "(optional) - The region of the pubsub lite topic."
  type        = string
  default     = null
}

variable "topic" {
  description = "(required) - A reference to a Topic resource."
  type        = string
}

variable "zone" {
  description = "(optional) - The zone of the pubsub lite topic."
  type        = string
  default     = null
}

variable "delivery_config" {
  description = "nested block: NestingList, min items: 0, max items: 1"
  type = set(object(
    {
      delivery_requirement = string
    }
  ))
  default = []
}

variable "timeouts" {
  description = "nested block: NestingSingle, min items: 0, max items: 0"
  type = set(object(
    {
      create = string
      delete = string
      update = string
    }
  ))
  default = []
}

top

Resource

resource "google_pubsub_lite_subscription" "this" {
  # name - (required) is a type of string
  name = var.name
  # project - (optional) is a type of string
  project = var.project
  # region - (optional) is a type of string
  region = var.region
  # topic - (required) is a type of string
  topic = var.topic
  # zone - (optional) is a type of string
  zone = var.zone

  dynamic "delivery_config" {
    for_each = var.delivery_config
    content {
      # delivery_requirement - (required) is a type of string
      delivery_requirement = delivery_config.value["delivery_requirement"]
    }
  }

  dynamic "timeouts" {
    for_each = var.timeouts
    content {
      # create - (optional) is a type of string
      create = timeouts.value["create"]
      # delete - (optional) is a type of string
      delete = timeouts.value["delete"]
      # update - (optional) is a type of string
      update = timeouts.value["update"]
    }
  }

}

top

Outputs

output "id" {
  description = "returns a string"
  value       = google_pubsub_lite_subscription.this.id
}

output "project" {
  description = "returns a string"
  value       = google_pubsub_lite_subscription.this.project
}

output "this" {
  value = google_pubsub_lite_subscription.this
}

top