Documentation says parent_folder must be a numerical value. I used the name of the folder instead by mistake, and process started fine, created groups and other resources before breaking because the value of parent_folder was not valid.
Input validation here would make process more robust and reliable.
Terraform Resources
# 0-bootstrap/variables.tf
...
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 = ""
}
...
### Detailed design
```markdown
Multiple options are possible:
1. Use of `check` block
2. Use of `google_folder` resource, as done in test/setup/main.tf (resource google_folder.test_folder)
3. Use of `validation` inside the variable `parent_folder`, as done in 0-bootstrap/variables.tf (variable `groups`)
Additional information
Based on the documentation, using the google_folder resource would validate the folder exists (and therefore is also a valid numerical value).
TL;DR
Documentation says
parent_folder
must be a numerical value. I used the name of the folder instead by mistake, and process started fine, created groups and other resources before breaking because the value ofparent_folder
was not valid. Input validation here would make process more robust and reliable.Terraform Resources
Additional information
Based on the documentation, using the
google_folder
resource would validate the folder exists (and therefore is also a valid numerical value).