-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Expand file tree
/
Copy pathoutputs.tf
More file actions
64 lines (53 loc) · 1.52 KB
/
outputs.tf
File metadata and controls
64 lines (53 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Essential VPC outputs
output "vpc_id" {
description = "ID of the VPC"
value = aws_vpc.main.id
}
output "vpc_cidr_block" {
description = "CIDR block of the VPC"
value = aws_vpc.main.cidr_block
}
output "vpc_name" {
description = "Name of the VPC from tags"
value = lookup(aws_vpc.main.tags, "Name", null)
}
# Subnets
output "public_subnet_ids" {
description = "List of public subnet IDs"
value = aws_subnet.public[*].id
}
output "private_subnet_ids" {
description = "List of private subnet IDs"
value = aws_subnet.private[*].id
}
output "public_subnet_cidrs" {
description = "CIDR blocks of public subnets"
value = aws_subnet.public[*].cidr_block
}
output "private_subnet_cidrs" {
description = "CIDR blocks of private subnets"
value = aws_subnet.private[*].cidr_block
}
# NAT Gateways
output "nat_gateway_ids" {
description = "List of NAT Gateway IDs"
value = aws_nat_gateway.main[*].id
}
output "nat_gateway_elastic_ips" {
description = "Elastic IPs associated with NAT Gateways"
value = aws_eip.nat[*].public_ip
}
# Internet Gateway
output "internet_gateway_id" {
description = "ID of the Internet Gateway attached to the VPC"
value = aws_internet_gateway.main.id
}
# Route Tables
output "public_route_table_ids" {
description = "List of public route table IDs"
value = aws_route_table.public[*].id
}
output "private_route_table_ids" {
description = "List of private route table IDs"
value = aws_route_table.private[*].id
}