-
Notifications
You must be signed in to change notification settings - Fork 543
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
Using count with TF 0.13 seems fraught with problems #487
Comments
I'm not sure what you're asking for here. The limitations of The solution is that you should not use dynamic values as inputs. |
I'm not, I'm using |
Ok, then where is an error being raised? There isn't an issue with using count, it's an issue with what values are provided to count. Please share your full Terraform config. |
locals {
usage_report_bucket = "example-usage-report"
}
/******************************************
Provider configuration
*****************************************/
provider "google" {
version = "~> 3.30"
credentials = file(var.credentials_path)
}
provider "google-beta" {
version = "~> 3.30"
credentials = file(var.credentials_path)
}
provider "null" {
version = "~> 2.1"
}
provider "random" {
version = "~> 2.2"
}
/******************************************
Folders Creation
https://github.com/terraform-google-modules/terraform-google-project-factory/blob/79f7c953a5267b0d22c2e9396136e27319320ae0/examples/project-hierarchy/main.tf#L54
*****************************************/
resource "google_folder" "shared" {
display_name = "Shared"
parent = "organizations/${var.organization_id}"
}
resource "google_folder" "labs" {
display_name = "Labs"
parent = "organizations/${var.organization_id}"
}
resource "google_folder" "prod" {
display_name = "Prod"
parent = "organizations/${var.organization_id}"
}
resource "google_storage_bucket" "usage_report" {
name = local.usage_report_bucket
location = "EU"
project = var.host_project_name
}
# An additional budget with more options
resource "google_pubsub_topic" "usage_report_alerts" {
name = "usage_report_alerts"
project = var.host_project_name
}
module "host-project" {
source = "terraform-google-modules/project-factory/google"
# source = "terraform-google-modules/project-factory/google//modules/gsuite_enabled"
version = "~> 9.2"
activate_apis = [
"compute.googleapis.com",
"billingbudgets.googleapis.com"
]
billing_account = var.billing_account
bucket_location = "EU"
bucket_project = "example-seed"
bucket_name = "example-tf-state"
bucket_versioning = true
credentials_path = var.credentials_path
default_service_account = "disable"
domain = "example.com"
enable_shared_vpc_host_project = true
folder_id = google_folder.shared.id
lien = true
name = var.host_project_name
org_id = var.organization_id
skip_gcloud_download = true
# Budget
budget_alert_pubsub_topic = google_pubsub_topic.usage_report_alerts.name
budget_alert_spent_percents = [0.5, 0.7, 1]
budget_amount = 400
usage_bucket_name = local.usage_report_bucket
# GSuite
# https://github.com/terraform-google-modules/terraform-google-project-factory/issues/484
# sa_group = "gsuite-service-accounts@example.com"
# create_group = true
depends_on = [google_storage_bucket.usage_report]
}
resource "google_project_iam_member" "project" {
project = module.host-project.project_id
role = "roles/editor"
member = "user:example@example.com"
}
|
What error do you get with this config? |
|
@haf Could you try leaving the skip_download off entirely? |
@EppO This is not the right repo to report issues around Terraform core or the Azure provider. This is a Google module for Terraform. You want Terraform core: https://github.com/hashicorp/terraform |
oh I'm sorry, I ended up here after a google search of the very same issue. I'll open the issue on the terraform repo. Thanks |
Awesome, it's solved! @morgante How did you solve it?
Works, but is not the solution. It's a bool, it should be possible to set. |
@haf Just to confirm, you're no longer seeing this issue?
Agreed, just trying to diagnose the cause since I can't reproduce. |
Yes, I think I've worked around it by not using that setting. But have you tried latest Terraform and setting the settings I used? I repro it every time. |
This should now be fixed by #491 |
This module crashes when used with TF 0.13 in these cases:
Example when using the budget feature:
Using a local, so that
makes it pass. Despite this later on in the project factory declaration:
Moving on, by using the local instead (having to manually declare
depends_on
as a result of that workaround): later, when using the GSuite integration:This crash seems worse since the only knob I have is a boolean, and that is already "known" statically, so the problem lies inside this module in how it composes its child modules.
Hashicorp has a summary of the count problem:
The text was updated successfully, but these errors were encountered: