Skip to content

Commit 7fee659

Browse files
franviera92ext_cviera
andauthored
fix: add grant_token_creator flag for pubsub (#52)
* chore: config grant_token_creator in module pubsub * chore: update readme Co-authored-by: ext_cviera <[email protected]>
1 parent 6d001bb commit 7fee659

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Then perform the following commands on the root folder:
5353
| function\_source\_dependent\_files | A list of any terraform created `local_file`s that the module will wait for before creating the archive. | object | `<list>` | no |
5454
| function\_source\_directory | The contents of this directory will be archived and used as the function source. | string | n/a | yes |
5555
| function\_timeout\_s | The amount of time in seconds allotted for the execution of the function. | number | `"60"` | no |
56+
| grant\_token\_creator | Specify true if you want to add token creator role to the default Pub/Sub SA | bool | `"false"` | no |
5657
| job\_description | Addition text to describe the job | string | `""` | no |
5758
| job\_name | The name of the scheduled job to run | string | `"null"` | no |
5859
| job\_schedule | The job frequency, in cron syntax | string | `"*/2 * * * *"` | no |

main.tf

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@ resource "google_cloud_scheduler_job" "job" {
3939
*****************************************/
4040

4141
module "pubsub_topic" {
42-
source = "terraform-google-modules/pubsub/google"
43-
version = "~> 1.0"
44-
topic = var.topic_name
45-
project_id = var.project_id
46-
create_topic = var.scheduler_job == null ? true : false
42+
source = "terraform-google-modules/pubsub/google"
43+
version = "~> 1.0"
44+
topic = var.topic_name
45+
project_id = var.project_id
46+
create_topic = var.scheduler_job == null ? true : false
47+
grant_token_creator = var.grant_token_creator
4748
}
4849

4950
/******************************************

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,9 @@ variable "scheduler_job" {
155155
description = "An existing Cloud Scheduler job instance"
156156
default = null
157157
}
158+
159+
variable "grant_token_creator" {
160+
type = bool
161+
description = "Specify true if you want to add token creator role to the default Pub/Sub SA"
162+
default = false
163+
}

0 commit comments

Comments
 (0)