Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running terraform vet runs into 404 errors #1322

Open
tlcncptv opened this issue Aug 6, 2024 · 4 comments
Open

Running terraform vet runs into 404 errors #1322

tlcncptv opened this issue Aug 6, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@tlcncptv
Copy link

tlcncptv commented Aug 6, 2024

TL;DR

google_folder.bootstrap: converting TF resource to CAI: getting resource ancestry or parent failed: googleapi: got HTTP response code 404 with body

The instructions say to run the plan. I run the plan, get the json output with terraform show, then run vet. Vet fails because the resource for the parent folder does not exist. I go into the console and create it and the same thing happens. Now I am confused. It appears vet only works if the changes are applied.

For terraform vet to pass, the folder id needs to be in the parent folder.

Expected behavior

I would expect the documentation to reflect the parent folder id, not a parent folder name.

Observed behavior

If I put the folder id, it passes vet $? == 0.

Terraform Configuration

parent_folder = "XXXXXXXXXXXX"

Terraform Version

Terraform v1.8.2
on darwin_arm64
+ provider registry.terraform.io/hashicorp/google v5.40.0
+ provider registry.terraform.io/hashicorp/google-beta v5.40.0
+ provider registry.terraform.io/hashicorp/null v3.2.2
+ provider registry.terraform.io/hashicorp/random v3.6.2
+ provider registry.terraform.io/hashicorp/time v0.12.0
+ provider registry.terraform.io/integrations/github v5.34.0

Additional information

No response

@tlcncptv tlcncptv added the bug Something isn't working label Aug 6, 2024
@daniel-cit
Copy link
Contributor

daniel-cit commented Aug 7, 2024

Hi @tlcncptv as stated in the example terraform.tfvars file,

# Optional - for an organization with existing projects or for development/validation.
# Uncomment this variable to place all the example foundation resources under
# the provided folder instead of the root organization.
# The variable value is the numeric folder ID
# The folder must already exist.
# parent_folder = "01234567890"

and in the input variable

variable "parent_folder" {
  description = "Optional - for an organization with existing projects or for development/validation. It will place all the example foundation resources under the provided folder instead of the root organization. The value is the numeric folder ID. The folder must already exist."
  type        = string
  default     = ""
}

the parent folder must be created before starting the deployment of the foundation, and the value must be the numeric folder ID, not the display name

@tlcncptv
Copy link
Author

tlcncptv commented Aug 7, 2024 via email

@daniel-cit
Copy link
Contributor

The issue is the example is 'dev_NNNNNNN' or something similar. So I spent time looking for the path name, as opposed to just the id. And yes, I did not read the comments. The only real issue here is the exemplar parent folder should be similar to the numeric id examples for things like project id.

On Wed, Aug 7, 2024 at 11:32 AM Daniel Andrade @.***> wrote: Hi @tlcncptv https://github.com/tlcncptv as stated here, the parent folder must be created before starting the deployment of the foundation, and the value must be the numeric folder ID, not the display name https://github.com/terraform-google-modules/terraform-example-foundation/blob/028f85f51dcc06a879a07f1f88758d139d10287b/0-bootstrap/terraform.example.tfvars#L47C3-L52C32 # Optional - for an organization with existing projects or for development/validation. # Uncomment this variable to place all the example foundation resources under # the provided folder instead of the root organization. # The variable value is the numeric folder ID # The folder must already exist. # parent_folder = "01234567890" — Reply to this email directly, view it on GitHub <#1322 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BGWX4VLS2GIU42MQKACKXR3ZQJR4JAVCNFSM6AAAAABMDDV2OSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZUGA4DKOJYG4 . You are receiving this because you were mentioned.Message ID: </issues/1322/2274085987 @github.com>

@tlcncptv can you help finding the example you used that is in the format of dev_NNNNNNN?

The one in the file is in the format: parent_folder = "01234567890"

@tlcncptv
Copy link
Author

tlcncptv commented Aug 7, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants