Skip to content

Commit

Permalink
Merge pull request #3 from terraform-google-modules/ocervell-patch-cf…
Browse files Browse the repository at this point in the history
…-bucket

Update main.tf
  • Loading branch information
morgante authored Nov 7, 2019
2 parents 31f528f + 32dd0a3 commit 665246c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/slo/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@
locals {
full_name = "slo-${var.config.service_name}-${var.config.feature_name}-${var.config.slo_name}"
pubsub_configs = [for e in var.config.exporters : e if lower(e.class) == "pubsub"]
suffix = random_id.suffix.hex
}


resource "random_id" "suffix" {
byte_length = 2
}

resource "google_service_account" "main" {
account_id = local.full_name
project = var.project_id
Expand Down Expand Up @@ -57,7 +62,7 @@ module "slo-cloud-function" {
job_schedule = var.schedule
job_name = local.full_name
topic_name = local.full_name
bucket_name = local.full_name
bucket_name = "${local.full_name}-${local.suffix}"
function_name = local.full_name
function_description = var.config.slo_description
function_entry_point = "main"
Expand Down

0 comments on commit 665246c

Please sign in to comment.