From 218c1ca4b470e4f10c5394aaa3976fae1e66a2f2 Mon Sep 17 00:00:00 2001 From: Troy McConaghy Date: Thu, 9 Feb 2017 10:31:05 +0100 Subject: [PATCH] Add initial working Terraform config for Azure --- azure/starter-vm/terraform/provider.tf | 15 +++++++++++++++ azure/starter-vm/terraform/resource-group.tf | 5 +++++ azure/starter-vm/terraform/variables.tf | 8 ++++++++ 3 files changed, 28 insertions(+) create mode 100644 azure/starter-vm/terraform/provider.tf create mode 100644 azure/starter-vm/terraform/resource-group.tf create mode 100644 azure/starter-vm/terraform/variables.tf diff --git a/azure/starter-vm/terraform/provider.tf b/azure/starter-vm/terraform/provider.tf new file mode 100644 index 00000000..c89922a1 --- /dev/null +++ b/azure/starter-vm/terraform/provider.tf @@ -0,0 +1,15 @@ +# Configure the Microsoft Azure Provider + +# Why define these variables here? This is why: +# https://github.com/hashicorp/terraform/issues/7894#issuecomment-259758331 +variable "subscription_id" {} +variable "client_id" {} +variable "client_secret" {} +variable "tenant_id" {} + +provider "azurerm" { + subscription_id = "${var.subscription_id}" + client_id = "${var.client_id}" + client_secret = "${var.client_secret}" + tenant_id = "${var.tenant_id}" +} diff --git a/azure/starter-vm/terraform/resource-group.tf b/azure/starter-vm/terraform/resource-group.tf new file mode 100644 index 00000000..e84ff151 --- /dev/null +++ b/azure/starter-vm/terraform/resource-group.tf @@ -0,0 +1,5 @@ +# Create a resource group +resource "azurerm_resource_group" "bdbNodeRG" { + name = "bdbNodeRG" + location = "${var.location}" +} \ No newline at end of file diff --git a/azure/starter-vm/terraform/variables.tf b/azure/starter-vm/terraform/variables.tf new file mode 100644 index 00000000..449deaf1 --- /dev/null +++ b/azure/starter-vm/terraform/variables.tf @@ -0,0 +1,8 @@ +# Use this file for Terraform variables that: +# 1) you don't mind sharing with the world on GitHub (if default provided) or +# 2) you want Terraform to ask the user for at runtime (if no default provided) +# Secret variables should be put in secret.tfvars or similar. + +variable "location" { + default = "westeurope" +}