Terraform output being flagged as sensitive

1.9k Views Asked by At

We have created some terraform stacks for different domains, like network stack for vpc, rds stack for rds stuff, etc.

And, for instance, the rds stack depends on the network stack to get values from the outputs:

Output from network stack:

output "public_subnets" {
  value = aws_subnet.public.*.id
}

output "private_subnets" {
  value = aws_subnet.private.*.id
}

output "data_subnets" {
  value = aws_subnet.data.*.id
}

... an so on

And the rds stack will tap on the outputs

data "tfe_outputs" "networking" {
  organization = "my-tf-cloud-org"
  workspace    = "network-production-eucentral1"
}

But when I try to use the output:

│
│   on main.tf line 20, in module "db":
│   20:   base_domain = data.tfe_outputs.dns.values.fqdn
│     ├────────────────
│     │ data.tfe_outputs.dns.values has a sensitive value
│
│ This object does not have an attribute named "fqdn".
╵
╷
│ Error: Unsupported attribute
│
│   on main.tf line 22, in module "db":
│   22:   subnets     = data.tfe_outputs.networking.values.data_subnets
│     ├────────────────
│     │ data.tfe_outputs.networking.values has a sensitive value
│
│ This object does not have an attribute named "data_subnets".
╵
╷
│ Error: Unsupported attribute
│
│   on main.tf line 23, in module "db":
│   23:   vpc_id      = data.tfe_outputs.networking.values.vpc_id
│     ├────────────────
│     │ data.tfe_outputs.networking.values has a sensitive value
│
│ This object does not have an attribute named "vpc_id".

This was working before; it started all of a sudden.

I tried adding the nonsensitive cast, but it does not work.

Any idea?

1

There are 1 best solutions below

3
Rodrigo Mompo On

Update:

I manage to fix the issue. I'm using terraform cloud with a remote state. If you go to your workspace_with_the_output general settings in tf cloud you will find an option called "Remote state sharing".

I added my workspace_which_consume_state on that list and now it's working. Hopefully, this helps