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

Handle project ID / project Number disparity #161

Open
briantkennedy opened this issue Feb 3, 2021 · 5 comments
Open

Handle project ID / project Number disparity #161

briantkennedy opened this issue Feb 3, 2021 · 5 comments

Comments

@briantkennedy
Copy link
Member

Terraform validator gets input from terraform plan which uses project ID. Meanwhile, CAI dumps rely on project number for the hierarchy. We need to resolve this discrepancy so that the same constraint target will be portable across TF Validator and Config Validator operating modes.

@morgante
Copy link
Contributor

Related issue: GoogleCloudPlatform/terraform-validator#182

@melinath
Copy link
Member

melinath commented Mar 12, 2021

I'm working on giving terraform-validator access to the project number. It will be a little annoying for users to have to set things up in the right order - but it wouldn't be possible to write a config validator constraint against a project number prior to project creation anyway. (And it isn't possible to write a config validator constraint against project id at all.)

@morgante
Copy link
Contributor

And it isn't possible to write a config validator constraint against project id at all.

I think this is the part we need to fix actually, exactly because number can't be determined pre-deployment.

@melinath
Copy link
Member

What is/are the use case(s) for writing a validation rule against a specific project pre-deployment? Is this a thing people are currently doing and/or want to be able to do?

@morgante
Copy link
Contributor

The use case is primarily if projects are following a common naming convention so you want to use a glob in it, but I agree that's probably an edge case we don't need to prioritize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants