Skip to content

terraform test: Fill computed values of Nested collection type#38200

Open
dsa0x wants to merge 7 commits intomainfrom
sams/fill-nested
Open

terraform test: Fill computed values of Nested collection type#38200
dsa0x wants to merge 7 commits intomainfrom
sams/fill-nested

Conversation

@dsa0x
Copy link
Member

@dsa0x dsa0x commented Feb 23, 2026

Fixes #37939

This PR enables the mocking framework to fill in mocked values of collection types (set, list, map). The issue particularly affected providers that implement these collection types as a NestedBlock-style object, a behaviour which terraform knows how to deal with. In the PR, we can see that very little code change was made, because the ConfigType() method on the schema object has already helped us in converting the different block types into valid cty Types, e.g NestingList => cty.List. The returned type can then be used with fillType, which essentially traces all paths, and ensures that the mocked value adheres to the schema, or generates a value for the path.

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.

@dsa0x dsa0x changed the title Fill computed values of Nested type terraform test: Fill computed values of Nested collection type Feb 24, 2026
@dsa0x dsa0x marked this pull request as ready for review February 24, 2026 14:19
@dsa0x dsa0x requested a review from a team as a code owner February 24, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to mock data source attribute of list type using override_data, suspected due to missing type conversion

1 participant