Closed ikegentz closed 2 years ago
@ikegentz I am not sure I follow, there should always be a project_id output even if you don't provide a project_id input.
That's correct, it will output but the project_id
variable doesn't show the suffix added to the project.
So instead of project_id
== name + suffix
, it is just name
@ikegentz Could you show a sample without Terragrunt? I have not encountered this. We pass in a local that has a random suffix and use that same attrib as the op. https://github.com/terraform-google-modules/terraform-google-project-factory/blob/b024e5cf2bedb2e1df08baceb837e80c89d68cd8/modules/core_project_factory/main.tf#L32-L36
Feel free to reopen if still an issue
TL;DR
The
project_name
output does not include the random suffix that gets appended if settingrandom_project_id
totrue
. This means that there is no way to grab the full project's ID from the outputs, sinceproject_id
is not set as an output if left blank.Expected behavior
project_name
should include the random 4-character suffix that gets appended whenrandom_project_id
istrue
Observed behavior
project_name
is only set to whatever thename
input is set to, and doesn't include therandom_project_id
suffixTerraform Configuration
Terraform Version
Additional information
The workaround is to set
project_id
to the same thing asname
. Is that intended?