Skip to content

Commit

Permalink
location variable added
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol Nagpal committed Jan 6, 2023
1 parent f281f16 commit 4924cb6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
1 change: 1 addition & 0 deletions _example/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ module "bastion" {
environment = "test"
label_order = ["name", "environment"]
resource_group_name = module.resource_group.resource_group_name
location = module.resource_group.resource_group_location
virtual_network_name = module.vnet.vnet_name[0]
subnet_id = module.name_specific_subnet.specific_subnet_id[0]
}
17 changes: 4 additions & 13 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
data "azurerm_resource_group" "default" {
name = var.resource_group_name
}

locals {
resource_group_name = data.azurerm_resource_group.default.name
location = data.azurerm_resource_group.default.location
}

module "labels" {
source = "clouddrove/labels/azure"
version = "1.0.0"
Expand All @@ -24,8 +15,8 @@ module "labels" {
resource "azurerm_public_ip" "pip" {
count = var.enabled ? 1 : 0
name = format("%s-bastion-ip", module.labels.id)
location = local.location
resource_group_name = local.resource_group_name
location = var.location
resource_group_name = var.resource_group_name
allocation_method = var.public_ip_allocation_method
sku = var.public_ip_sku
ddos_protection_mode = var.ddos_protection_mode
Expand All @@ -40,8 +31,8 @@ resource "azurerm_bastion_host" "main" {
count = var.enabled ? 1 : 0

name = format("%s-bastion", module.labels.id)
location = local.location
resource_group_name = local.resource_group_name
location = var.location
resource_group_name = var.resource_group_name
copy_paste_enabled = var.enable_copy_paste
file_copy_enabled = var.bastion_host_sku == "Standard" ? var.enable_file_copy : null
sku = var.bastion_host_sku
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ variable "resource_group_name" {
description = "A container that holds related resources for an Azure solution"
}

variable "location" {
type = string
default = ""
description = "A location the resources"
}

variable "virtual_network_name" {
type = string
default = ""
Expand Down

0 comments on commit 4924cb6

Please sign in to comment.