[英]running into error 403 during terraform apply
Running terraform apply getting below error.运行 terraform 应用得到以下错误。
{"error":{"code":403,"message":"The billing account for the owning project is disabled in state absent","errors":[{"message":"The billing account for the owning project is disabled in state absent","domain":"global","reason":"accountDisabled","locationType":"header","location":"Authorization"}]}}: timestamp=2022-12-31T00:04:43.690-0500
For the project I added the billing account.对于该项目,我添加了计费帐户。
I am able to run gcloud commands from shell without any errors using the same service account.我能够使用相同的服务帐户从 shell 运行 gcloud 命令而不会出现任何错误。
terraform_gcp % gcloud auth activate-service-account --key-file=sakey.json
Activated service account credentials for: [gcp-terraform@saproject.iam.gserviceaccount.com]
terraform_gcp % gsutil ls
gs://mygcptfstatebucket/
terraform_gcp % gcloud compute instances list
Listed 0 items.
my main.tf is我的 main.tf 是
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "4.47.0"
}
}
}
provider "google" {
project = "my-gcp-project"
region = "us-east1"
zone = "us-east1-b"
}
Any insights into this error.对此错误的任何见解。
Tried adding below block and its working seems issue with my configuration.尝试添加以下块,它的工作似乎与我的配置有关。
data "google_project" "project_name" {
project_id = "projectid"
}
and referencing project_id in the resource block.并在资源块中引用 project_id。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.