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

Match the config arguments to those in the provider. #256

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion providers/logzio/alert_notification_endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type AlertNotificationEndpointsGenerator struct {
// Generate Terraform Resources from Logzio API,
func (g *AlertNotificationEndpointsGenerator) InitResources() error {
var client *endpoints.EndpointsClient
client, _ = endpoints.New(g.Args["token"].(string), g.Args["baseURL"].(string))
client, _ = endpoints.New(g.Args["api_token"].(string), g.Args["base_url"].(string))

endpoints, err := client.ListEndpoints()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion providers/logzio/alerts.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type AlertsGenerator struct {
// Generate Terraform Resources from Logzio API,
func (g *AlertsGenerator) InitResources() error {
var client *alerts.AlertsClient
client, _ = alerts.New(g.Args["token"].(string), g.Args["baseURL"].(string))
client, _ = alerts.New(g.Args["api_token"].(string), g.Args["base_url"].(string))

alerts, err := client.ListAlerts()
if err != nil {
Expand Down
16 changes: 8 additions & 8 deletions providers/logzio/logzio_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (

type LogzioProvider struct {
terraform_utils.Provider
token string
baseURL string
apiToken string
baseURL string
}

var (
Expand All @@ -52,14 +52,14 @@ func (p LogzioProvider) GetProviderData(arg ...string) map[string]interface{} {

func (p *LogzioProvider) GetConfig() cty.Value {
return cty.ObjectVal(map[string]cty.Value{
"token": cty.StringVal(p.token),
"baseURL": cty.StringVal(p.baseURL),
"api_token": cty.StringVal(p.apiToken),
"base_url": cty.StringVal(p.baseURL),
})
}

// Init LogzioProvider with API token
// Init LogzioProvider with API apiToken
func (p *LogzioProvider) Init(args []string) error {
p.token = args[0]
p.apiToken = args[0]
p.baseURL = args[1]
return nil
}
Expand All @@ -77,8 +77,8 @@ func (p *LogzioProvider) InitService(serviceName string) error {
p.Service.SetName(serviceName)
p.Service.SetProviderName(p.GetName())
p.Service.SetArgs(map[string]interface{}{
"token": p.token,
"baseURL": p.baseURL,
"api_token": p.apiToken,
"base_url": p.baseURL,
})
return nil
}
Expand Down