Giter Club home page Giter Club logo

terraform-azurerm-route-table's Introduction

Azure route table Terraform module

Terraform module for route table creation with routes and subnet associations.

Usage

This module is provisioning route table with routes and subnet associations. Below is an example that provisions route table with three routes.

locals {
  routes = {
    "route1" = {
      address_prefix = "10.0.0.0/16"
      next_hop_type  = "VirtualAppliance"
      next_hop_ip    = "10.2.0.3"
    }
    "route2" = {
      address_prefix = "10.1.0.0/16"
      next_hop_type  = "VirtualNetworkGateway"
    }
    "route3" = {
      address_prefix = "10.2.0.0/16"
      next_hop_type  = "VnetLocal"
    }
  }
}

data "azurerm_subnet" "subnet1" {
  name                 = "subnet1"
  virtual_network_name = "example-vnet"
  resource_group_name  = "example-rg"
}

data "azurerm_subnet" "subnet2" {
  name                 = "subnet2"
  virtual_network_name = "example-vnet"
  resource_group_name  = "example-rg"
}

module "route_table" {
  source  = "data-platform-hq/route-table/azurerm"
  
  route_table_name = "example-route-table"
  location         = var.location
  resource_group   = var.resource_group
  subnet_ids       = {
    (data.azurerm_subnet.subnet1.name) = data.azurerm_subnet.subnet1.id
    (data.azurerm_subnet.subnet2.name) = data.azurerm_subnet.subnet2.id
  }
  routes = local.routes
}

Requirements

Name Version
terraform >= 1.0.0
azurerm >= 3.23.0

Providers

Name Version
azurerm >= 3.23.0

Modules

No modules.

Resources

Name Type
azurerm_route.this resource
azurerm_route_table.this resource
azurerm_subnet_route_table_association.this resource

Inputs

Name Description Type Default Required
disable_bgp_route_propagation Boolean flag which controls propagation of routes learned by BGP on that route table. True means disable. bool true no
location Specifies the supported Azure location where the resource exists string n/a yes
resource_group The name of the resource group in which to create the route table string n/a yes
route_table_name Route table name string n/a yes
routes Map of route names to its address_prefix, next_hop_type
map(object({
address_prefix = string
next_hop_type = string
next_hop_ip = optional(string)
}))
{} no
subnet_ids Maps of subnet name to id, route table would associated to this subnets map(string) {} no
tags Resource tags map(any) {} no

Outputs

Name Description
route_table Map of route table name to ID

License

Apache 2 Licensed. For more information please see LICENSE

terraform-azurerm-route-table's People

Contributors

owlleg6 avatar roolrd avatar rr-epam avatar semantic-release-bot avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.