You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
------------------------------------------------------------------------
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement
<= read (data resources)
Terraform will perform the following actions:
<= data.azurerm_key_vault_secret.test_sql_password
id: <computed>
content_type: <computed>
name: "test-sql-password"
tags.%: <computed>
value: <computed>
vault_uri: "https://keyvault.vault.azure.net/"
version: <computed><= data.azurerm_key_vault_secret.test_sql_username
id: <computed>
content_type: <computed>
name: "test-sql-username"
tags.%: <computed>
value: <computed>
vault_uri: "https://keyvault.vault.azure.net/"
version: <computed>
-/+ azurerm_sql_server.test_sql_server (new resource required)
id: "/subscriptions/XXX/resourceGroups/test-sql-password/providers/Microsoft.Sql/servers/tftestsqlsrv" =><computed> (forces new resource)
administrator_login: "sqladmin" =>"${data.azurerm_key_vault_secret.test_sql_username.value}" (forces new resource)
administrator_login_password: <sensitive> =><sensitive> (attribute changed)
fully_qualified_domain_name: "tftestsqlsrv.database.windows.net" =><computed>
location: "westeurope" =>"westeurope"
name: "tftestsqlsrv" =>"tftestsqlsrv"
resource_group_name: "test-sql-password" =>"test-sql-password"
tags.%: "0" =><computed>
version: "12.0" =>"12.0"
Plan: 1 to add, 0 to change, 1 to destroy.
------------------------------------------------------------------------
Note: You didn't specify an "-out" parameter to save this plan, so Terraformcan't guarantee that exactly these actions will be performed if"terraform apply" is subsequently run.
Expected Behavior
The administrator username and password are created as key vault secrets, and then read as data sources. After consecutive executions Terraform should report that everything is up-to-date:
This is a known issue with data resources described in #11806. The depends_on argument forces a data resource to be refreshed every time because the explicit dependency prevents it from being resolved at refresh time.
To make it work, use implicit expression references instead of depends_on, like this:
This version works because it gives Terraform more information: it can see that those two attribute values on azurerm_key_vault_secret.test_sql_username are already known and thus it is safe to read the data source during the refresh phase.
Since we already have #11806 open for this, I'm going to close this one just to consolidate discussion over there. Thanks for reporting this!
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.
ghost
locked and limited conversation to collaborators
Mar 30, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Terraform Version
Terraform Configuration Files
Console Output
Expected Behavior
The administrator username and password are created as key vault secrets, and then read as data sources. After consecutive executions Terraform should report that everything is up-to-date:
Actual Behavior
See provider issue in References.
Steps to Reproduce
See provider issue in References.
References
#1864
The text was updated successfully, but these errors were encountered: