GithubHelp home page GithubHelp logo

pinkeyat / terraform-google-pubsub Goto Github PK

View Code? Open in Web Editor NEW

This project forked from terraform-google-modules/terraform-google-pubsub

0.0 0.0 0.0 367 KB

Creates Pub/Sub topic and subscriptions associated with the topic

Home Page: https://registry.terraform.io/modules/terraform-google-modules/pubsub/google

License: Apache License 2.0

Go 11.97% Makefile 10.40% HCL 77.63%

terraform-google-pubsub's Introduction

terraform-google-pubsub

This module makes it easy to create Google Cloud Pub/Sub topic and subscriptions associated with the topic.

Compatibility

This module is meant for use with Terraform 0.13+ and tested using Terraform 1.0+. If you find incompatibilities using Terraform >=0.13, please open an issue. If you haven't upgraded and need a Terraform 0.12.x-compatible version of this module, the last released version intended for Terraform 0.12.x is v1.9.0.

Usage

This is a simple usage of the module. Please see also a simple setup provided in the example directory.

module "pubsub" {
  source  = "terraform-google-modules/pubsub/google"
  version = "~> 5.0"

  topic      = "tf-topic"
  project_id = "my-pubsub-project"
  push_subscriptions = [
    {
      name                       = "push"                                               // required
      ack_deadline_seconds       = 20                                                   // optional
      push_endpoint              = "https://example.com"                                // required
      x-goog-version             = "v1beta1"                                            // optional
      oidc_service_account_email = "[email protected]"                                     // optional
      audience                   = "example"                                            // optional
      expiration_policy          = "1209600s"                                           // optional
      dead_letter_topic          = "projects/my-pubsub-project/topics/example-dl-topic" // optional
      max_delivery_attempts      = 5                                                    // optional
      maximum_backoff            = "600s"                                               // optional
      minimum_backoff            = "300s"                                               // optional
      filter                     = "attributes.domain = \"com\""                        // optional
    }
  ]
  pull_subscriptions = [
    {
      name                         = "pull"                                               // required
      ack_deadline_seconds         = 20                                                   // optional
      dead_letter_topic            = "projects/my-pubsub-project/topics/example-dl-topic" // optional
      max_delivery_attempts        = 5                                                    // optional
      maximum_backoff              = "600s"                                               // optional
      minimum_backoff              = "300s"                                               // optional
      filter                       = "attributes.domain = \"com\""                        // optional
      enable_message_ordering      = true                                                 // optional
      service_account              = "[email protected]"          // optional
      enable_exactly_once_delivery = true                                                 // optional
    }
  ]
  bigquery_subscriptions = [
    {
      name                = "bigquery"              // required
      table               = "project.dataset.table" // required
      use_topic_schema    = true                    // optional
      write_metadata      = false                   // optional
      drop_unknown_fields = false                   // optional
    }
  ]
}

Inputs

Name Description Type Default Required
bigquery_subscriptions The list of the bigquery push subscriptions. list(map(string)) [] no
create_subscriptions Specify true if you want to create subscriptions. bool true no
create_topic Specify true if you want to create a topic. bool true no
grant_token_creator Specify true if you want to add token creator role to the default Pub/Sub SA. bool true no
message_storage_policy A map of storage policies. Default - inherit from organization's Resource Location Restriction policy. map(any) {} no
project_id The project ID to manage the Pub/Sub resources. string n/a yes
pull_subscriptions The list of the pull subscriptions. list(map(string)) [] no
push_subscriptions The list of the push subscriptions. list(map(string)) [] no
schema Schema for the topic.
object({
name = string
type = string
definition = string
encoding = string
})
null no
subscription_labels A map of labels to assign to every Pub/Sub subscription. map(string) {} no
topic The Pub/Sub topic name. string n/a yes
topic_kms_key_name The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. string null no
topic_labels A map of labels to assign to the Pub/Sub topic. map(string) {} no
topic_message_retention_duration The minimum duration in seconds to retain a message after it is published to the topic. string null no

Outputs

Name Description
id The ID of the Pub/Sub topic
subscription_names The name list of Pub/Sub subscriptions
subscription_paths The path list of Pub/Sub subscriptions
topic The name of the Pub/Sub topic
topic_labels Labels assigned to the Pub/Sub topic
uri The URI of the Pub/Sub topic

Requirements

Installation Dependencies

Configure a Service Account

In order to execute this module you must have a Service Account with the following:

Roles

  • roles/pubsub.admin

Enable APIs

In order to operate with the Service Account you must activate the following APIs on the project where the Service Account was created:

  • Cloud Pub/Sub API

Service Account Credentials

You can pass the service account credentials into this module by setting the following environment variables:

  • GOOGLE_CREDENTIALS
  • GOOGLE_CLOUD_KEYFILE_JSON
  • GCLOUD_KEYFILE_JSON

See more details.

terraform-google-pubsub's People

Contributors

aaron-lane avatar agosto-calvinbehling avatar allisson avatar ameausoone avatar anakovt avatar apatra0908 avatar apeabody avatar askoriy avatar bharathkkb avatar bluehawk27 avatar cloud-foundation-bot avatar dependabot[bot] avatar erjohnso avatar eugenemiretsky avatar hdavila146 avatar karunamon avatar kopachevsky avatar lnesteroff avatar macksclark avatar mkaramosly avatar morgante avatar namusyaka avatar naseemkullah avatar omazin avatar onimsha avatar paulpalamarchuk avatar pinkeyat avatar release-please[bot] avatar renovate[bot] avatar skynewz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.