【发布时间】:2019-07-16 00:58:27
【问题描述】:
我正在使用 Terraform 在 Azure 上预配资源。它抱怨密码不符合密码政策。我虽然可能 var 文件给出了一些错误,但即使我在命令行上传递密码,它也会给我错误。
在 terraform.tfvars 中如下:
password="Hash#Dollar$135"
terraform plan 命令的命令行如下:
terraform plan -var 'password=Hash#Dollar$135' -out main.plan
错误信息如下:
azurerm_virtual_machine.tf-vm-cluster-app[4]: 1 error(s) occurred:
azurerm_virtual_machine.tf-vm-cluster-app.4: compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidParameter" Message="The supplied password must be between 8-123 characters long and must satisfy at least 3 of password complexity requirements from the following: \r\n1) Contains an uppercase character\r\n2) Contains a lowercase character\r\n3) Contains a numeric digit\r\n4) Contains a special character\r\n5) Control characters are not allowed" Target="adminPassword"
即使在 DEBUG 模式下,它也不会告诉我哪个字符错误或应该使用哪个字符。一个例子会更好。
2019-02-22T11:45:11.077+1100 [DEBUG] plugin.terraform-provider-azurerm_v1.22.1_x4: {
2019-02-22T11:45:11.077+1100 [DEBUG] plugin.terraform-provider-azurerm_v1.22.1_x4: "error": {
2019-02-22T11:45:11.077+1100 [DEBUG] plugin.terraform-provider-azurerm_v1.22.1_x4: "code": "InvalidParameter",
2019-02-22T11:45:11.077+1100 [DEBUG] plugin.terraform-provider-azurerm_v1.22.1_x4: "message": "The supplied password must be between 8-123 characters long and must satisfy at least 3 of password complexity requirements from the following: \r\n1) Contains an uppercase character\r\n2) Contains a lowercase character\r\n3) Contains a numeric digit\r\n4) Contains a special character\r\n5) Control characters are not allowed",
2019-02-22T11:45:11.077+1100 [DEBUG] plugin.terraform-provider-azurerm_v1.22.1_x4: "target": "adminPassword"
2019-02-22T11:45:11.077+1100 [DEBUG] plugin.terraform-provider-azurerm_v1.22.1_x4: }
2019-02-22T11:45:11.077+1100 [DEBUG] plugin.terraform-provider-azurerm_v1.22.1_x4: }
我的第二个问题是,有没有办法查看密码值设置为什么值?
我执行了 terraform show,但看不到它设置的值。
【问题讨论】:
标签: azure-active-directory terraform azure-virtual-machine terraform-provider-azure