mattcowen / forefront-lz

A landing zone for secure deployments
Apache License 2.0
5 stars 1 forks source link

The storage account named ffeslzstates is already taken #13

Closed gareththegeek closed 3 years ago

gareththegeek commented 3 years ago

When deploying terraform bootstrap, I receive the following error because a previous deployment has taken the name ffeslzstates.

The name should probably include a pseudo-random element.

│ Error: creating Azure Storage Account "ffeslzstates": storage.AccountsClient#Create: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status= Code="StorageAccountAlreadyTaken" Message="The storage account named ffeslzstates is already taken." │ │ with azurerm_storage_account.tf_state_sa, │ on main.tf line 15, in resource "azurerm_storage_account" "tf_state_sa": │ 15: resource "azurerm_storage_account" "tf_state_sa" { │ ╵

gareththegeek commented 3 years ago

Just realised this is a variable so will specify manually

gareththegeek commented 3 years ago

Workaround is to modify the deploy.sh file to specify new values for the storage account, container registry and key vault names. Would be nice to either pseudo-randomly generate names or make it easier to provide as parameters and update documentation.

terraform plan -var state_sa_name="ffeslzstatesgjw" -var shared_acr_name="ffeslzacrgjw" -var shared_keyvault_name="ffeslzkvgjw" -out=tfplan $1