Skip to content

Commit

Permalink
remove resource_group data block
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpeteuil committed Jul 9, 2020
1 parent 1ae9692 commit 8fcb934
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
16 changes: 8 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
data "azurerm_client_config" "main" {}

data "azurerm_resource_group" "main" {
name = var.resource_group_name
}
# data "azurerm_resource_group" "main" {
# name = var.resource_group_location
# }

resource "azurerm_app_service_plan" "main" {
count = local.plan.id == "" ? 1 : 0
name = coalesce(local.plan.name, local.default_plan_name)
location = data.azurerm_resource_group.main.location
resource_group_name = data.azurerm_resource_group.main.name
location = var.resource_group_location
resource_group_name = var.resource_group_name
kind = "linux"
reserved = true

Expand All @@ -22,8 +22,8 @@ resource "azurerm_app_service_plan" "main" {

resource "azurerm_app_service" "main" {
name = var.name
location = data.azurerm_resource_group.main.location
resource_group_name = data.azurerm_resource_group.main.name
location = var.resource_group_location
resource_group_name = var.resource_group_name
app_service_plan_id = local.plan_id

client_affinity_enabled = false
Expand Down Expand Up @@ -99,7 +99,7 @@ resource "azurerm_app_service_custom_hostname_binding" "main" {
count = length(var.custom_hostnames)
hostname = var.custom_hostnames[count.index]
app_service_name = azurerm_app_service.main.name
resource_group_name = data.azurerm_resource_group.main.name
resource_group_name = var.resource_group_name
}

resource "azurerm_key_vault_access_policy" "main" {
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ variable "resource_group_name" {
description = "The name of an existing resource group to use for the web app."
}

variable "resource_group_location" {
type = string
description = "Location of an existing resource group to use for the web app."
}

variable "container_type" {
type = string
default = "docker"
Expand Down

0 comments on commit 8fcb934

Please sign in to comment.