![](/img/trans.png)
[英]Terraform: Google cloud. Why cannot I create a new project without having an organisation?
[英]Invalid character trying to login terraforms with google cloud. using cygwin
我正在尝试在我的 windows 设备上将 terraform 与 Mobaxterm (cygwin) 结合使用。 我已经成功地使用令牌进行了身份验证。
gcloud auth application-default login
但是,当我尝试将 terraform 与“GOOGLE_APPLICATION_CREDENTIALS”环境变量集一起使用时。 我收到一个奇怪的错误:
terraform.exe init
Initializing modules...
Initializing the backend...
╷
│ Error: storage.NewClient() failed: dialing: google: error getting credentials using GOOGLE_APPLICATION_CREDENTIALS environment variable: invalid character '!' looking for beginning of value
│ │ ╵
我的 application_default_credentials.json 文件的格式是:
{
"client_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com",
"client_secret": "xxxxxxxxxxxxxxxxx",
"quota_project_id": "xxxxxxxxxxxxxx",
"refresh_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"type": "authorized_user"
}
我不确定是什么问题。 没有“。” 在 .json 文件中。
有任何想法吗? 有没有人让 terraform/gcp 和 cygwin 工作?
谢谢
您不能将文件application_default_credentials.json用作GOOGLE_APPLICATION_CREDENTIALS指定的服务帐户。
如果要使用gcloud auth application-default login创建的 ADC(应用程序默认凭据),请删除(清除)环境变量GOOGLE_APPLICATION_CREDENTIALS 。 Terraform 使用的库随后将使用 CLI (gcloud) 保存的凭据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.