Skip to content

AshwitaPal12/vnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-azure-vnet

Lint Status LICENSE

This module creates the basic and advance network resources for a region.

Prerequisites

Name Version
terraform >= 1.3.0

Before you begin, ensure you have the following installed:

  • Terraform (version X.XX.X)
  • Azure CLI (version X.XX.X)
  • Azure Subscription

Getting Started

Follow the steps below to get started with the project:

  1. Clone this repository to your local machine.
  2. Authenticate the Azure CLI with your Azure Subscription using az login.
  3. Initialize Terraform by running terraform init.
  4. If you want to create VNet with advanced subnet settings (enable natgateway , user defined security rule per subnet) etc.. then choose the vnet-advance module in example module.

Variables

The project uses the following variables:

  • location: The Azure region where resources will be created.
  • resource_group_name: The name of the resource group where resources will be provisioned.
  • vnet_name: The name of the Virtual Network.
  • subnet_type: The type of subnets to create.
  • subnet_bits: The number of simple subnets to create (used when subnet_type = "subnet-simple").

Usage

To provision the resources, modify the variables in variables.tf to match your desired configuration. Then, run the following Terraform commands:

  1. terraform init: Initializes the Terraform configuration.
  2. terraform plan: Shows the execution plan for the resources.
  3. terraform apply: Applies the changes and creates the Azure resources.

Modules

Name Source
nsg ./modules/nsg
route_table ./modules/route_table
subnets .modules/subnets
vnet ./modules/vnet

Resources

Name Type
azurerm_virtual_network.main resource
azurerm_network_security_group.main resource
azurerm_route_table.main resource
azurerm_subnet.subnets resource
azurerm_resource_group.rg resource
azurerm_subnet_route_table_association.main resource
azurerm_subnet_network_security_group_association resource

Inputs

Name Description Type
subnet_type define the type of the subnet for subnet_simple string
address_space specify the CIDR Block for vnet string
subnet_bits define the number of subnet_simple creates number
resource_group_name specify the name of the resource group string
location specify the location of the vnet string
subnets specify the subnets name having cidr_ranges and is_public variable etc..
map(object({
is_public = bool
cidr_block = string
}))

Terraform Commands

Below are some useful Terraform commands for managing the project:

  • terraform init: Initializes the Terraform configuration.
  • terraform validate: To validate the syntax of the configuration.
  • terraform plan: Shows the execution plan for the resources.
  • terraform apply: Applies the changes and creates the Azure resources.
  • terraform destroy: Destroys all resources created by Terraform.

Authors

Module managed by TO THE NEW Pvt. Ltd.

License

Apache 2 Licensed. See LICENSE for full details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages