-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data source external with dependencies is being evaluated early #17173
Comments
If I change the output variables to be: output "vault-backend-token" {
value = "${data.external.vault-tokens.result["backend-token"]}"
sensitive = true
}
output "vault-consul-auth-backend-token" {
value = "${data.external.vault-tokens.result["consul-auth-backend-token"]}"
sensitive = true
} It works. If I change to: output "vault-backend-token" {
value = "${data.external.vault-tokens.result.backend-token}"
sensitive = true
}
output "vault-consul-auth-backend-token" {
value = "${data.external.vault-tokens.result.consul-auth-backend-token}"
sensitive = true
} It does not work, which is unexpected. |
this addes the ability to search for EIP’s via tags or other attribute that EIP’s can use in a filter. This did highlight a known issue with regrads to how terraform eval’s data sources before they should if be the resourse is a computed value. This is only an issue if the data block is referencing a resource that is created at the same time. If referencing a pre exiting resource this does not happen. the test config testAccDataSourceAwsEipFilterConfig makes a interpol ref to force terraform to eval the data block after the resource has either been created or read in `values = ["${aws_eip.test.tags.Name}”]` see the following links hashicorp/terraform#10603 hashicorp/terraform#17173
FWIW, I can reproduce this on |
I just reproduced this issue with Terraform v0.11.10. Thanks for the hint with the brackets, @Lasering. That worked as a workaround. |
To work around this, you can also use output "vault-backend-token" {
value = "${lookup(data.external.vault-tokens.result, "backend_token")}"
sensitive = true
} |
Hi,
This gives an error on terraform plan:
If i comment the aws_iam_server_certificate resource out, the stack can be launched. Once the stack is launched the aws_iam_server_certificate resource can be uncommented, the config can be reapplied and the stack updates with this resource Any ideas on how i can the stack to launch in one step without this workaround? |
It should work like this:
|
Thanks both. I hadnt seen the support for locally signed certs in the tls provider - it would make much more sense to use this! |
As an FYI, what @Lasering said in #17173 (comment) happens for EKS auth too when using modules. Until hashicorp/terraform-provider-aws#4904 is merged a workaround proposed in hashicorp/terraform-provider-kubernetes#161 needs to be used to use the I initially had everything in a single folder, without any modules:
As soon as I moved to a module, I had to switch to
This is... weird. |
Error: Resource 'data.external.definition_json' does not have attribute 'result.rendered' for variable Fixed using workaround in hashicorp/terraform#17173
I am getting a strikingly similar issue to this. I have multiple null resources that run as a linear stream of dependencies, but they all seem to ignore the dependencies and just run at once. v0.11.13 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Terraform Version
Terraform Configuration Files
These are defined inside a module called
consul
.Expected Behavior
The output variables values should only be computed after
provision-both-clusters
in ran.Actual Behavior
The same behavior happens even if I define
vault-tokens
to be:Like described in #10603
If I remove the output variables Terraform resolves the graph correctly and only runs the
vault-tokens
after the null_resource.If I set a
depends_on = ["null_resource.provision-both-clusters"]
on both output variables I still get the error.Steps to Reproduce
terraform init
terraform plan
The text was updated successfully, but these errors were encountered: