Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove try function from outputs #41

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading