Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Provider azurm and interpolation syntax #8

Open
wants to merge 1 commit into
base: terraform
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
provider "azurerm" {
version = "=2.10.0"
features {}
}

terraform {
required_version = "> 0.12.0"

Expand Down Expand Up @@ -30,14 +35,14 @@ resource "random_integer" "app_service_name_suffix" {
}

resource "azurerm_resource_group" "spacegame" {
name = "${var.resource_group_name}"
location = "${var.resource_group_location}"
name = var.resource_group_name
location = var.resource_group_location
}

resource "azurerm_app_service_plan" "spacegame" {
name = "${var.app_service_plan_name}"
location = "${azurerm_resource_group.spacegame.location}"
resource_group_name = "${azurerm_resource_group.spacegame.name}"
name = var.app_service_plan_name
location = azurerm_resource_group.spacegame.location
resource_group_name = azurerm_resource_group.spacegame.name
kind = "Linux"
reserved = true

Expand All @@ -49,9 +54,9 @@ resource "azurerm_app_service_plan" "spacegame" {

resource "azurerm_app_service" "spacegame_dev" {
name = "${var.app_service_name_prefix}-dev-${random_integer.app_service_name_suffix.result}"
location = "${azurerm_resource_group.spacegame.location}"
resource_group_name = "${azurerm_resource_group.spacegame.name}"
app_service_plan_id = "${azurerm_app_service_plan.spacegame.id}"
location = azurerm_resource_group.spacegame.location
resource_group_name = azurerm_resource_group.spacegame.name
app_service_plan_id = azurerm_app_service_plan.spacegame.id

site_config {
linux_fx_version = "DOTNETCORE|3.1"
Expand All @@ -60,10 +65,10 @@ resource "azurerm_app_service" "spacegame_dev" {
}

output "appservice_name_dev" {
value = "${azurerm_app_service.spacegame_dev.name}"
value = azurerm_app_service.spacegame_dev.name
description = "The App Service name for the dev environment"
}
output "website_hostname_dev" {
value = "${azurerm_app_service.spacegame_dev.default_site_hostname}"
value = azurerm_app_service.spacegame_dev.default_site_hostname
description = "The hostname of the website in the dev environment"
}