Skip to content
Closed
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
10 changes: 10 additions & 0 deletions modules/vpc/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resource "aws_vpc" "vpc-main" {
cidr_block = var.cidr_block
enable_dns_support = var.enable_dns_support
enable_dns_hostnames = var.enable_dns_hostnames

tags = ({
Name = var.name
})

}
9 changes: 9 additions & 0 deletions modules/vpc/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
output "vpc_id" {
description = "VPC Identifier"
value = aws_vpc.vpc-main.id
}

output "vpc_cidr_block" {
description = "VPC CIDR Block"
value = aws_vpc.vpc-main.cidr_block
}
28 changes: 28 additions & 0 deletions modules/vpc/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
variable "name" {
description = "The name of the VPC"
type = string

}

variable "cidr_block" {
description = "CIDR block for the VPC"
type = string
default = "10.0.0.0/16"

}

variable "enable_dns_support" {
description = "CIDR block for the VPC"
type = bool
default = true

}

variable "enable_dns_hostnames" {
description = "CIDR block for the VPC"
type = bool
default = true

}


9 changes: 9 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
output "vpc_id" {
description = "VPC Identifier"
value = module.vpc-main.id
}

output "vpc_cidr_block" {
description = "VPC CIDR Block"
value = module.vpc-main.cidr_block
}
31 changes: 31 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
variable "name" {
description = "The name of the VPC"
type = string
default = "vpc-main"

}

variable "cidr_block" {
description = "CIDR block for the VPC"
type = string
default = "10.0.0.0/16"

}

variable "enable_dns_support" {
description = "CIDR block for the VPC"
type = bool
default = true

}

variable "enable_dns_hostnames" {
description = "CIDR block for the VPC"
type = bool
default = true

}




8 changes: 8 additions & 0 deletions vpc.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module "vpc-main" {
source = "./modules/vpc"
name = var.name
cidr_block = var.cidr_block
enable_dns_support = var.enable_dns_support
enable_dns_hostnames = var.enable_dns_hostnames

}
Loading