Skip to content

Commit fa569e9

Browse files
authored
deprecate outdated syntax (#56)
Co-authored-by: zjhe <hezijie@microsoft.com>
1 parent 8bfee22 commit fa569e9

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

.tflint_alt.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ rule "terraform_comment_syntax" {
133133
}
134134

135135
rule "terraform_deprecated_index" {
136-
enabled = false
136+
enabled = true
137137
}
138138

139139
rule "terraform_deprecated_interpolation" {

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ resource "azurerm_lb" "azlb" {
3737
name = var.frontend_name
3838
private_ip_address = var.frontend_private_ip_address
3939
private_ip_address_allocation = var.frontend_private_ip_address_allocation
40-
public_ip_address_id = var.type == "public" ? join("", azurerm_public_ip.azlb.*.id) : ""
40+
public_ip_address_id = try(azurerm_public_ip.azlb[0].id, "")
4141
subnet_id = var.frontend_subnet_id
4242
}
4343
}
@@ -83,5 +83,5 @@ resource "azurerm_lb_rule" "azlb" {
8383
backend_address_pool_ids = [azurerm_lb_backend_address_pool.azlb.id]
8484
enable_floating_ip = false
8585
idle_timeout_in_minutes = 5
86-
probe_id = element(azurerm_lb_probe.azlb.*.id, count.index)
86+
probe_id = element(azurerm_lb_probe.azlb[*].id, count.index)
8787
}

outputs.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@ output "azurerm_lb_id" {
1515

1616
output "azurerm_lb_nat_rule_ids" {
1717
description = "the ids for the azurerm_lb_nat_rule resources"
18-
value = azurerm_lb_nat_rule.azlb.*.id
18+
value = azurerm_lb_nat_rule.azlb[*].id
1919
}
2020

2121
output "azurerm_lb_probe_ids" {
2222
description = "the ids for the azurerm_lb_probe resources"
23-
value = azurerm_lb_probe.azlb.*.id
23+
value = azurerm_lb_probe.azlb[*].id
2424
}
2525

2626
output "azurerm_public_ip_address" {
2727
description = "the ip address for the azurerm_lb_public_ip resource"
28-
value = azurerm_public_ip.azlb.*.ip_address
28+
value = azurerm_public_ip.azlb[*].ip_address
2929
}
3030

3131
output "azurerm_public_ip_id" {
3232
description = "the id for the azurerm_lb_public_ip resource"
33-
value = azurerm_public_ip.azlb.*.id
33+
value = azurerm_public_ip.azlb[*].id
3434
}
3535

3636
output "azurerm_resource_group_name" {

0 commit comments

Comments
 (0)