Skip to content

ephemerals: allow root ephemeral outputs in stacks and test#37813

Merged
liamcervante merged 2 commits intomainfrom
liamcervante/ephemerals/stacks-and-tests
Oct 28, 2025
Merged

ephemerals: allow root ephemeral outputs in stacks and test#37813
liamcervante merged 2 commits intomainfrom
liamcervante/ephemerals/stacks-and-tests

Conversation

@liamcervante
Copy link
Copy Markdown
Contributor

Backport after 1.14.0 release.

We currently prevent root modules from exposing ephemeral values via outputs. This makes total sense as the ephemeral values shouldn't be saved or exposed anywhere.

However, in both stacks and terraform test, we sometimes pretend that a module is a root module when it isn't really. This PR disables the ephemeral check within Terraform Test and Terraform Stacks. For Stacks this is fine, as there are additional checks at the higher level to prevent stack outputs themselves being ephemeral. For Terraform Test we want people to actually test non-root modules, so we do need Core to support ephemeral outputs at the root module as the module being tested might not be intended to be consumed as a root module anyway.

Fixes #37805

Target Release

1.15.x

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

@liamcervante liamcervante requested a review from a team as a code owner October 24, 2025 14:53
@liamcervante liamcervante added the 1.14-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label Oct 24, 2025
jbardin
jbardin previously approved these changes Oct 24, 2025
@jbardin
Copy link
Copy Markdown
Member

jbardin commented Oct 24, 2025

My 👍 was assuming the failed test was a minor oversight, but the additional planning option seems like the only viable way to make this conditional at the moment.

@liamcervante liamcervante merged commit 411f18e into main Oct 28, 2025
9 checks passed
@liamcervante liamcervante deleted the liamcervante/ephemerals/stacks-and-tests branch October 28, 2025 08:29
@github-actions
Copy link
Copy Markdown
Contributor

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 Nov 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

1.14-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.

Allow the use of ephemeral values in the output for test modules

3 participants