{"id":22474788,"url":"https://github.com/574n13y/google-pub-subtopic","last_synced_at":"2025-03-27T16:47:12.478Z","repository":{"id":214605422,"uuid":"736923419","full_name":"574n13y/Google-Pub-Subtopic","owner":"574n13y","description":"Develop Terraform code for creating and managing Google Pub/Subtopic.","archived":false,"fork":false,"pushed_at":"2023-12-31T11:07:29.000Z","size":47,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T20:30:29.237Z","etag":null,"topics":["gcp","pubsub","pubsub-subscriber","terraform","terraform-module","terraform-provider","terraform-workspace","topic"],"latest_commit_sha":null,"homepage":"https://574n13y.github.io/Google-Pub-Subtopic/","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/574n13y.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-29T09:13:46.000Z","updated_at":"2023-12-30T13:01:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"d0e600a3-bad0-4ceb-a2ae-2d50c9f8c79c","html_url":"https://github.com/574n13y/Google-Pub-Subtopic","commit_stats":null,"previous_names":["574n13y/google-pub-subtopic"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/574n13y%2FGoogle-Pub-Subtopic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/574n13y%2FGoogle-Pub-Subtopic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/574n13y%2FGoogle-Pub-Subtopic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/574n13y%2FGoogle-Pub-Subtopic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/574n13y","download_url":"https://codeload.github.com/574n13y/Google-Pub-Subtopic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245888071,"owners_count":20688893,"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":["gcp","pubsub","pubsub-subscriber","terraform","terraform-module","terraform-provider","terraform-workspace","topic"],"created_at":"2024-12-06T13:11:26.579Z","updated_at":"2025-03-27T16:47:12.472Z","avatar_url":"https://github.com/574n13y.png","language":"HCL","readme":"# Google-Pub-Subtopic\nDevelop Terraform code for creating and managing Google Pub/Subtopic.\n[![Website](https://github.com/574n13y/Google-Pub-Subtopic/actions/workflows/jekyll-gh-pages.yml/badge.svg)](https://github.com/574n13y/Google-Pub-Subtopic/actions/workflows/jekyll-gh-pages.yml)\n\n## GCP \n - Create a GCP account in case you don't have one.\n - Once GCP account is created -\u003e Create Project\n - Navigate  to \"IAM \u0026 Admin\" -\u003e click on service account\n   ![iam](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/70f40fa7-df9f-4383-a4c4-fd0529864667)\n  \n - Create a service account -\u003e Give nessary permission's as per your requirement.\n   ![iam 1](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/a3b4e7a2-0c6d-4fd5-a3ed-23b8d08a40bb)\n   \n - Click on Created (in my case i have created terraform service account) service account navigate to \"key\" -\u003e click on \"ADD KEY\"\n   ![iam 2](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/f508fb6b-26e7-41f4-b03c-6d0b3e584880)\n\n - Click on create new key -\u003e Select json file  - Click on create.\n   ![iam 3](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/201b3b4e-9c50-4ab7-9b8a-0d3ed46f3daf)\n\n - Once key is created, private key will be downloaded in you local pc, rename it to key.json\n   ![iam 4](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/42c0b942-ea79-4044-87fe-196818889846)\n   ![iam 5](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/13520d82-8e83-4d44-9fa6-d70499d4e306)\n\n - Before starting with the terraform code make sure to 'enable' pub/sub service from marketplace\n\n## Github\n  - Create a Repo\n  - Write a code for creating and managing Google Pub/Subtopic.\n  - Here is the demo code i created,  you can use this  or you can use my code [main.tf]()\n    ```\n    # main.tf\n\n    provider \"google\" {\n    credentials = file(\"\u003cpath-to-service-account-key\u003e\")\n    project     = \"\u003cyour-project-id\u003e\"\n     region      = \"us-central1\"  # Update with your desired region\n    }\n\n    module \"pubsub_topic\" {\n     source = \"./modules/pubsub-topic\"\n\n      topic_name = \"example-topic\"\n    }\n\n\n\n     # modules/pubsub-topic/main.tf\n\n    variable \"topic_name\" {\n     description = \"The name of the Pub/Sub topic\"\n     type        = string\n     }\n\n    resource \"google_pubsub_topic\" \"pubsub_topic\" {\n     name = var.topic_name\n    }\n\n    ```\n    ![main](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/5ede0542-37ee-4425-86b0-3b8298b34813)\n    ![Github](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/f0017deb-04ac-4162-a4e8-9f1e4b9562f4)\n\n   - upload the key.json\n     ![service account key](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/8a4d09be-b4cc-4beb-be36-856feb71cb63)\n\n    \n\n## Terraform cloud \n  - [Login to Terraform cloud](https://app.terraform.io/session?redirect_to=%2Fapp%2Fgetting-started)\n    ![terra 0](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/34517a87-55f5-4579-9596-77631601f2f0)\n\n  - Create a workspace\n    ![terra 1](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/5113c6f1-436f-4dcf-b2e7-64502abe4f2b)\n\n  - Click on Version control -\u003e select github -\u003e  authenticate it with your github account -\u003e select github repo -\u003e Click on Create\n    ![terra](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/45eb4230-c38e-47ea-8fa1-1a406231ff74)\n\n  - Once workspace is created Add variable value and save it.\n     ![terra 2](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/ed32d306-cd64-4b42-bd0b-89da263a0563)\n    \n  - Click on Start new Plan\n    ![terra 3](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/ef3f7d3b-128d-4d05-bf94-2949aeee6a06)\n\n  - Terraform cloud will run the plan and show to the ouptup for the same.\n    ![terraformcloud plan](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/407d701d-f03f-48b1-871b-9eb2a02e4fd9)\n\n  - Now cick on apply to make changes -\u003e it will create a pubsub topic.\n    ![applyper](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/a503ac01-6e3e-4428-b58c-1b8434bebae0)\n    ![apply](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/67356d69-047f-4dc7-8bba-8956e7f27721)\n\n## Valiadtion \n\n  - Plan\n    ![plan 1](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/38da78ba-1177-4c9b-9a5d-175c3c33bc71)\n    ![plan 2](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/51071ff6-25df-41e3-bf81-bbc7d12a74f8)\n    ![plan 3](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/bbf8ffab-c433-4ab3-b11e-fa35a700546b)\n    \n  - Apply\n    ![apply 1](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/fa6887f7-f355-48b4-a3d6-def93018cd97)\n    ![apply 2](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/10c7b5e0-6d12-49d5-b7b1-f0ab875d0c51)\n    ![apply 3](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/c36df16b-6dfc-433a-86c2-5825d9570600)\n    \n  - topics\n    ![top](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/1230c276-8d70-454b-9143-9960f9e81f86)\n    ![top-details](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/3858fbc4-01c6-4c8e-8dc4-5e58329d7872)\n    ![topics](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/1f6ce694-9dc2-4d6c-a878-4f9f6006ca86)\n    ![ps request](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/cf9c0e12-6e62-454a-957f-5600bac894e8)\n    ![ps](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/715cccf2-ea22-4578-bedd-b1c0e6876143)\n\n  - Subscriptions\n    ![subscriptions](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/0a8d38e0-fe9c-43a3-af16-000c835abe75)\n    ![sub details](https://github.com/574n13y/Google-Pub-Subtopic/assets/35293085/237ad58a-7569-453f-af38-7043ddc8df76)\n\n\n                                                                      ***\n\n\n\n    \n   \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F574n13y%2Fgoogle-pub-subtopic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F574n13y%2Fgoogle-pub-subtopic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F574n13y%2Fgoogle-pub-subtopic/lists"}