Skip to content

Conversation

@stephybun
Copy link
Member

Description

Adds the following types to list schema

  • BoolAttribute
  • Float32Attribute
  • Float64Attribute
  • Int32Attribute
  • Int64Attribute
  • ListAttribute
  • MapAttribute

I suspect some additional tests are missing somewhere else as well...

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

None

@stephybun stephybun requested a review from a team as a code owner July 4, 2025 10:04
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed this to follow the naming convention in the directory

austinvalle
austinvalle previously approved these changes Jul 7, 2025
Copy link
Member

@austinvalle austinvalle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left some nit comments as well as a comment about adding NumberAttribute, but that can all be done in future PRs if you prefer 🚀


In terms of tests I don't think there are any missing from here, there may be some more "integration" like tests in packages like fwserver and such for GetProviderSchema, but I think those are kind of overkill anyways 😅 . The testing in this PR seems reasonable; if we want to add more testing, we could consider writing tests over in terraform-provider-corner later 👍🏻

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this PR, as we can always come back later and add more types

Is it written down anywhere the full list of attribute types we'll end up supporting for list configs? I couldn't find it in any of the RFCs 👀

Since the configuration syntax is in a nested block, we should be able to support all of the nested types as well (nested attributes, nested blocks), unless we are explicitly choosing not to support them.

If we don't support either nested types, we might want to consider also supporting single object types via an ObjectAttribute.


I'd also be interested if we are going to support DynamicAttribute / DynamicPseudoType, which is also kind of a "primitive" attribute depending on how you view it 😆


And related to collections, the set attributes as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems it was agreed to limit support to lists and maps of primitives in an internal discussion. DynamicAttribute sounds like a helpful thing to have here though so I'll add that in a follow up PR.

Comment on lines +32 to +33
// Use ListNestedAttribute if the underlying elements should be objects and
// require definition beyond type information.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Depending on if we are supporting nested attribute types, this might need to be removed 👀

Same comment for MapAttribute and it's pkg docs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will address this comment in a follow up PR adding DynamicAttribute

@austinvalle austinvalle added this to the v1.16.0 milestone Jul 8, 2025
@stephybun stephybun merged commit 8c780f1 into main Jul 9, 2025
35 checks passed
@stephybun stephybun deleted the f/add-types-to-list-schema branch July 9, 2025 07:28
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants