terraform/builtin
Martin Atkins bdcac8792d plugin: Use correct schema when marshaling imported resource objects
Previously we were using the type name requested in the import to select
the schema, but a provider is free to return additional objects of other
types as part of an import result, and so it's important that we perform
schema selection separately for each returned object.

If we don't do this, we get confusing downstream errors where the
resulting object decodes to the wrong type and breaks various invariants
expected by Terraform Core.

The testResourceImportOther test in the test provider didn't catch this
previously because it happened to have an identical schema to the other
resource type being imported. Now the schema is changed and also there's
a computed attribute we can set as part of the refresh phase to make sure
we're completing the Read call properly during import. Refresh was working
correctly, but we didn't have any tests for it as part of the import flow.
2019-02-01 15:22:54 -08:00
..
bins Initial implementation of a habitat provisioner 2017-12-07 16:29:30 -08:00
providers plugin: Use correct schema when marshaling imported resource objects 2019-02-01 15:22:54 -08:00
provisioners Merge pull request #18533 from alice-sawatzky/master 2018-10-11 10:29:01 +02:00