Skip to content

Invalid count argument error #82

@alvarolorentedev

Description

@alvarolorentedev

Currently getting an error when using the module:
Error

Error: Invalid count argument

  on .terraform/modules/gcloud/main.tf line 57, in resource "random_id" "cache":
  57:   count = (! local.skip_download) ? 1 : 0

The "count" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the count depends on.

Module

module "gcloud" {
  source                = "terraform-google-modules/gcloud/google"
  version               = "~> 2.0"
  gcloud_sdk_version    = "304.0.0"
  platform              = "linux"
  additional_components = ["beta"]
  skip_download         = "false"
  count = 1

  create_cmd_triggers = {
    timestamp = local.timestamp
  }

  service_account_key_file = "secrets/terraform-user-credentials.json"

  create_cmd_entrypoint = "scripts/runGcloudCommands.sh"

  depends_on = [module.composer]
}

Environment

  • Terraform version: 0.13.3
  • hashicorp/external: version = "~> 1.2.0"
  • hashicorp/google: version = "~> 3.41.0"
  • hashicorp/google-beta: version = "~> 3.41.0"
  • hashicorp/null: version = "~> 2.1.2"
  • hashicorp/random: version = "~> 2.3.0"

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1highest priority issuesbugSomething isn't workingtriagedScoped and ready for workv0.13Terraform v0.13 issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions