Skip to content

Commit

Permalink
fix(terraform): update tfstate storage account name
Browse files Browse the repository at this point in the history
Add a '2' suffix after storage account name,
due to "A storage account already exists with this name" error when trying to
recreate infra in new tenant.
  • Loading branch information
Christian Fosli committed Jan 26, 2024
1 parent c55a8a9 commit 5156d98
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
terraform -v
terraform init --input=false \
-backend-config="resource_group_name=rg-snake-${{ env.TF_VAR_ENVIRONMENT }}" \
-backend-config="storage_account_name=stsnake${{ env.TF_VAR_ENVIRONMENT }}" \
-backend-config="storage_account_name=stsnake${{ env.TF_VAR_ENVIRONMENT }}2" \
-backend-config="key=${{ env.TF_VAR_ENVIRONMENT }}.terraform.tfstate"
- name: Validate
Expand Down
2 changes: 1 addition & 1 deletion terraform/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ data "azurerm_resource_group" "rg" {
}

data "azurerm_storage_account" "st" {
name = "stsnake${var.ENVIRONMENT}"
name = "stsnake${var.ENVIRONMENT}2"
resource_group_name = data.azurerm_resource_group.rg.name
}

Expand Down
2 changes: 1 addition & 1 deletion terraform/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
backend "azurerm" {
resource_group_name = "rg-snake-staging"
storage_account_name = "stsnakestaging"
storage_account_name = "stsnakestaging2"
container_name = "tfstate"
key = "staging.terraform.tfstate"
use_oidc = true
Expand Down

0 comments on commit 5156d98

Please sign in to comment.