Skip to content

Commit

Permalink
Use LOGZ_URL env var if it is set for the Logz auth handler
Browse files Browse the repository at this point in the history
  • Loading branch information
pengux committed Mar 25, 2021
1 parent e1a0250 commit 9cce4be
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions kibana/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package kibana

import (
"fmt"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
"log"
"os"
"sync"

"github.com/hashicorp/terraform-plugin-sdk/terraform"

"github.com/ewilde/go-kibana"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)
Expand Down Expand Up @@ -181,9 +182,14 @@ func getAuthHandler(config *kibana.Config, d *schema.ResourceData) kibana.Authen
}

func getLogzioAuthHandler(config *kibana.Config, d *schema.ResourceData) kibana.AuthenticationHandler {
url := config.KibanaBaseUri
if v := os.Getenv(kibana.EnvLogzURL); v != "" {
url = v
}

return &kibana.LogzAuthenticationHandler{
Auth0Uri: "https://logzio.auth0.com",
LogzUri: config.KibanaBaseUri,
LogzUri: url,
ClientId: d.Get("logzio_client_id").(string),
UserName: d.Get("kibana_username").(string),
Password: d.Get("kibana_password").(string),
Expand Down

0 comments on commit 9cce4be

Please sign in to comment.