#terragrunt (2019-08)

terragrunt

Terragrunt discussions

Archive: https://archive.sweetops.com/terragrunt/

2019-08-13

2019-08-14

Adrian avatar

Can someone help with remote state references? Where to put

    data "terraform_remote_state" "vpc" {
    backend = "s3"
    config {
      bucket  = "${var.remote_state_bucket}"
      region  = "${var.aws_region}"
      key     = "${var.remote_state_key}"
      profile = "${var.aws_profile}"
    }
  }
ruan.arcega avatar
ruan.arcega

i usually do like this, create data.tf file and put in there in the module i call the remote state with this way, example: ${data.terraform_remote_state.vpc.id}

Adrian avatar
In previous releases, a reference to a vpc_id output exported by the remote state data source might have looked like this:

data.terraform_remote_state.vpc.vpc_id
This value must now be accessed via the new outputs attribute:

data.terraform_remote_state.vpc.outputs.vpc_id
ruan.arcega avatar
ruan.arcega

oh yes, sorry i forgot *.outputs.* does it works for you ?

Adrian avatar

yes , that one piece was missing, just put data.terraform_remote_state…. in module and its works. I’m searching for solution to keep it dry right now

Adrian avatar

this should goes to module configuration?

    keyboard_arrow_up