I have been unable to pull state information from my terraform_remote_state source. I continue to get the error that 'outputs has no attributes.
This is the configuration of my remote_states.tf file;
data "terraform_remote_state" "core-ca" {
backend = "s3"
config = {
bucket = "terraform-state-xxxxxxxxx"
region = "us-east-1"
key = "terraform-core-ca-state"
profile = "xxxxxx"
dynamodb_table = "terraform-state-lock-dynamo"
encrypt = true
role_arn = "xxxxxx"
}
}
This is my call to terraform_remote_states;
destination_cidr_block = data.terraform_remote_state.core-ca.outputs.cidr_block
Along with all of my other output I get this error from a terraform plan;
90: destination_cidr_block = data.terraform_remote_state.core-ca.outputs.cidr_block
|----------------
| data.terraform_remote_state.core-ca.outputs is object with no attributes
This object does not have an attribute named "cidr_block".
I am running terraform version v0.14.7
The data source is from another module so I have also been unable to call the module to get the information and I believe that the only to get information from the other module is to query the terraform_remote_state.
Be aware that I have also tried to configure a local version of the data as follows;
data "terraform_remote_state" "core-ca-local" {
backend = "local"
config = {
path = "../core-ca/.terraform/terraform.tfstate"
}
}
When I do this with the following;
destination_cidr_block = data.terraform_remote_state.core-ca-local.outputs.cidr_block
I get the same error;
90: destination_cidr_block = data.terraform_remote_state.core-ca-local.outputs.cidr_block
|----------------
| data.terraform_remote_state.core-ca-local.outputs is object with no attributes
This object does not have an attribute named "cidr_block".
From the terraform-core-cs-state.json file I see the following
"version": 4,
"terraform_version": "0.14.7",
"serial": 1,
"lineage": "de121872-2302-c648-6ca2-3909ae82c39c",
"outputs": {},
It appears that there is no attributes in the outputs field.
I feel like I’m missing something basic. I had been using version 0.11 but I am starting fresh with this new version. Any help would be appreciated.
Also, be aware that I am deploying this into Canada if that makes a difference.