Skip to content

Plan is confusing when output value changes between tuple type and list type with the same elements values #31102

@Nuru

Description

@Nuru

Changing

output "test" {
  value = ["first", "second"]
}

to

output "test" {
  value = true ? ["first", "second"] : [] # ["first", "second"]
}

unexpectedly and incorrectly produces a plan with a change like

Changes to Outputs:
  ~ test = [
      - "first",
      - "second",
    ] -> [
      + "first",
      + "second",
    ]

This occurs in Terraform v1.2.0 and earlier versions, such as 1.1.7.

Terraform Version

Terraform v1.2.0
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v4.15.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugconfirmeda Terraform Core team member has reproduced this issuecoreexplaineda Terraform Core team member has described the root cause of this issue in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions