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
╷
│ Error: At least one `admin_ssh_key` must be specified when `disable_password_authentication` is set to `true`
│
│ with azurerm_linux_virtual_machine.vm[0],
│ on main.tf line 33, in resource "azurerm_linux_virtual_machine""vm":
│ 33: resource "azurerm_linux_virtual_machine""vm" {
│
╵
Expected Behaviour
Terraform plan should fail depending on whether ssh key is set or password is provided while password authentication is disabled.
Actual Behaviour
Terraform plan is successful if password is set while password authentication is disabled.
Steps to Reproduce
terraform plan
terraform apply
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered:
Hi @munavirch thanks for opening the issue! Like the validations between other property combinations, the validation between admin_ssh_key and disable_password_authentication is done in the Create/Update method, which is invoked only during the apply but not plan. This validation could be moved to CustomizeDiff but that would cause issue when the field value is captured from other resource property which is known after apply (during plan it is always empty). As a result we put such kind of validation in the Create/Update method
Is there an existing issue for this?
Community Note
Terraform Version
1.2.4
AzureRM Provider Version
3.14.0
Affected Resource(s)/Data Source(s)
azurerm_linux_virtual_machine
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Terraform plan should fail depending on whether ssh key is set or password is provided while password authentication is disabled.
Actual Behaviour
Terraform plan is successful if password is set while password authentication is disabled.
Steps to Reproduce
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: