Skip to content

Consider adding (deprecated) support for blocks 😢 #85

@paddycarver

Description

@paddycarver

Module version

v0.2.0

Use-cases

We decided to model nested fields as nested attributes, because they're better in basically every wayâ„¢, and I think that was a good decision.

However, for providers that currently exist and want to adopt the framework using mux, this presents two problems:

  1. Provider blocks need to match perfectly when muxing. But SDKv2 has no way to model nested attributes, and the framework has no way to model blocks, meaning if you have nested fields of any kind in your provider configuration, you just can't mux across SDKv2 and the framework. This is suboptimal, and makes migration to the framework much, much more difficult.
  2. Changing a group of nested fields from a block to an attribute is a breaking change, because it requires practitioners to add the = to their configuration. Meaning piecemeal migration of resources is not possible, as you can't model blocks in the framework, and need to migrate to nested attributes at that point, which is a practitioner-visible change.

Both of these problems severely limit how palatable our migration story can be.

Attempted Solutions

I thought about just relaxing mux to consider blocks and nested attributes the same for considering whether provider blocks are "equivalent" or not, as they'll both show up as objects in the config and can be accessed the same way. But that seems brittle, and would lead to weird situations where things aren't treated as sensitive properly, or where things can be expressed in the framework that SDKv2 doesn't know how to handle... it just feels like a really leaky abstraction and lossy mapping. It also doesn't address point 2 basically at all.

Proposal

I'm proposing that we add support to the framework for modeling blocks, and make it clear from its introduction that it is deprecated, we recommend everyone use nested attributes, and that it's only supported to ease migration from SDKv2. This isn't ideal, but I don't see a way to get a clean, piecemeal, non-practitioner-impacting migration strategy if we don't.

Metadata

Metadata

Assignees

Labels

design-docIssues or pull requests about a design document, capturing design ideas and trade-offs.enhancementNew feature or requestschemaIssues and pull requests about the abstraction for specifying schemas.sdkv2-parityIssues tracking feature parity with terraform-plugin-sdk v2 and PRs working towards it.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions