Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added random suffix to bucket names to allow easy recreation. #3

Merged
merged 1 commit into from
Nov 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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