Skip to content

Instantly share code, notes, and snippets.

@bensojona
Created August 24, 2018 02:02
Show Gist options
  • Save bensojona/962220df94b3681731d9814c4a2d3060 to your computer and use it in GitHub Desktop.
Save bensojona/962220df94b3681731d9814c4a2d3060 to your computer and use it in GitHub Desktop.
variable "tfe_org_name" { }
variable "tfe_producer_workspace" { }
variable "tfe_consumer_workspace" { }
variable "tfe_consumer_token" { }
variable "ttl" { default = "1" }
/*
# Getting the below error in TFE when running remote plans, commenting this out for now
# "Setup failed: Failed to copy slug dir: lstat /Users: no such file or directory"
terraform {
backend "remote" {
}
}
*/
data "terraform_remote_state" "producer" {
backend = "remote"
config {
organization = "${var.tfe_org_name}"
token = "${var.tfe_consumer_token}"
workspaces {
name = "${var.tfe_producer_workspace}"
}
}
}
module "consumer_workspace" {
# source = "github.com/hashicorp/terraform-guides//infrastructure-as-code/dynamic-aws-creds/consumer-workspace"
source = "../../dynamic-aws-creds/consumer-workspace"
backend = "${data.terraform_remote_state.producer.backend}"
role = "${data.terraform_remote_state.producer.role}"
name = "${var.tfe_consumer_workspace}"
ttl = "${var.ttl}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment