简体   繁体   English

在 terraform 申请期间遇到错误 403

[英]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.

相关问题 Terraform:googleapi:错误 403:资源项目权限被拒绝 - Terraform: googleapi: Error 403: Permission denied on resource project Terraform 错误:运行 terraform 计划时条件类型不正确 - Terraform Error: Incorrect condition type when running terraform plan Terraform gke 节点池在 googleapi 上获得 403:错误 403:需要“container.clusters.update” - Terraform gke node pool getting 403 on googleapi: Error 403: Required "container.clusters.update" 在应用期间使用 terraform 创建 ec2 后如何运行 scritps? - How to run scritps after create ec2 using terraform during apply? Terraform 和 GCP:尝试在项目级别引入模拟时出现错误 403 - Terraform & GCP : Error 403 when attempting to introduce impersonation on project-level `Error 403: Insufficient regional quota to satisfy request: resource "SSD_TOTAL_GB"` when creating kube.netes cluster with terraform - `Error 403: Insufficient regional quota to satisfy request: resource "SSD_TOTAL_GB"` when creating kubernetes cluster with terraform 在谷歌云中,使用命令“terraform apply”时出现此错误? - In google cloud, I am getting this error while using the command "terraform apply"? Terraform 错误:提供商产生不一致的最终计划 - 值“应用后已知”导致计划上的列表为空 - Terraform Error: Provider produced inconsistent final plan - value "known after apply" causes empty list on plan Terraform GCS 后端写入。tflock 失败。 403 访问被拒绝 - Terraform GCS backend writing .tflock failed. 403 access denied Terraform:“仅在应用后才知道”问题 - Terraform: "known only after apply" ISSUE
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM