From bb790668bf4c2c0de0876480dbf2d11903f22ba5 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 4 Jul 2018 11:28:34 +0100 Subject: Pass the terraform credentials to the remote state configuration This fixes the mini environment Terraform working, now that the backend is protected by basic authentication. --- terraform/aws/mini_environment/main.tf | 10 ++++++++++ terraform/libvirt/mini_environment/main.tf | 10 ++++++++++ 2 files changed, 20 insertions(+) (limited to 'terraform') diff --git a/terraform/aws/mini_environment/main.tf b/terraform/aws/mini_environment/main.tf index a0d066a..7f2ebf6 100644 --- a/terraform/aws/mini_environment/main.tf +++ b/terraform/aws/mini_environment/main.tf @@ -30,6 +30,14 @@ variable "backend_remote_state_address" { type = "string" } +variable "backend_remote_state_username" { + type = "string" +} + +variable "backend_remote_state_password" { + type = "string" +} + variable "ssh_private_key" { type = "string" } @@ -45,6 +53,8 @@ data "terraform_remote_state" "backend" { backend = "http" config { address = "${var.backend_remote_state_address}" + username = "${var.backend_remote_state_username}" + password = "${var.backend_remote_state_password}" } } diff --git a/terraform/libvirt/mini_environment/main.tf b/terraform/libvirt/mini_environment/main.tf index 504574c..f572df6 100644 --- a/terraform/libvirt/mini_environment/main.tf +++ b/terraform/libvirt/mini_environment/main.tf @@ -2,6 +2,14 @@ variable "backend_remote_state_address" { type = "string" } +variable "backend_remote_state_username" { + type = "string" +} + +variable "backend_remote_state_password" { + type = "string" +} + variable "machine_name" { type = "string" } @@ -30,6 +38,8 @@ data "terraform_remote_state" "backend" { backend = "http" config { address = "${var.backend_remote_state_address}" + username = "${var.backend_remote_state_username}" + password = "${var.backend_remote_state_password}" } } -- cgit v1.2.3