Closed floge07 closed 3 years ago
Maybe related to the change https://github.com/cloudamqp/terraform-provider-cloudamqp/commit/9d733796a93c5421d7163054a022e57a58ec354a
Somehow I did not see the new releases. Maybe I had the provider documentation tab opened too long... I added the original versions to my post.
I upgraded to 1.10.0 and the problem is solved. Sorry about the confusion.
Terraform: v1.0.7 Cloudamqp: v1.9.2
I'm trying to create a cloudamqp_instance and to write the cloudamqp_credentials into a azure keyvault as a secret.
The source code looks like this (simplified):
I get this error on terraform plan:
As you can see in the code the "value" of the azurerm_key_vault_secret has a definition. I think the problem is that the credentials are unknown since the instance has yet to be created.
The terraform documentation (https://www.terraform.io/docs/language/expressions/references.html) mentions this:
If unknown values are used in the configuration of a data resource, that data resource cannot be read during the plan phase and so it will be deferred until the apply phase. In this case, the results of the data resource will also be unknown values.
In my case, if I write the host of the cloudamqp_instance.tenant_rmq_instance into the keyvault, it works. So it can't be a general issue with the azurerm_key_vault_secret. It even works if I add the cloudamqp_instance as a datasource and use it instead of the resource. Just the cloudamqp_credentials datasource seems broken.
If I remove this part, plan & apply (thus creating the instance) and re-add the credentials, everything works (because the values are now known).
I'm certain that I configured everything correctly. This seems to be a problem in this provider, specifically the cloudamqp_credentials datasource.