Giter VIP home page Giter VIP logo

terraform-azure-bastion's Introduction

Terraform module for Azure Bastion service

This is a free to use (no guarantees given) terraform module that can be used to deploy the Azure Bastion service into an existing Azure virtual network.

For more information about this service, read the official Microsoft documentation on Azure Bastion.

Requirements

  • terraform 0.12.n
  • tested with terraform AzureRM provider 1.29.0
  • Azure virtual network
  • Azure Resource Group

Deploying this module will incur cost in your subscription!

Deploy

The module can be called from any terraform script like below. As there is currently no Azure Bastion terraform resource we are using an inline Azure Resource Manager deployment to deploy the Bastion resource.

provider "azurerm" {
  environment     = "public"
  subscription_id = <pass in your Azure subscription Id>
  version         = "1.29.0"
}

variable "ARM_VNETADDRESSSPACE" {
  type        = "string"
  description = "CIDR Range for vnet"
  default     = "10.0.0.0/8"
}

resource "azurerm_resource_group" "resourcegroup" {
  name     = join("-", ["sharedservices", "australiaeast", "prod", "rg"])
  location = "australiaeast"
}

resource "azurerm_virtual_network" "sharedservicesvnet" {
  name                = join("-", ["xir", "australiaeast", "vnet"])
  location            = "australiaeast"
  resource_group_name = azurerm_resource_group.resourcegroup.name
  address_space       = [var.ARM_VNETADDRESSSPACE]
  tags                = local.common_tags
}

module "azurebastion" {
  source = "../azurebastion"
  ARM_LOCATION             = "australiaeast"
  ARM_RESOURCEGROUP        = azurerm_resource_group.resourcegroup.name
  ARM_ENVIRONMENT_NAME     = "prod"
  CUSTOMER_PREFIX          = "xir"
  CUSTOMER_COSTCENTRE      = "1234"
  CUSTOMER_APPLICATION     = "azurebastion"
  BASTIONSUBNETCIDR        = cidrsubnet(var.ARM_VNETADDRESSSPACE, 8, 4)
  LAWORKSPACEID            = <input Log Analytics Workspace ID>
  VNETNAME                 = azurerm_virtual_network.sharedservicesvnet.name
}

Always interested in feedback on this.

terraform-azure-bastion's People

Contributors

davidobrien1985 avatar danielmabbett avatar

Stargazers

 avatar Zach Hanna avatar Ali Allomani avatar Len Volk avatar  avatar postmart avatar Brandon Olin avatar Arthur avatar Nirmal Thewarathanthri avatar

Watchers

James Cloos avatar  avatar Martin Kraus Larsen avatar Matt 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.