in internal/clients/config/kibana.go [17:63]
func newKibanaConfigFromSDK(d *schema.ResourceData, base baseConfig) (kibanaConfig, sdkdiags.Diagnostics) {
var diags sdkdiags.Diagnostics
// Use ES details by default
config := base.toKibanaConfig()
kibConn, ok := d.GetOk("kibana")
if !ok {
return config, diags
}
// if defined, then we only have a single entry
if kib := kibConn.([]interface{})[0]; kib != nil {
kibConfig := kib.(map[string]interface{})
if username, ok := kibConfig["username"]; ok && username != "" {
config.Username = username.(string)
}
if password, ok := kibConfig["password"]; ok && password != "" {
config.Password = password.(string)
}
if apiKey, ok := kibConfig["api_key"]; ok && apiKey != "" {
config.ApiKey = apiKey.(string)
}
if endpoints, ok := kibConfig["endpoints"]; ok && len(endpoints.([]interface{})) > 0 {
// We're curently limited by the API to a single endpoint
if endpoint := endpoints.([]interface{})[0]; endpoint != nil {
config.Address = endpoint.(string)
}
}
if caCerts, ok := kibConfig["ca_certs"].([]interface{}); ok && len(caCerts) > 0 {
for _, elem := range caCerts {
if vStr, elemOk := elem.(string); elemOk {
config.CAs = append(config.CAs, vStr)
}
}
}
if insecure, ok := kibConfig["insecure"]; ok && insecure.(bool) {
config.DisableVerifySSL = true
}
}
return config.withEnvironmentOverrides(), nil
}