IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    Fixing reported error from terragrunt

    RobinDong发表于 2022-10-28 02:29:00
    love 0

    When using “terragrunt init”, an error jumped out:

    DEBU[0002] Remote state GCS bucket prokyon-systems-state-bucket does not exist. Attempting to create it  prefix=[/data/proj/prokyon-systems/auto-accountant/infra/non-prod/europe-central/dev/storage-bucket] 
    ERRO[0002] Missing required GCS remote state configuration project 
    ERRO[0002] Unable to determine underlying exit code, so Terragrunt will exit with error code 1

    This error looks a little confusing because my attention was completely drawn by the “remote state configuration”. Where could I find the “remote state configuration”? Then I found it in “terragrunt.hcl”:

    remote_state {
      backend = "gcs"
      config = {
        bucket  = "my_bucket"
        prefix  = "my_prefix/terraform.tfstate"
      }
    }
    

    Which “configuration” did I miss? I went through a long way to finally realize that the plain word “project” at the end of the sentence “Missing required GCS remote state configuration project” is the most important one (this article). I just need to add a configuration item “project” in the “terragrunt.hcl”:

    remote_state {
      backend = "gcs"
      config = {
        project = "gcp_project_id"
        bucket  = "my_bucket"
        prefix  = "my_prefix/terraform.tfstate"
      }
    }


沪ICP备19023445号-2号
友情链接