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

Terraform TypeList TypeSet do doesn't seem to work in terraform 13.4 #26733

Closed
ovadbar opened this issue Oct 28, 2020 · 2 comments
Closed

Terraform TypeList TypeSet do doesn't seem to work in terraform 13.4 #26733

ovadbar opened this issue Oct 28, 2020 · 2 comments
Labels
bug new new issue not yet triaged

Comments

@ovadbar
Copy link

ovadbar commented Oct 28, 2020

Terraform Version

terraform 13.4 & 13.5

Terraform v0.13.5

Terraform Configuration Files

https://github.com/ovadbar/terraform13-TypeList-bug

Debug Output

https://github.com/ovadbar/terraform13-TypeList-bug/blob/main/trace

Crash Output

Expected Behavior

Validate successfully

Actual Behavior

../test/terraform validate

Error: Incorrect attribute value type

  on main.tf line 5, in resource "dummy_dummy" "dummy":
   5: 	test = {
   6: 		testlist = ["test", "tester"]
   7: 	}

Inappropriate value for attribute "test": element "testlist": string required.

Steps to Reproduce

  1. mkdir -p ~/.terraform.d/plugins/terraform.getdyl.com/dyl/dummy/1.0.0/darwin_amd64/
  2. go build -o terraform-provider-dummy_v1.0.0
  3. zip ~/.terraform.d/plugins/terraform.getdyl.com/dyl/dummy/1.0.0/darwin_amd64/terraform-provider-dummy_v1.0.0.zip terraform-provider-dummy_v1.0.0
  4. cp terraform-provider-dummy_v1.0.0 ~/.terraform.d/plugins/terraform.getdyl.com/dyl/dummy/1.0.0/darwin_amd64/terraform-provider-dummy_v1.0.0
  5. terraform init
  6. terraform validate

Additional Context

This is a custom built package

References

@ovadbar ovadbar added bug new new issue not yet triaged labels Oct 28, 2020
@apparentlymart
Copy link
Contributor

Hi @ovadbar,

The behavior you've seen here is a limitation of the current Terraform Plugin SDK rather than a bug: maps can only be of primitive types, not of nested collection or resource types. I believe this is usually detected and reported by the SDK's InternalValidate function, which providers usually call as part of their test suite but which your test provider here does not use.

That's a constraint of the SDK rather than of Terraform itself, and the SDK is developed separately in its own repository so there's no change we could make in this repository that would improve that situation, and so I'm going to close this. The Terraform SDK repository has an issue hashicorp/terraform-plugin-sdk#62 which seems to be discussing the situation you've raised here, so you could enable notifications for that issue if you're interest in knowing when the situation changes.

Thanks!

@ghost
Copy link

ghost commented Nov 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Nov 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug new new issue not yet triaged
Projects
None yet
Development

No branches or pull requests

2 participants