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

Fix for "invalid Schema.Elem 1; need *Schema or *Resource" #3429

Merged
merged 1 commit into from Jun 27, 2018

Conversation

Projects
None yet
4 participants
@squidfunk
Contributor

squidfunk commented Feb 18, 2018

I'm currently trying to extract the schema from the AWS provider to build an autocomplete provider for Atom, but Terraform panics at this location: https://github.com/hashicorp/terraform/blob/3253367c64ace91aa0f6c3abaaae66721f9b88a3/helper/schema/core_schema.go#L42-L50

I tracked the error down and found that some element types don't have schema definitions attached to them but reference types directly, like this:

Elem: schema.TypeString,

This fixes the error and seems consistent with the rest of the library:

Elem: &schema.Schema{Type: schema.TypeString},

This PR fixes all resources that trigger this error.

@ewbankkit

This comment has been minimized.

Contributor

ewbankkit commented Feb 19, 2018

See also #2914.

@squidfunk

This comment has been minimized.

Contributor

squidfunk commented Feb 19, 2018

@ewbankkit Great, so this is already a known issue. Note that the linked PR misses the fix for aws/resource_aws_glue_catalog_database.go which is included in this one. Any ETA for a fix to land in master?

@bflad bflad added this to the v1.26.0 milestone Jun 27, 2018

@bflad

bflad approved these changes Jun 27, 2018

Everything fell into place for #2914 so this pull request was good to go as well. On top of master after #2914 the only real change here was fixing aws_glue_catalog_database, which passes acceptance testing. Thanks @squidfunk! 🚀

make testacc TEST=./aws TESTARGS='-run=TestAccAWSGlueCatalogDatabase'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSGlueCatalogDatabase -timeout 120m
=== RUN   TestAccAWSGlueCatalogDatabase_importBasic
--- PASS: TestAccAWSGlueCatalogDatabase_importBasic (13.32s)
=== RUN   TestAccAWSGlueCatalogDatabase_full
--- PASS: TestAccAWSGlueCatalogDatabase_full (27.81s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	41.185s

@bflad bflad merged commit 285fb0e into terraform-providers:master Jun 27, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment