Skip to content

Commit c115649

Browse files
committed
fix(production-ready-azure): pass var.app_name to storage module to avoid name drift
1 parent 2ec4321 commit c115649

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

  • terraform-tutorial/terraform-production-ready-azure/assets/stage

terraform-tutorial/terraform-production-ready-azure/assets/stage/step3/main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ module "data" {
9393
module "storage" {
9494
source = "./modules/storage"
9595

96-
app_name = local.app_name
96+
# 注意:传入 var.app_name(不带 -lab 后缀)以保持与 step1/2 中
97+
# 硬编码的 storage account 名称一致,避免触发资源重建。
98+
app_name = var.app_name
9799
environment = var.environment
98100
resource_group_name = module.networking.resource_group_name
99101
location = module.networking.location

terraform-tutorial/terraform-production-ready-azure/assets/stage/step4/main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ module "data" {
9393
module "storage" {
9494
source = "./modules/storage"
9595

96-
app_name = local.app_name
96+
# 注意:传入 var.app_name(不带 -lab 后缀)以保持与 step1/2 中
97+
# 硬编码的 storage account 名称一致,避免触发资源重建。
98+
app_name = var.app_name
9799
environment = var.environment
98100
resource_group_name = module.networking.resource_group_name
99101
location = module.networking.location

terraform-tutorial/terraform-production-ready-azure/assets/stage/step5/storage/main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ locals {
3737
module "storage" {
3838
source = "../modules/storage"
3939

40-
app_name = local.app_name
40+
# 注意:传入 var.app_name(不带 -lab 后缀),与 step1/2 中
41+
# 硬编码的 storage account 名称保持一致,避免触发资源重建。
42+
app_name = var.app_name
4143
environment = var.environment
4244
resource_group_name = var.resource_group_name
4345
location = var.location

0 commit comments

Comments
 (0)