Skip to content

Commit

Permalink
fix!: replace random_id with random_string to increase number of poss…
Browse files Browse the repository at this point in the history
…ible access levels (#191)
  • Loading branch information
daniel-cit authored Apr 8, 2024
1 parent e21770f commit f6cd4b2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions modules/secure-serverless-harness/service_perimeter.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

locals {
prefix = "secure_cloud_run"
access_level_name = "alp_${local.prefix}_members_${random_id.random_access_level_suffix.hex}"
perimeter_name = "sp_${local.prefix}_perimeter_${random_id.random_access_level_suffix.hex}"
access_level_name = "alp_${local.prefix}_members_${random_string.random_access_level_suffix.result}"
perimeter_name = "sp_${local.prefix}_perimeter_${random_string.random_access_level_suffix.result}"
access_context_manager_policy_id = var.create_access_context_manager_access_policy ? google_access_context_manager_access_policy.access_policy[0].id : var.access_context_manager_policy_id
access_level_members = concat(var.access_level_members,
[for project in module.serverless_project : "serviceAccount:${project.services_identities["cloudbuild"]}"],
Expand All @@ -26,8 +26,12 @@ locals {
)
}

resource "random_id" "random_access_level_suffix" {
byte_length = 2
resource "random_string" "random_access_level_suffix" {
length = 4
lower = true
numeric = true
upper = false
special = false
}

/******************************************
Expand Down

0 comments on commit f6cd4b2

Please sign in to comment.