Skip to content

Error: Circular reference found #1565

@sagar2610

Description

@sagar2610

Introduction

After installing the new version, 0.42.0, I start getting circular dependency errors in my local variables.

locals.tf

locals {
  resource_prefix            = "${var.project}-${var.usecase}"
  resource_prefix_underscore = "${var.project}_${var.usecase}"
}

test.tf


locals {
  pilot_ecrs = [
    "${local.resource_prefix}-main",
    "${local.resource_prefix}-tests"
  ]
}

module "prereq" {
  source               = "../../test"
  tags                 = local.default_tags
  resource_prefix      = local.pilot_resource_prefix
  kms_key_arns         = local.kmskey_arns
  ecr_repos            = local.pilot_ecrs
}
./infrastructure/project
Failed to prepare rule checking; failed to eval an expression in prerequisites.tf:27; prerequisites.tf:13,8-29: circular reference found; local.ecrs -> local.resource_prefix -> local.resource_prefix:

Error: circular reference found

  on prerequisites.tf line 13, in locals:
  13:     "${local.resource_prefix}-tests"

local.ecrs -> local.resource_prefix -> local.resource_prefix

-->

Expected Behavior

Actual behavior

Step to Reproduce

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions