Skip to content

Create a custom Terraform Plugin Framework UUID type #36

Closed
@ethanndickson

Description

@ethanndickson

Currently, we store UUIDs in Terraform resources & data sources as instances of types.String (basetypes.Stringtype). This is an issue as it means:

  • We convert strings to UUIDs to call codersdk functions that accept a UUID.
  • We convert codersdk returned UUIDs to strings to store them in Terraform resources/data sources.
  • We have no guarantees that a non-null, non-unknown ID field stores a valid UUID.

We can fix this by implementing a Terraform Plugin Framework custom type, as per the documentation.

Activity

johnstcn

johnstcn commented on Jul 22, 2024

@johnstcn
Member

@ethanndickson can you provide more information and/or context on this issue please?

ethanndickson

ethanndickson commented on Jul 22, 2024

@ethanndickson
MemberAuthor

Apologies, fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @johnstcn@ethanndickson

      Issue actions

        Create a custom Terraform Plugin Framework UUID type · Issue #36 · coder/terraform-provider-coderd