Commit 5a4227e7 authored by Adam Robinson's avatar Adam Robinson
Browse files

handle customer service account length limitations

parent 0a5d7e25
locals {
short_mcomm = lower(replace(split("@", var.mcomm_group_email)[0],".","-"))
customer_service_account_suffix = "-${var.division}-tf"
customer_service_account_prefix = substr(local.short_mcomm,0,30-length(local.customer_service_account_suffix))
customer_service_account_id = "${local.customer_service_account_prefix}${local.customer_service_account_suffix}"
division_folder_ids = {
dev = {
//its = ""
......@@ -95,8 +100,8 @@ resource "google_storage_bucket" "customer_bucket" {
}
resource "google_service_account" "customer_service_account" {
project = var.customer_service_account_project_id
account_id = "${local.short_mcomm}-tf"
project = var.customer_service_account_project_id
account_id = local.customer_service_account_id
description = "${local.short_mcomm} Terraform Service Account"
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment