

Fixing reported error from terragrunt
source link: https://donghao.org/2022/10/28/fixing-reported-error-from-terragrunt/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Fixing reported error from terragrunt
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
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" } }
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" } }
remote_state {
backend = "gcs"
config = {
project = "gcp_project_id"
bucket = "my_bucket"
prefix = "my_prefix/terraform.tfstate"
}
}
Related Posts
- A strange error in BigQuery
Two days ago we met a weird error when running a select through BigQuery Python…
- An error about multiprocessing of Python
Our python program reported errors when running a new dataset: [77 rows x 4 columns]]'.…
- Model saving error when using Apex
Apex is a tool to enable mixed-precision training that comes from Nvidia. import apex.amp as…
October 28, 2022 - 2:29
RobinDong
ops
terragrunt
Leave a comment
Leave a Reply Cancel reply
Your email address will not be published. Required fields are marked *
Comment *
Name *
Email *
Website
Save my name, email, and website in this browser for the next time I comment.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK