Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add is_priority param to auth0_log_stream #1102

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
go-version-file: go.mod
check-latest: true

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3

- name: Check that docs were generated
run: make check-docs

Expand Down
1 change: 1 addition & 0 deletions docs/resources/log_stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ resource "auth0_log_stream" "example_aws" {
### Optional

- `filters` (List of Map of String) Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered. Filters available: `auth.ancillary.fail`, `auth.ancillary.success`, `auth.login.fail`, `auth.login.notification`, `auth.login.success`, `auth.logout.fail`, `auth.logout.success`, `auth.signup.fail`, `auth.signup.success`, `auth.silent_auth.fail`, `auth.silent_auth.success`, `auth.token_exchange.fail`, `auth.token_exchange.success`, `management.fail`, `management.success`, `system.notification`, `user.fail`, `user.notification`, `user.success`, `other`.
- `is_priority` (Boolean) Set True for priority log streams, False for non-priority
- `status` (String) The current status of the log stream. Options are "active", "paused", "suspended".

### Read-Only
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/prompt_custom_text.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ resource "auth0_prompt_custom_text" "example" {
### Required

- `body` (String) JSON containing the custom texts. You can check the options for each prompt [here](https://auth0.com/docs/customize/universal-login-pages/customize-login-text-prompts#prompt-values).
- `language` (String) Language of the custom text. Options include: `ar`, `ar-EG`, `ar-SA`, `az`, `bg`, `bs`, `ca-ES`, `cs`, `cy`, `da`, `de`, `el`, `en`, `es`, `es-AR`, `es-MX`, `et`, `eu-ES`, `fa`, `fi`, `fr`, `fr-CA`, `fr-FR`, `gl-ES`, `he`, `hi`, `hr`, `hu`, `hy`, `id`, `is`, `it`, `ja`, `ko`, `lt`, `lv`, `ms`, `nb`, `nl`, `nn`, `no`, `pl`, `pt`, `pt-BR`, `pt-PT`, `ro`, `ru`, `sk`, `sl`, `sq`, `sr`, `sv`, `th`, `tl`, `tr`, `uk`, `ur`, `vi`, `zh-CN`, `zh-HK`, `zh-TW`.
- `language` (String) Language of the custom text. Options include: `am`, `ar`, `ar-EG`, `ar-SA`, `az`, `bg`, `bn`, `bs`, `ca-ES`, `cnr`, `cs`, `cy`, `da`, `de`, `el`, `en`, `en-CA`, `es`, `es-419`, `es-AR`, `es-MX`, `et`, `eu-ES`, `fa`, `fi`, `fr`, `fr-CA`, `fr-FR`, `gl-ES`, `gu`, `he`, `hi`, `hr`, `hu`, `hy`, `id`, `is`, `it`, `ja`, `ka`, `kk`, `kn`, `ko`, `lt`, `lv`, `mk`, `ml`, `mn`, `mr`, `ms`, `my`, `nb`, `nl`, `nn`, `no`, `pa`, `pl`, `pt`, `pt-BR`, `pt-PT`, `ro`, `ru`, `sk`, `sl`, `so`, `sq`, `sr`, `sv`, `sw`, `ta`, `te`, `th`, `tl`, `tr`, `uk`, `ur`, `vi`, `zgh`, `zh-CN`, `zh-HK`, `zh-TW`.
- `prompt` (String) The term `prompt` is used to refer to a specific step in the login flow. Options include: `captcha`, `common`, `consent`, `custom-form`, `customized-consent`, `device-flow`, `email-otp-challenge`, `email-verification`, `invitation`, `login`, `login-email-verification`, `login-id`, `login-password`, `login-passwordless`, `logout`, `mfa`, `mfa-email`, `mfa-otp`, `mfa-phone`, `mfa-push`, `mfa-recovery-code`, `mfa-sms`, `mfa-voice`, `mfa-webauthn`, `organizations`, `passkeys`, `phone-identifier-challenge`, `phone-identifier-enrollment`, `reset-password`, `signup`, `signup-id`, `signup-password`, `status`.

### Read-Only
Expand Down
4 changes: 4 additions & 0 deletions internal/auth0/logstream/expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ func expandLogStream(data *schema.ResourceData) *management.LogStream {
logStream.Status = value.String(config.GetAttr("status"))
}

if data.HasChange("is_priority") {
logStream.IsPriority = value.Bool(config.GetAttr("is_priority"))
}

filtersConfig := config.GetAttr("filters")
if !filtersConfig.IsNull() {
filters := make([]map[string]string, 0)
Expand Down
1 change: 1 addition & 0 deletions internal/auth0/logstream/flatten.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ func flattenLogStream(data *schema.ResourceData, logStream *management.LogStream
result := multierror.Append(
data.Set("name", logStream.GetName()),
data.Set("status", logStream.GetStatus()),
data.Set("is_priority", logStream.GetIsPriority()),
data.Set("type", logStream.GetType()),
data.Set("filters", logStream.Filters),
data.Set("sink", flattenLogStreamSink(data, logStream.Sink)),
Expand Down
10 changes: 9 additions & 1 deletion internal/auth0/logstream/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ func NewResource() *schema.Resource {
Description: "Type of the log stream, which indicates the sink provider. " +
"Options include: `" + strings.Join(validLogStreamTypes, "`, `") + "`.",
},
"is_priority": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Description: "Set True for priority log streams, False for non-priority",
},
"status": {
Type: schema.TypeString,
Optional: true,
Expand All @@ -63,6 +69,7 @@ func NewResource() *schema.Resource {
"filters": {
Type: schema.TypeList,
Optional: true,
Computed: true,
Description: "Only logs events matching these filters will be delivered by the stream." +
" If omitted or empty, all events will be delivered. " +
"Filters available: `auth.ancillary.fail`, `auth.ancillary.success`, `auth.login.fail`, " +
Expand Down Expand Up @@ -237,7 +244,8 @@ func NewResource() *schema.Resource {
Description: "Sent in the HTTP \"Authorization\" header with each request.",
},
"http_custom_headers": {
Type: schema.TypeList,
Type: schema.TypeList,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeMap,
Elem: &schema.Schema{
Expand Down
Loading