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

Crash using vra provider #154

Closed
helperton opened this issue May 3, 2019 · 3 comments
Closed

Crash using vra provider #154

helperton opened this issue May 3, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@helperton
Copy link

Terraform Version

Terraform v0.11.13
+ provider.vra7 (unversioned)

Terraform Configuration Files

provider "vra7" {
  username = "user"
  password = "password"
  tenant = "vsphere.local"
  host = "hostname"
  insecure = false
}

resource "vra7_deployment" "example_machine1" {
  catalog_item_name = "RHEL Server CICD"
  reasons      = "I have some"
  description  = "deployment via terraform"
   resource_configuration = {
         Linux.cpu = "1"
         Windows2008R2SP1.cpu =  "2"
         Windows2012.cpu =  "4"
         Windows2016.cpu =  "2"
     }
     deployment_configuration = {
         _leaseDays = "1"
     }
     count = 1
}

Debug Output

Crash Output

https://gist.github.com/helperton/abe27cd4f73b65118139fe1b0958ad9f

Expected Behavior

Should have run 'terraform plan'

Actual Behavior

Crash: https://gist.github.com/helperton/b088a982a6d071444f3683d9cf5a14b8

Steps to Reproduce

1. `terraform init`
2. `terraform plan`

Additional Context

References

@apparentlymart
Copy link
Contributor

Hi @helperton! Sorry for the late response here.

This crash message seems to suggest that the provider is using a combination of schema types that the SDK doesn't support. Specifically, I believe somewhere in its schema is a declaration of a map of maps, which the SDK does not currently support.

It is strange that this would cause a crash rather than a provider validation error, and so I'm going to mark this as an SDK bug. However, the fix to that bug will be to make this return a better error, rather than to make it work. The real fix here will be a change in the provider to make its schema valid, which will involve finding a different way to represent whatever attribute is currently defined as being a map of maps. A common approach in providers today is to rename the attribute to have a _json suffix and make it a JSON string that can then support any arbitrary structure.

A future version of the SDK will support arbitrary combinations of types such as maps of maps, but the current SDK is limited by what Terraform 0.11 can support because current providers are still cross-compatible between 0.12 and 0.11. Once the new SDK is available (work on that is starting now, but it's still to early to know the scope of it because it's in the design phase), provider developers will need to decide when is an appropriate time to end support for Terraform 0.11 and in return get full support for the Terraform 0.12 type system. Complex structures represented as JSON string attributes is the standard workaround to get things done today while the new SDK is in progress.

@hashibot hashibot transferred this issue from hashicorp/terraform Sep 26, 2019
@hashibot hashibot added the bug Something isn't working label Oct 2, 2019
@paultyng
Copy link
Contributor

Merging this with complex map support, #62

@ghost
Copy link

ghost commented Mar 13, 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 and limited conversation to collaborators Mar 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants