diff --git a/docs/resources/tag.md b/docs/resources/tag.md index 4f7cfe9..c5c6a37 100644 --- a/docs/resources/tag.md +++ b/docs/resources/tag.md @@ -18,12 +18,12 @@ Flagsmith Tag ### Required - `project_uuid` (String) UUID of project the tag belongs to -- `tag_colour` (String) Hexadecimal value of the tag color - `tag_name` (String) Name of the tag ### Optional - `description` (String) Description of the feature +- `tag_colour` (String) Colour for this tag, as accepted by [color-string](https://github.com/Qix-/color-string). ### Read-Only diff --git a/flagsmith/resource_tag.go b/flagsmith/resource_tag.go index 83eff9e..ef699e2 100644 --- a/flagsmith/resource_tag.go +++ b/flagsmith/resource_tag.go @@ -7,6 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" "strings" "github.com/hashicorp/terraform-plugin-framework/resource/schema/int64planmodifier" @@ -75,8 +76,10 @@ func (t *tagResource) Schema(ctx context.Context, req resource.SchemaRequest, re MarkdownDescription: "Name of the tag", }, "tag_colour": schema.StringAttribute{ - Required: true, - MarkdownDescription: "Hexadecimal value of the tag color", + Computed: true, + Optional: true, + Default: stringdefault.StaticString("#6837FC"), + MarkdownDescription: "Colour for this tag, as accepted by [color-string](https://github.com/Qix-/color-string).", }, "description": schema.StringAttribute{ Optional: true,