crossplane / crossplane/upjet

tfpluginsdk: cannot build schema for terraform type "List of Map of String"

Open
#597 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
481
Forks
131
Avg merge
2d 1h
Merged PRs (30d)
11

Description

### What happened?
Trying to convert a provider for terraform-provider-auth0 to using TerraformPluginSDK. On `make generate`, i get:
`panic: cannot generate crd for resource auth0_custom_domain: cannot build types for CustomDomain: cannot build the Types for resource "auth0_custom_domain": cannot infer type from schema of field verification: cannot infer type from resource schema of element type of CustomDomain.Verification: cannot infer type from schema of field methods: element type of CustomDomain.Verification.Methods is basic but not one of known basic types`.

The terraform attribute in question: https://github.com/auth0/terraform-provider-auth0/blob/main/internal/auth0/customdomain/resource.go#L89:
```go
"methods": {
Type: schema.TypeList,
Elem: schema.TypeMap,
Computed: true,
Description: "Defines the list of domain verification methods used. ",
},
```

The error comes from https://github.com/crossplane/upjet/blob/main/pkg/types/builder.go#L254, where this case is simply not expected.

I have a hard time figuring out how to deal with this. i guess `types.Universe.Lookup("map[string]string")` is not a thing.
Any advice how to improve upjet to properly handle this?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with make generate while converting the terraform-provider-auth0 resource. Read pkg/types/builder.go around line 254 and compare it with the methods schema in internal/auth0/customdomain/resource.go around line 89. Done means generation handles the List of Map of String schema without the reported panic.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, terraform
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.