我正在使用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,但看不出它的设定价值。
删除这个问题。我忘了在main.tf文件中使用$ in使用变量。愚蠢的错误。