Skip to content

Support for write-only properties #352

@arjunrajinstaclustr

Description

@arjunrajinstaclustr

Is your feature request related to a problem?

The plugin seems to expect that all input properties on a terraform resource should be fetchable by the GET request for the resource, however there might be legitimate scenarios where an "input-only"/"write-only" property is needed. For example - providing some credentials to create a resource that only needs it at creation time (i.e on the POST request) and the service doesn't want to store these credentials to be fetched by the GET request.

Describe the solution you'd like

A new extension, example - x-terraform-write-only, which can be applied to input properties.

Using this extension, changes to the property should be ignored if they are changed to null, since the GET request would not return a value for it or return null.

When performing the diff on terraform state, the value of such properties could be obtained from the terraform state file rather than the API response.

Acceptance criteria

  • A new extension is introduced for write-only input properties
  • The new extension will ignore changes to null for the target property
  • The extension is compatible with terraform import

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

I've had a look through the feature set and documentation and I haven't found a way to deal with such properties, so feel free to close this issue if there is a workaround that I've missed.

Checklist (for admin only)

Don't forget to go through the checklist to make sure the issue is created properly:

  • I have added a corresponding label (feature request) to the issue (right side menu)
  • I have added this issue to the 'API Terraform Provider' GitHub project (right side menu)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions