# Outputs ====================================================================

output "id" {
  description = "Transit Gateway ID."
  value       = aws_ec2_transit_gateway.this.id
}

output "arn" {
  description = "Transit Gateway ARN."
  value       = aws_ec2_transit_gateway.this.arn
}

output "default_route_table_id" {
  description = "Default TGW route table ID."
  value       = aws_ec2_transit_gateway.this.association_default_route_table_id
}

output "route_table_ids" {
  description = "Map of logical route table key to TGW route table ID."
  value       = { for k, v in aws_ec2_transit_gateway_route_table.this : k => v.id }
}

output "ram_share_arn" {
  description = "RAM resource share ARN. Null if RAM sharing is not configured."
  value       = try(aws_ram_resource_share.this["share"].arn, null)
}

output "ram_share_name" {
  description = "RAM resource share name. Null if RAM sharing is not configured."
  value       = try(aws_ram_resource_share.this["share"].name, null)
}

output "ram_principal_ids" {
  description = "List of principals the TGW has been shared with via RAM."
  value       = [for p in aws_ram_principal_association.this : p.principal]
}
