Skip to content

Conversation

manupedrozo
Copy link
Collaborator

Description

Adding a custom NestedList terraform type for autogen usage following the work done at #3801 which added a custom Object type.

Note that NestedList supports nested objects but not Terraform attr types, e.g. types.string. These will be covered in the next PR.

I was initially planning to support both in the same custom type but it requires a lot of extra branching so instead we'll introduce a different type for attr types.
This is just like schema.ListNestedAttribute is used for nested objects and schema.ListAttribute for primitives.

Custom TF types docs: https://developer.hashicorp.com/terraform/plugin/framework/handling-data/types/custom

Link to any related issue(s): CLOUDP-353169

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contributing guides
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals I have added appropriate changelog entries.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

@manupedrozo manupedrozo changed the title Add support for typed nested lists in autogen chore: Add support for typed nested lists in autogen Oct 23, 2025
@manupedrozo manupedrozo force-pushed the CLOUDP-349397-autogen-nested-list-attribute-typing branch from f87e24a to 85be3a7 Compare October 23, 2025 19:13
@@ -0,0 +1,217 @@
package customtype
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll rename this package in a separate PR to customtypes to follow convention.

@manupedrozo manupedrozo marked this pull request as ready for review October 23, 2025 19:19
@manupedrozo manupedrozo requested a review from a team as a code owner October 23, 2025 19: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.

1 participant