terraform-google-gcloud icon indicating copy to clipboard operation
terraform-google-gcloud copied to clipboard

In TF 0.13+ all list elements must have the same type

Open apeabody opened this issue 2 years ago • 1 comments

TL;DR

Historically list(any) was used for https://github.com/terraform-google-modules/terraform-google-gcloud/blob/6789fa726f443e36a3159f452eec0fc5f9a9ff4b/variables.tf#L35 However subsequent to https://github.com/hashicorp/terraform/issues/26265, all list elements must have the same type. So for example this fails: module_depends_on = [time_sleep.wait_300_seconds, null_resource.test] The given value is not suitable as all list elements must have the same type.

@bharathkkb - When you have time, could you confirm/feedback as if so this might apply to several modules? The vast majority of module_depends_on only have a single argument, are therefore work as expected. However we might want to switch to a string or update the documentation to clarify the situation.

Expected behavior

No response

Observed behavior

No response

Terraform Configuration

N/A

Terraform Version

Terraform v1.2.2

Additional information

No response

apeabody avatar Aug 05 '22 17:08 apeabody

@apeabody updating docs to clarify this sgtm. IIUC end users can also workaround this by type coercion if needed.

bharathkkb avatar Aug 06 '22 00:08 bharathkkb

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

github-actions[bot] avatar Oct 05 '22 23:10 github-actions[bot]

A workaround could be to use an intermediate null_resource depending on the real resources:

resource "null_resource" "depends_on_sleep_and_test" {
  triggers   = { always_run = timestamp() }
  depends_on = [time_sleep.wait_300_seconds, null_resource.test]
}

module "execute_create_admin" {
  source            = "terraform-google-modules/gcloud/google"
  module_depends_on = [null_resource.depends_on_sleep_and_test]
}

maidmaid avatar Feb 21 '23 11:02 maidmaid