Skip to content

Commit

Permalink
Merge pull request aztfmod#153 from Azure/AL-launchpadfix
Browse files Browse the repository at this point in the history
Launchpad count error
  • Loading branch information
arnaudlh authored Mar 24, 2021
2 parents b210c99 + 63b52ff commit 23d4ce9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 deletions landingzones/caf_launchpad/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
}
azuread = {
source = "hashicorp/azuread"
version = "~> 1.0.0"
version = "~> 1.4.0"
}
random = {
source = "hashicorp/random"
Expand Down Expand Up @@ -41,15 +41,16 @@ provider "azurerm" {
}
}


resource "random_string" "prefix" {
count = var.prefix == null ? 1 : 0
length = 4
special = false
upper = false
number = false
}

resource "random_string" "alpha1" {
count = var.prefix == null ? 1 : 0
length = 1
special = false
upper = false
Expand All @@ -62,20 +63,18 @@ locals {
}
tags = merge(local.landingzone_tag, { "level" = var.landingzone.level }, { "environment" = var.environment }, { "rover_version" = var.rover_version }, var.tags)

prefix = var.prefix == null ? random_string.prefix.result : var.prefix

global_settings = {
prefix = local.prefix
prefix_with_hyphen = local.prefix == "" ? "" : "${local.prefix}-"
prefix_start_alpha = local.prefix == "" ? "" : "${random_string.alpha1.result}${local.prefix}"
default_region = var.default_region
environment = var.environment
regions = var.regions
inherit_tags = var.inherit_tags
passthrough = var.passthrough
prefix = var.prefix
prefixes = var.prefix == "" ? null : [try(var.prefix, random_string.prefix.0.result)]
prefix_with_hyphen = var.prefix == "" ? "" : try(format("%s-", var.prefix) , format("%s-", random_string.prefix.0.result))
random_length = var.random_length
inherit_tags = var.inherit_tags
use_slug = var.use_slug
regions = var.regions
tags = var.tags
use_slug = var.use_slug
}

tfstates = map(
Expand Down
2 changes: 1 addition & 1 deletion landingzones/caf_launchpad/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,4 @@ variable azurerm_routes {

variable keyvault_access_policies_azuread_apps {
default = {}
}
}

0 comments on commit 23d4ce9

Please sign in to comment.