Skip to content

Commit

Permalink
deprecate outdated syntax (#56)
Browse files Browse the repository at this point in the history
Co-authored-by: zjhe <[email protected]>
  • Loading branch information
lonegunmanb and lonegunmanb authored Jan 17, 2023
1 parent 8bfee22 commit fa569e9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .tflint_alt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ rule "terraform_comment_syntax" {
}

rule "terraform_deprecated_index" {
enabled = false
enabled = true
}

rule "terraform_deprecated_interpolation" {
Expand Down
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ resource "azurerm_lb" "azlb" {
name = var.frontend_name
private_ip_address = var.frontend_private_ip_address
private_ip_address_allocation = var.frontend_private_ip_address_allocation
public_ip_address_id = var.type == "public" ? join("", azurerm_public_ip.azlb.*.id) : ""
public_ip_address_id = try(azurerm_public_ip.azlb[0].id, "")
subnet_id = var.frontend_subnet_id
}
}
Expand Down Expand Up @@ -83,5 +83,5 @@ resource "azurerm_lb_rule" "azlb" {
backend_address_pool_ids = [azurerm_lb_backend_address_pool.azlb.id]
enable_floating_ip = false
idle_timeout_in_minutes = 5
probe_id = element(azurerm_lb_probe.azlb.*.id, count.index)
probe_id = element(azurerm_lb_probe.azlb[*].id, count.index)
}
8 changes: 4 additions & 4 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ output "azurerm_lb_id" {

output "azurerm_lb_nat_rule_ids" {
description = "the ids for the azurerm_lb_nat_rule resources"
value = azurerm_lb_nat_rule.azlb.*.id
value = azurerm_lb_nat_rule.azlb[*].id
}

output "azurerm_lb_probe_ids" {
description = "the ids for the azurerm_lb_probe resources"
value = azurerm_lb_probe.azlb.*.id
value = azurerm_lb_probe.azlb[*].id
}

output "azurerm_public_ip_address" {
description = "the ip address for the azurerm_lb_public_ip resource"
value = azurerm_public_ip.azlb.*.ip_address
value = azurerm_public_ip.azlb[*].ip_address
}

output "azurerm_public_ip_id" {
description = "the id for the azurerm_lb_public_ip resource"
value = azurerm_public_ip.azlb.*.id
value = azurerm_public_ip.azlb[*].id
}

output "azurerm_resource_group_name" {
Expand Down

0 comments on commit fa569e9

Please sign in to comment.