From 4b87b26b16aab212f09df29458f1bca7fbdb69db Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Mon, 13 Nov 2017 14:16:03 -0800 Subject: [PATCH] Refactor the variables into their own terraform plan --- plans/provider.tf | 41 ----------------------------------------- plans/variables.tf | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 41 deletions(-) create mode 100644 plans/variables.tf diff --git a/plans/provider.tf b/plans/provider.tf index 869b9ed..f4295fe 100644 --- a/plans/provider.tf +++ b/plans/provider.tf @@ -1,49 +1,8 @@ # Configure the terraform Azure provider -variable "subscription_id" {} -variable "client_id" {} -variable "client_secret" {} -variable "tenant_id" {} - -variable "prefix" { - type = "string" - default = "codevaletdev" -} - -variable "dnsprefix" { - type = "string" - default = "" -} - -variable "env" { - type = "string" - default = "dev" -} - -variable "region" { - type = "string" - default = "East US 2" -} - -variable "k8s_master_name" { - type = "string" - # Cannot contain interpolations? wompwomp - default = "codevaletdev-k8s-master" -} - -variable "k8s_agents" { - type = "string" - default = "1" -} - provider "azurerm" { subscription_id = "${var.subscription_id}" client_id = "${var.client_id}" client_secret = "${var.client_secret}" tenant_id = "${var.tenant_id}" } - -provider "kubernetes" { - config_context_auth_info = "${var.k8s_master_name}-admin" - config_context_cluster = "${var.k8s_master_name}" -} diff --git a/plans/variables.tf b/plans/variables.tf new file mode 100644 index 0000000..752cc1a --- /dev/null +++ b/plans/variables.tf @@ -0,0 +1,24 @@ +# +# Variables for plugging in various environment specific settings +# + + +variable "env" { + type = "string" + default = "dev" +} + +variable "region" { + type = "string" + default = "West US" +} + +# +# Variables which should be kept secret +# and provided by a --var-file +####################################### +variable "subscription_id" {} +variable "client_id" {} +variable "client_secret" {} +variable "tenant_id" {} +#######################################