Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion DevOps-Project-01/infrastructure/modules/vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ resource "aws_subnet" "private" {
# Elastic IP for NAT Gateway
resource "aws_eip" "nat" {
count = length(var.public_subnets)
vpc = true
domain = "vpc"

tags = {
Name = "${var.environment}-nat-eip-${count.index + 1}"
Expand Down
37 changes: 36 additions & 1 deletion DevOps-Project-01/infrastructure/modules/vpc/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,39 @@ output "nat_gateway_ids" {
output "vpc_cidr_block" {
description = "CIDR block of the VPC"
value = aws_vpc.main.cidr_block
}
}

output "vpc_name" {
description = "Name tag of the VPC"
value = aws_vpc.main.tags.Name
}

output "internet_gateway_id" {
description = "ID of the Internet Gateway"
value = aws_internet_gateway.main.id
}

output "public_route_table_ids" {
description = "ID of the public route table"
value = aws_route_table.public.id
}

output "private_route_table_ids" {
description = "List of IDs of private route tables"
value = aws_route_table.private[*].id
}

output "public_subnet_cidrs" {
description = "List of CIDR blocks of public subnets"
value = aws_subnet.public[*].cidr_block
}

output "private_subnet_cidrs" {
description = "List of CIDR blocks of private subnets"
value = aws_subnet.private[*].cidr_block
}

output "nat_gateway_elastic_ips" {
description = "List of Elastic IP addresses associated with NAT Gateways"
value = aws_eip.nat[*].public_ip
}