Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

render entirely unknown blocks in the plan output #35271

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented May 31, 2024

An unknown block can happen when using an unknown for_each value in a dynamic block assignment. The plan renderer was missing a check for entirely unknown blocks, causing them to be omitted from the human readable output.

The output with an unknown nested block previously looked like:

  # terraform_data.b will be created
  + resource "terraform_data" "b" {
      + id = (known after apply)
    }

And the updated output would be

  # terraform_data.b will be created
  + resource "terraform_data" "b" {
      + id = (known after apply)

      + nested (known after apply)
    }

Fixes #34933

The plan renderer was missing a check for entirely unknown blocks,
causing them to be omitted from the human readable output. An unknown
block can happen when using an unknown for_each value in a dynamic block
assignment.
@jbardin jbardin added the 1.9-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label May 31, 2024
@jbardin jbardin requested a review from a team May 31, 2024 18:27
@jbardin jbardin merged commit a38be7d into main Jun 3, 2024
6 checks passed
@jbardin jbardin deleted the jbardin/render-uknown-block branch June 3, 2024 17:14
Copy link

github-actions bot commented Jun 3, 2024

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

@jbardin jbardin mentioned this pull request Jun 3, 2024
jbardin added a commit that referenced this pull request Jun 3, 2024
Copy link

github-actions bot commented Jul 5, 2024

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1.9-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic block not reflected in terraform plan when for_each argument is known after apply
2 participants