Files
Aws-Terraform/modules/network_public/outputs.tf
T

64 lines
2.5 KiB
Terraform

output "vpc_id" {
description = "Managed VPC ID for dependent modules."
value = local.vpc.id
}
output "subnet_ids" {
description = "Managed subnet IDs keyed by the caller's logical names."
value = local.subnet_ids
}
output "key_pair_name" {
description = "Managed EC2 key pair name for dependent instances."
value = aws_key_pair.amazon.key_name
}
output "web_instance_name" {
description = "Resolved Name tag for the public web instance."
value = local.web_instance_name
}
output "ssh_security_group_name" {
description = "Resolved name for the public SSH security group."
value = local.ssh_security_group_name
}
output "named_resource_names" {
description = "Names and Name tags for explicitly named managed resources."
value = merge(
{
vpc = lookup(local.vpc.tags, "Name", "")
internet_gateway = var.protect_from_destroy ? lookup(aws_internet_gateway.protected[0].tags, "Name", "") : lookup(aws_internet_gateway.unprotected[0].tags, "Name", "")
route_table_dmz = var.protect_from_destroy ? lookup(aws_default_route_table.protected[0].tags, "Name", "") : lookup(aws_default_route_table.unprotected[0].tags, "Name", "")
route_table_intra = var.protect_from_destroy ? lookup(aws_route_table.protected[0].tags, "Name", "") : lookup(aws_route_table.unprotected[0].tags, "Name", "")
dhcp_options = lookup(aws_vpc_dhcp_options.this.tags, "Name", "")
key_pair = aws_key_pair.amazon.key_name
public_security_group = aws_security_group.web.name
web_instance = local.web_instance_name
flow_log_s3 = lookup(aws_flow_log.s3.tags, "Name", "")
flow_log_cloudwatch = lookup(aws_flow_log.cloudwatch.tags, "Name", "")
},
{
for key, subnet in merge(aws_subnet.protected, aws_subnet.unprotected) :
"subnet_${key}" => lookup(subnet.tags, "Name", "")
},
)
}
output "vyos_route_network_interface_ids" {
description = "VyOS ENI targets on the five managed private/default routes."
value = {
for key in ["dmz_private_a", "dmz_private_b", "intra_private_a", "intra_private_b", "intra_default"] :
key => aws_route.this[key].network_interface_id
}
}
output "vyos_source_security_group_ids" {
description = "VyOS source security group IDs on the managed public ingress rules."
value = {
for key, rule in aws_vpc_security_group_ingress_rule.web :
key => rule.referenced_security_group_id
if var.ssh_ingress_rules[key].use_vyos_security_group
}
}