Skip to content

Can't upgrade from 0.11.14 to 0.13.0 with version 3 statefile containing remote state data resource #25863

@alisdair

Description

@alisdair

Terraform Version

Using the branch from #25861

Terraform v0.13.1-dev

Terraform Configuration Files

data "terraform_remote_state" "test" {
  backend = "remote"

  config = {
    organization = "my-tfc-org"
    workspaces = {
      name = "some-tfc-workspace"
    }
  }
}

Debug Output

Log gist

Expected Behavior

An empty plan.

Actual Behavior

$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.


Error: cannot decode dynamic from flatmap

$

Steps to Reproduce

  1. Create a config with a Terraform Cloud remote state data source block pointing to a workspace
  2. Run terraform init and terraform apply with Terraform 0.11.14 to create a state file
  3. Run terraform plan with Terraform 0.13.1-dev (after addrs: Fix LegacyString for builtin providers #25861 is merged, or using that branch, or it'll panic)

Additional Context

This works with Terraform 0.12.28. The failure is in attempting to decode the dynamic config block from the flatmap in the state file. From looking at the v0.12 branch, I can't see how this used to work, nor any reason why it should only start failing with 0.13.

References

Found when investigating the fix for #25803.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugworking as designedconfirmed as reported and closed because the behavior is intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions