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

ListNestedAttribute can't be set to Computed in Resource #1104

Open
tom-ludwig opened this issue Feb 28, 2025 · 0 comments
Open

ListNestedAttribute can't be set to Computed in Resource #1104

tom-ludwig opened this issue Feb 28, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@tom-ludwig
Copy link

tom-ludwig commented Feb 28, 2025

Module version

github.com/hashicorp/terraform-plugin-framework v1.14.1

Relevant provider source code

type parentObject struct {
     someFields....
     ListNested []nestedObjectModel `tfsdk:"nestedList"`
			"nestedList": schema.ListNestedAttribute{
				Computed: true, <----- PROBLEM
				NestedObject: schema.NestedAttributeObject{
					Attributes: getNestedObjectSchema(),
				},
			},

Expected Behavior

The nestedList field should behave exactly like in the datasource.

Actual Behavior

An error is thrown:

____.go:222: Step 1/2 error: Error running apply: exit status 1

        Error: Value Conversion Error

          with ___.___,
          on terraform_plugin_test.tf line 12, in resource "____" "_____":
          12: resource "______" "________" {

        An unexpected error was encountered trying to build a value. This is always
        an error in the provider. Please report the following to the provider
        developer:

        Received unknown value, however the target type cannot handle unknown values.
        Use the corresponding `types` package type or a custom type that handles
        unknown values.

        Path: nestedList
        Target Type: []provider.nestedObjectModel
        Suggested Type: basetypes.ListValue

Steps to Reproduce

Try to mark a listNestedAttribute, as computed...

References

@tom-ludwig tom-ludwig added the bug Something isn't working label Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant