hashicorp / terraform-plugin-codegen-spec

Terraform Provider Code Generation Specification and Go Bindings
Mozilla Public License 2.0
8 stars 4 forks source link

Remove Framework-specific Implementation Details from Plan Modifiers #83

Closed bendbennett closed 8 months ago

bendbennett commented 8 months ago

Background

Currently, the schema relating to plan modifiers allows the following:

    "schema_<TYPE>_plan_modifier": {
      "type": "object",
      "properties": {
        "custom": {
          "$ref": "#/$defs/schema_custom_plan_modifier"
        },
        "requires_replace": {
          "type": "object",
          "additionalProperties": false
        },
        "use_state_for_unknown": {
          "type": "object",
          "additionalProperties": false
        }
      },
      "oneOf": [
        {
          "required": [
            "custom"
          ]
        },
        {
          "required": [
            "requires_replace"
          ]
        },
        {
          "required": [
            "use_state_for_unknown"
          ]
        }
      ]
    },

Both requires_replace, and use_state_for_unknown are implementation details that are specific to the framework.

Proposal

Both requires_replace, and use_state_for_unknown should be removed from the schema.

Further Considerations

We could consider adding Terraform-specific behaviours as their own properties (e.g., "does not change on update").

github-actions[bot] commented 4 months ago

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.