{"id":26575895,"url":"https://github.com/tomarv2/terraform-google-pubsub","last_synced_at":"2025-06-12T15:38:40.779Z","repository":{"id":41455059,"uuid":"347278940","full_name":"tomarv2/terraform-google-pubsub","owner":"tomarv2","description":"Terraform module for Google PubSub","archived":false,"fork":false,"pushed_at":"2022-03-28T19:15:48.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-22T15:49:52.685Z","etag":null,"topics":["checkov","google-cloud-platform","google-pubsub","terraform","terraform-module"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomarv2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-13T05:11:06.000Z","updated_at":"2022-03-07T06:41:30.000Z","dependencies_parsed_at":"2022-09-08T19:12:56.188Z","dependency_job_id":null,"html_url":"https://github.com/tomarv2/terraform-google-pubsub","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/tomarv2/terraform-google-pubsub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomarv2%2Fterraform-google-pubsub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomarv2%2Fterraform-google-pubsub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomarv2%2Fterraform-google-pubsub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomarv2%2Fterraform-google-pubsub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomarv2","download_url":"https://codeload.github.com/tomarv2/terraform-google-pubsub/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomarv2%2Fterraform-google-pubsub/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259494943,"owners_count":22866595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["checkov","google-cloud-platform","google-pubsub","terraform","terraform-module"],"created_at":"2025-03-23T02:35:41.387Z","updated_at":"2025-06-12T15:38:40.745Z","avatar_url":"https://github.com/tomarv2.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/tomarv2/terraform-google-pubsub/actions/workflows/pre-commit.yml\" alt=\"Pre Commit\"\u003e\n        \u003cimg src=\"https://github.com/tomarv2/terraform-google-pubsub/actions/workflows/pre-commit.yml/badge.svg?branch=main\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.apache.org/licenses/LICENSE-2.0\" alt=\"license\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/license/tomarv2/terraform-google-pubsub\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/tomarv2/terraform-google-pubsub/tags\" alt=\"GitHub tag\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/v/tag/tomarv2/terraform-google-pubsub\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/tomarv2/terraform-google-pubsub/pulse\" alt=\"Activity\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/commit-activity/m/tomarv2/terraform-google-pubsub\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://stackoverflow.com/users/6679867/tomarv2\" alt=\"Stack Exchange reputation\"\u003e\n        \u003cimg src=\"https://img.shields.io/stackexchange/stackoverflow/r/6679867\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://twitter.com/intent/follow?screen_name=varuntomar2019\" alt=\"follow on Twitter\"\u003e\n        \u003cimg src=\"https://img.shields.io/twitter/follow/varuntomar2019?style=social\u0026logo=twitter\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Terraform module for Google PubSub\n\n### Versions\n\n- Module tested for Terraform 1.0.1.\n- Google provider version [4.12.0](https://registry.terraform.io/providers/hashicorp/google/latest)\n- `main` branch: Provider versions not pinned to keep up with Terraform releases\n- `tags` releases: Tags are pinned with versions (use \u003ca href=\"https://github.com/tomarv2/terraform-google-pubsub/tags\" alt=\"GitHub tag\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/v/tag/tomarv2/terraform-google-pubsub\" /\u003e\u003c/a\u003e in your releases)\n\n### Usage\n\n#### Option 1:\n\n```\nterrafrom init\nterraform plan -var='teamid=tryme' -var='prjid=project1'\nterraform apply -var='teamid=tryme' -var='prjid=project1'\nterraform destroy -var='teamid=tryme' -var='prjid=project1'\n```\n**Note:** With this option please take care of remote state storage\n\n#### Option 2:\n\n##### Recommended method (stores remote state in remote backend(S3,  Azure storage, or Google bucket) using `prjid` and `teamid` to create directory structure):\n\n- Create python 3.8+ virtual environment\n```\npython3 -m venv \u003cvenv name\u003e\n```\n\n- Install package:\n```\npip install tfremote --upgrade\n```\n\n- Set below environment variables:\n```\nexport TF_GCLOUD_BUCKET=\u003cremote state bucket name\u003e\nexport TF_GCLOUD_PREFIX=\u003cremote state bucket prefix\u003e\nexport TF_GCLOUD_CREDENTIALS=\u003cgcp credentials.json\u003e\n```\n\n- Updated `examples` directory with required values.\n\n- Run and verify the output before deploying:\n```\ntf -c=gcloud plan -var='teamid=foo' -var='prjid=bar'\n```\n\n- Run below to deploy:\n```\ntf -c=gcloud apply -var='teamid=foo' -var='prjid=bar'\n```\n\n- Run below to destroy:\n```\ntf -c=gcloud destroy -var='teamid=foo' -var='prjid=bar'\n```\n\n**Note:** Read more on [tfremote](https://github.com/tomarv2/tfremote)\n##### PubSub Topic - pull \u0026 push subscription\n```\nterraform {\n  required_version = \"\u003e= 1.0.1\"\n  required_providers {\n    google = {\n      source  = \"hashicorp/google\"\n      version = \"~\u003e 4.12.0\"\n    }\n  }\n}\n\nprovider \"google\" {\n  region  = var.region\n  project = var.project\n}\n\nmodule \"pubsub\" {\n  source = \"../\"\n\n  pull_subscriptions = [\n    {\n      name = \"pull\"\n    },\n  ]\n\n  push_subscriptions = [\n    {\n      name          = \"push\"\n      push_endpoint = \"https://${var.project}.appspot.com/\"\n    },\n  ]\n  #-----------------------------------------------\n  # Note: Do not change teamid and prjid once set.\n  teamid = var.teamid\n  prjid  = var.prjid\n}\n```\n\nPlease refer to examples directory [link](examples) for references.\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | \u003e= 1.0.1 |\n| \u003ca name=\"requirement_google\"\u003e\u003c/a\u003e [google](#requirement\\_google) | ~\u003e 4.12.0 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_google\"\u003e\u003c/a\u003e [google](#provider\\_google) | ~\u003e 4.12.0 |\n\n## Modules\n\nNo modules.\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [google_pubsub_subscription.pull_subscriptions](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/pubsub_subscription) | resource |\n| [google_pubsub_subscription.push_subscriptions](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/pubsub_subscription) | resource |\n| [google_pubsub_topic.topic](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/pubsub_topic) | resource |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_create_topic\"\u003e\u003c/a\u003e [create\\_topic](#input\\_create\\_topic) | Specify true if you want to create a topic | `bool` | `true` | no |\n| \u003ca name=\"input_default_ack_deadline_seconds\"\u003e\u003c/a\u003e [default\\_ack\\_deadline\\_seconds](#input\\_default\\_ack\\_deadline\\_seconds) | Default ack deadline in seconds | `string` | `\"10\"` | no |\n| \u003ca name=\"input_message_storage_policy\"\u003e\u003c/a\u003e [message\\_storage\\_policy](#input\\_message\\_storage\\_policy) | A map of storage policies. Default - inherit from organization's Resource Location Restriction policy. | `map(any)` | `{}` | no |\n| \u003ca name=\"input_prjid\"\u003e\u003c/a\u003e [prjid](#input\\_prjid) | Name of the project/stack e.g: mystack, nifieks, demoaci. Should not be changed after running 'tf apply' | `string` | n/a | yes |\n| \u003ca name=\"input_pull_subscriptions\"\u003e\u003c/a\u003e [pull\\_subscriptions](#input\\_pull\\_subscriptions) | The list of the pull subscriptions | `list(map(string))` | `[]` | no |\n| \u003ca name=\"input_push_subscriptions\"\u003e\u003c/a\u003e [push\\_subscriptions](#input\\_push\\_subscriptions) | The list of the push subscriptions | `list(map(string))` | `[]` | no |\n| \u003ca name=\"input_teamid\"\u003e\u003c/a\u003e [teamid](#input\\_teamid) | Name of the team/group e.g. devops, dataengineering. Should not be changed after running 'tf apply' | `string` | n/a | yes |\n| \u003ca name=\"input_topic_kms_key_name\"\u003e\u003c/a\u003e [topic\\_kms\\_key\\_name](#input\\_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 |\n| \u003ca name=\"input_topic_name\"\u003e\u003c/a\u003e [topic\\_name](#input\\_topic\\_name) | The Pub/Sub topic name | `string` | `null` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_pubsub_pull_message_retention\"\u003e\u003c/a\u003e [pubsub\\_pull\\_message\\_retention](#output\\_pubsub\\_pull\\_message\\_retention) | PubSub pull subscription retention |\n| \u003ca name=\"output_pubsub_pull_subscription_id\"\u003e\u003c/a\u003e [pubsub\\_pull\\_subscription\\_id](#output\\_pubsub\\_pull\\_subscription\\_id) | PubSub pull subscription id |\n| \u003ca name=\"output_pubsub_pull_subscription_name\"\u003e\u003c/a\u003e [pubsub\\_pull\\_subscription\\_name](#output\\_pubsub\\_pull\\_subscription\\_name) | PubSub pull subscription name |\n| \u003ca name=\"output_pubsub_push_message_retention\"\u003e\u003c/a\u003e [pubsub\\_push\\_message\\_retention](#output\\_pubsub\\_push\\_message\\_retention) | PubSub push subscription retention |\n| \u003ca name=\"output_pubsub_push_subscription_id\"\u003e\u003c/a\u003e [pubsub\\_push\\_subscription\\_id](#output\\_pubsub\\_push\\_subscription\\_id) | PubSub push subscription id |\n| \u003ca name=\"output_pubsub_push_subscription_name\"\u003e\u003c/a\u003e [pubsub\\_push\\_subscription\\_name](#output\\_pubsub\\_push\\_subscription\\_name) | PubSub push subscription name |\n| \u003ca name=\"output_pubsub_topic_id\"\u003e\u003c/a\u003e [pubsub\\_topic\\_id](#output\\_pubsub\\_topic\\_id) | PubSub topic id |\n| \u003ca name=\"output_pubsub_topic_name\"\u003e\u003c/a\u003e [pubsub\\_topic\\_name](#output\\_pubsub\\_topic\\_name) | PubSub topic name |\n| \u003ca name=\"output_pubsub_topic_project\"\u003e\u003c/a\u003e [pubsub\\_topic\\_project](#output\\_pubsub\\_topic\\_project) | PubSub topic project |\n\u003c!-- END_TF_DOCS --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomarv2%2Fterraform-google-pubsub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomarv2%2Fterraform-google-pubsub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomarv2%2Fterraform-google-pubsub/lists"}