Skip to content

Commit

Permalink
Document the possible type values for the auth0 log stream resource
Browse files Browse the repository at this point in the history
  • Loading branch information
ginman86 authored and sergiught committed Mar 3, 2023
1 parent 70a078a commit bfd438b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/resources/log_stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
32 changes: 18 additions & 14 deletions internal/auth0/logstream/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package logstream
import (
"context"
"net/http"
"strings"

"github.com/auth0/go-auth0/management"
"github.com/hashicorp/go-multierror"
Expand All @@ -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{
Expand All @@ -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,
Expand Down

0 comments on commit bfd438b

Please sign in to comment.