Closed sheep64 closed 1 year ago
Hi @sheep64,
I just had a look at the provider code and the libraries that it uses and i think (aka needs verification from someone who actually works on that) that, despite the error message, the project set via gcloud auth application-default set-quota-project my_new_project
is not taken into account. Could you do me a favor and try the following?
provider "google" {
alias = "overridden_billing_project"
user_project_override = true
billing_project = "my_new_project"
}
module "gcp_org_policy" {
providers = {
google = google.overridden_billing_project
}
source = "terraform-google-modules/org-policy/google//modules/org_policy_v2"
version = "~> 5.2.0"
policy_root = "organization"
policy_root_id = 1234567890
constraint = "gcp.resourceLocations"
policy_type = "list"
exclude_folders = []
exclude_projects = []
rules = [
{
enforcement = null
allow = ["in:eu-locations"]
deny = []
conditions = []
}
]
}
Seems to work, just tested it. Thank you!
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days
TL;DR
Hello,
I have tried to create policies using org_policy_v2 module. But it doesn't seem to work that well, I get strange error messages there. When i do
terraform apply
i get the following error:I clicked on the Link, checked the article and used this command as described:
gcloud auth application-default set-quota-project my_new_project
. Still the same issue. Tested on other machines as well.Expected behavior
That we can apply the terraform changes
Observed behavior
didnt work
Terraform Configuration
Terraform Version
Additional information
No response