diff --git a/docs/resources/log_stream.md b/docs/resources/log_stream.md index 7c96e7d46..5450e603d 100644 --- a/docs/resources/log_stream.md +++ b/docs/resources/log_stream.md @@ -60,7 +60,7 @@ resource "auth0_log_stream" "example_aws" { - `name` (String) Name of the log stream. - `sink` (Block List, Min: 1, Max: 1) The sink configuration for the log stream. (see [below for nested schema](#nestedblock--sink)) -- `type` (String) Type of the log stream, which indicates the sink provider. +- `type` (String) Type of the log stream, which indicates the sink provider. Options include: `eventbridge`, `eventgrid`, `http`, `datadog`, `splunk`, `sumo`, `mixpanel`, `segment`. ### Optional diff --git a/internal/auth0/logstream/resource.go b/internal/auth0/logstream/resource.go index e26296eed..1f131e878 100644 --- a/internal/auth0/logstream/resource.go +++ b/internal/auth0/logstream/resource.go @@ -3,6 +3,7 @@ package logstream import ( "context" "net/http" + "strings" "github.com/auth0/go-auth0/management" "github.com/hashicorp/go-multierror" @@ -11,6 +12,17 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) +var validLogStreamTypes = []string{ + "eventbridge", + "eventgrid", + "http", + "datadog", + "splunk", + "sumo", + "mixpanel", + "segment", +} + // NewResource will return a new auth0_log_stream resource. func NewResource() *schema.Resource { return &schema.Resource{ @@ -29,20 +41,12 @@ func NewResource() *schema.Resource { Description: "Name of the log stream.", }, "type": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{ - "eventbridge", - "eventgrid", - "http", - "datadog", - "splunk", - "sumo", - "mixpanel", - "segment", - }, true), - ForceNew: true, - Description: "Type of the log stream, which indicates the sink provider.", + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice(validLogStreamTypes, true), + ForceNew: true, + Description: "Type of the log stream, which indicates the sink provider. " + + "Options include: `" + strings.Join(validLogStreamTypes, "`, `") + "`.", }, "status": { Type: schema.TypeString,