Skip to content

About This terraform module is designed to create Azure Subnet resources. Virtual networks and virtual machines in Azure. Microsoft Learn A subnet is a range of IP addresses in the virtual network. You can divide a virtual network into multiple subnets for organization and security. Each NIC in a VM is connected to one subnet in one virtual network

License

Notifications You must be signed in to change notification settings

terraform-az-modules/terraform-azure-subnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Terraform Azure Module Template

With our comprehensive DevOps toolkit - streamline operations, automate workflows, enhance collaboration and, most importantly, deploy with confidence.

Terraform Licence Changelog


We are a group of DevOps engineers & architects, joining hands in this ever evolving digital landscape. With our strong belief in Automation; just like microservices, always on the lookout to split the the infrastructure into smaller connected resources (database, cluster and more) which could be standardized, are manageable, scalable, secure & follow industry best practices.

This module includes Terraform open source, examples, and automation tests (for better understanding), which would help you create and improve your infrastructure with minimalistic coding.

Prerequisites and Providers

This table contains both Prerequisites and Providers:

Description Name Version
Prerequisite Terraform >= 1.6.6
Provider azure >= 3.116.0

Examples

IMPORTANT: Since the master branch used in source varies based on new modifications, we recommend using the release versions.

πŸ“Œ For additional usage examples, check the complete list under examples/ directory.

Inputs and Outputs

Inputs

Name Description Type Default Required
allocation_method Defines the allocation method for this IP address. Possible values are Static or Dynamic. string "Static" no
deployment_mode Specifies how the infrastructure/resource is deployed string "terraform" no
enable Flag to control the module creation bool true no
enable_nat_gateway Flag to control route table creation. bool false no
enable_route_table Flag to control route table creation. bool false no
environment Environment (e.g. prod, dev, staging). string null no
extra_tags Variable to pass extra tags. map(string) null no
label_order Label order, e.g. name,application,centralus. list(any)
[
"name",
"environment",
"location"
]
no
location The location/region where the virtual network is created. string "" no
managedby ManagedBy, eg 'terraform-az--modules'. string "terraform-az-modules" no
name Name (e.g. app or cluster). string null no
nat_gateways List of NAT Gateways to create
list(object({
name = string
sku_name = optional(string, "Standard")
nat_gateway_idle_timeout = optional(number, 4)
zones = optional(list(string), [])
}))
[] no
network_security_group_id Resource id for network security group string null no
nsg_association Flag to control the nsg association bool false no
repository Terraform current module repo string "https://github.com/clouddrove/terraform-azure-subnet.git" no
resource_group_name The name of an existing resource group to be imported. string null no
resource_position_prefix Controls the placement of the resource type keyword (e.g., "vnet", "ddospp") in the resource name.

- If true, the keyword is prepended: "vnet-core-dev".
- If false, the keyword is appended: "core-dev-vnet".

This helps maintain naming consistency based on organizational preferences.
bool true no
route_tables List of route tables with their configuration and routes.
list(object({
name = string
bgp_route_propagation_enabled = optional(bool, false)
routes = optional(list(object({
name = string
address_prefix = string
next_hop_type = string
next_hop_in_ip_address = optional(string)
})), [])
}))
[] no
sku The SKU of the Public IP. Accepted values are Basic and Standard. Defaults to Basic. Changing this forces a new resource to be created. string "Standard" no
subnets List of subnets to create
list(object({
name = string
subnet_prefixes = list(string)
attach_nat_gateway = optional(bool, false)
nat_gateway_name = optional(string)
route_table_name = optional(string)
nsg_association = optional(bool, false)
service_endpoints = optional(list(string), [])
service_endpoint_policy_ids = optional(list(string), [])
private_link_service_policies = optional(bool, true)
private_endpoint_policies = optional(string, "Enabled")
default_outbound_access = optional(bool, true)
network_security_group_id = optional(string, null)
delegations = optional(list(object({
name = string
service_delegations = list(object({
name = string
actions = list(string)
}))
})), [])
}))
[] no
virtual_network_name Name of the virtual network string null no

Outputs

Name Description
nat_gateway_ids Map of NAT Gateway names to their IDs.
nat_gateway_names Map of NAT Gateway names to their names.
public_ip_addresses Map of NAT Gateway names to their associated public IP addresses.
public_ip_ids Map of NAT Gateway names to their associated public IP resource IDs.
route_table_ids Map of route table names to their IDs.
route_table_names Map of route table names to their names.
subnet_address_prefixes Map of subnet names to their address prefixes.
subnet_ids Map of subnet names to their IDs.
subnet_names Map of subnet names to their names.
subnet_nat_gateway_association_ids Map of subnet names to their NAT gateway association resource IDs.
subnet_route_table_association_ids Map of subnet names to their route table association resource IDs.
tags Tags applied to the resources.

Refer to complete documentation: here

Module Dependencies

This module has dependencies on:

πŸ“‘ Changelog

Refer here.

✨ Contributors

Big thanks to our contributors for elevating our project with their dedication and expertise! But, we do not wish to stop there, would like to invite contributions from the community in improving these projects and making them more versatile for better reach. Remember, every bit of contribution is immensely valuable, as, together, we are moving in only 1 direction, i.e. forward.



If you're considering contributing to our project, here are a few quick guidelines that we have been following (Got a suggestion? We are all ears!):

  • Fork the Repository: Create a new branch for your feature or bug fix.
  • Coding Standards: You know the drill.
  • Clear Commit Messages: Write clear and concise commit messages to facilitate understanding.
  • Thorough Testing: Test your changes thoroughly before submitting a pull request.
  • Documentation Updates: Include relevant documentation updates if your changes impact it.

Feedback

Spot a bug or have thoughts to share with us? Let's squash it together! Log it in our issue tracker, feel free to drop us an email at hello@clouddrove.com).

Show some love with a β˜… on our GitHub! if our work has brightened your day! – your feedback fuels our journey!

πŸš€ Our Accomplishment

We have 50+ Azure Terraform modules πŸ™Œ. You could consider them finished, but, with enthusiasts like yourself, we are able to ever improve them, so we call our status - improvement in progress.

Tap into our capabilities

We provide a platform for organizations to engage with experienced, top-tier DevOps and Cloud professionals. Tap into our pool of certified engineers and architects to elevate your DevOps and Cloud solutions.

At Azure Terraform Modules Organisation, we have extensive experience in designing, building, and migrating environments; securing infrastructure; consulting; monitoring; optimizing; automating; and maintaining complex, large-scale modern systems. With a strong client presence across American and European regions, our certified experts deliver robust and scalable cloud solutions.

Write to us at hello@clouddrove.com.

We are The Cloud Experts!


We ❀️ Open Source and you can check out our other modules to get help with your new Cloud ideas.

About

About This terraform module is designed to create Azure Subnet resources. Virtual networks and virtual machines in Azure. Microsoft Learn A subnet is a range of IP addresses in the virtual network. You can divide a virtual network into multiple subnets for organization and security. Each NIC in a VM is connected to one subnet in one virtual network

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages