Skip to content

Commit

Permalink
Merge pull request #41 from clouddrove/fix/outputs
Browse files Browse the repository at this point in the history
fix: Remove try function from outputs
  • Loading branch information
d4kverma authored Jul 26, 2024
2 parents c008d1f + 260cef1 commit 0d61535
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
output "specific_subnet_name" {
value = try(azurerm_subnet.subnet[*].name, null)
value = var.specific_name_subnet ? azurerm_subnet.subnet[*].name : null
description = "The name of the subnet."
}

output "specific_subnet_id" {
value = try(azurerm_subnet.subnet[*].id, null)
value = var.specific_name_subnet ? azurerm_subnet.subnet[*].id : null
description = "The name of the subnet."
}

output "specific_subnet_address_prefixes" {
value = try(azurerm_subnet.subnet[*].address_prefixes, null)
value = var.specific_name_subnet ? azurerm_subnet.subnet[*].address_prefixes : null
description = "The address prefixes for the subnet."
}

output "default_subnet_name" {
value = try(azurerm_subnet.subnet[*].name, null)
value = !var.specific_name_subnet ? azurerm_subnet.subnet[*].name : null
description = "The name of the subnet."
}

output "default_subnet_id" {
value = try(azurerm_subnet.subnet[*].id, null)
value = !var.specific_name_subnet ? azurerm_subnet.subnet[*].id : null
description = "The subnet ID."
}

output "default_subnet_address_prefixes" {
value = try(azurerm_subnet.subnet[*].address_prefixes, null)
value = !var.specific_name_subnet ? azurerm_subnet.subnet[*].address_prefixes : null
description = "The address prefixes for the subnet."
}

output "nat_gateway_id" {
value = try(azurerm_nat_gateway.natgw[0].id, null)
value = var.create_nat_gateway ? azurerm_nat_gateway.natgw[0].id : null
description = "The ID of the NAT Gateway."
}

output "public_ip_address" {
value = try(azurerm_public_ip.pip[0].ip_address, null)
value = var.create_nat_gateway ? azurerm_public_ip.pip[0].ip_address : null
description = "The IP address value that was allocated."
}

output "public_ip_id" {
value = try(azurerm_public_ip.pip[0].id, null)
value = var.create_nat_gateway ? azurerm_public_ip.pip[0].id : null
description = " The ID of this Public IP."
}

Expand Down

0 comments on commit 0d61535

Please sign in to comment.