1. Packages
  2. Logzio Provider
  3. API Docs
  4. getKibanaObject
logzio 1.17.1 published on Monday, Apr 14, 2025 by logzio

logzio.getKibanaObject

Explore with Pulumi AI

logzio logo
logzio 1.17.1 published on Monday, Apr 14, 2025 by logzio

    # Kibana Object Datasource

    Provides a Logz.io kibana object datasource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as fs from "fs";
    import * as logzio from "@pulumi/logzio";
    
    const config = new pulumi.Config();
    const apiToken = config.require("apiToken");
    const myKbObj = new logzio.KibanaObject("myKbObj", {
        kibanaVersion: "7.2.1",
        data: fs.readFileSync("/path/to/your/object/config.json", "utf8"),
    });
    const myKbObjDatasource = logzio.getKibanaObject({
        objectId: "search:tf-provider-test-search",
        objectType: "search",
    });
    
    import pulumi
    import pulumi_logzio as logzio
    
    config = pulumi.Config()
    api_token = config.require("apiToken")
    my_kb_obj = logzio.KibanaObject("myKbObj",
        kibana_version="7.2.1",
        data=(lambda path: open(path).read())("/path/to/your/object/config.json"))
    my_kb_obj_datasource = logzio.get_kibana_object(object_id="search:tf-provider-test-search",
        object_type="search")
    
    package main
    
    import (
    	"os"
    
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/logzio/logzio"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func readFileOrPanic(path string) pulumi.StringPtrInput {
    	data, err := os.ReadFile(path)
    	if err != nil {
    		panic(err.Error())
    	}
    	return pulumi.String(string(data))
    }
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		apiToken := cfg.Require("apiToken")
    		_, err := logzio.NewKibanaObject(ctx, "myKbObj", &logzio.KibanaObjectArgs{
    			KibanaVersion: pulumi.String("7.2.1"),
    			Data:          pulumi.String(readFileOrPanic("/path/to/your/object/config.json")),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = logzio.LookupKibanaObject(ctx, &logzio.LookupKibanaObjectArgs{
    			ObjectId:   "search:tf-provider-test-search",
    			ObjectType: "search",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using Pulumi;
    using Logzio = Pulumi.Logzio;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var apiToken = config.Require("apiToken");
        var myKbObj = new Logzio.KibanaObject("myKbObj", new()
        {
            KibanaVersion = "7.2.1",
            Data = File.ReadAllText("/path/to/your/object/config.json"),
        });
    
        var myKbObjDatasource = Logzio.GetKibanaObject.Invoke(new()
        {
            ObjectId = "search:tf-provider-test-search",
            ObjectType = "search",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.logzio.KibanaObject;
    import com.pulumi.logzio.KibanaObjectArgs;
    import com.pulumi.logzio.LogzioFunctions;
    import com.pulumi.logzio.inputs.GetKibanaObjectArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var config = ctx.config();
            final var apiToken = config.get("apiToken");
            var myKbObj = new KibanaObject("myKbObj", KibanaObjectArgs.builder()
                .kibanaVersion("7.2.1")
                .data(Files.readString(Paths.get("/path/to/your/object/config.json")))
                .build());
    
            final var myKbObjDatasource = LogzioFunctions.getKibanaObject(GetKibanaObjectArgs.builder()
                .objectId("search:tf-provider-test-search")
                .objectType("search")
                .build());
    
        }
    }
    
    configuration:
      apiToken:
        type: string
    resources:
      myKbObj:
        type: logzio:KibanaObject
        properties:
          kibanaVersion: 7.2.1
          data:
            fn::readFile: /path/to/your/object/config.json
    variables:
      myKbObjDatasource:
        fn::invoke:
          function: logzio:getKibanaObject
          arguments:
            objectId: search:tf-provider-test-search
            objectType: search
    

    Using getKibanaObject

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getKibanaObject(args: GetKibanaObjectArgs, opts?: InvokeOptions): Promise<GetKibanaObjectResult>
    function getKibanaObjectOutput(args: GetKibanaObjectOutputArgs, opts?: InvokeOptions): Output<GetKibanaObjectResult>
    def get_kibana_object(data: Optional[str] = None,
                          id: Optional[str] = None,
                          kibana_version: Optional[str] = None,
                          object_id: Optional[str] = None,
                          object_type: Optional[str] = None,
                          timeouts: Optional[GetKibanaObjectTimeouts] = None,
                          opts: Optional[InvokeOptions] = None) -> GetKibanaObjectResult
    def get_kibana_object_output(data: Optional[pulumi.Input[str]] = None,
                          id: Optional[pulumi.Input[str]] = None,
                          kibana_version: Optional[pulumi.Input[str]] = None,
                          object_id: Optional[pulumi.Input[str]] = None,
                          object_type: Optional[pulumi.Input[str]] = None,
                          timeouts: Optional[pulumi.Input[GetKibanaObjectTimeoutsArgs]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetKibanaObjectResult]
    func LookupKibanaObject(ctx *Context, args *LookupKibanaObjectArgs, opts ...InvokeOption) (*LookupKibanaObjectResult, error)
    func LookupKibanaObjectOutput(ctx *Context, args *LookupKibanaObjectOutputArgs, opts ...InvokeOption) LookupKibanaObjectResultOutput

    > Note: This function is named LookupKibanaObject in the Go SDK.

    public static class GetKibanaObject 
    {
        public static Task<GetKibanaObjectResult> InvokeAsync(GetKibanaObjectArgs args, InvokeOptions? opts = null)
        public static Output<GetKibanaObjectResult> Invoke(GetKibanaObjectInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetKibanaObjectResult> getKibanaObject(GetKibanaObjectArgs args, InvokeOptions options)
    public static Output<GetKibanaObjectResult> getKibanaObject(GetKibanaObjectArgs args, InvokeOptions options)
    
    fn::invoke:
      function: logzio:index/getKibanaObject:getKibanaObject
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ObjectId string
    The id of the Kibana Object.
    ObjectType string
    The type of the Kibana Object. Can be one of the following: search, dashboard, visualization.
    Data string
    (String) Exported Kibana objects.
    Id string
    KibanaVersion string
    (String) The version of Kibana used at the time of export.
    Timeouts GetKibanaObjectTimeouts
    ObjectId string
    The id of the Kibana Object.
    ObjectType string
    The type of the Kibana Object. Can be one of the following: search, dashboard, visualization.
    Data string
    (String) Exported Kibana objects.
    Id string
    KibanaVersion string
    (String) The version of Kibana used at the time of export.
    Timeouts GetKibanaObjectTimeouts
    objectId String
    The id of the Kibana Object.
    objectType String
    The type of the Kibana Object. Can be one of the following: search, dashboard, visualization.
    data String
    (String) Exported Kibana objects.
    id String
    kibanaVersion String
    (String) The version of Kibana used at the time of export.
    timeouts GetKibanaObjectTimeouts
    objectId string
    The id of the Kibana Object.
    objectType string
    The type of the Kibana Object. Can be one of the following: search, dashboard, visualization.
    data string
    (String) Exported Kibana objects.
    id string
    kibanaVersion string
    (String) The version of Kibana used at the time of export.
    timeouts GetKibanaObjectTimeouts
    object_id str
    The id of the Kibana Object.
    object_type str
    The type of the Kibana Object. Can be one of the following: search, dashboard, visualization.
    data str
    (String) Exported Kibana objects.
    id str
    kibana_version str
    (String) The version of Kibana used at the time of export.
    timeouts GetKibanaObjectTimeouts
    objectId String
    The id of the Kibana Object.
    objectType String
    The type of the Kibana Object. Can be one of the following: search, dashboard, visualization.
    data String
    (String) Exported Kibana objects.
    id String
    kibanaVersion String
    (String) The version of Kibana used at the time of export.
    timeouts Property Map

    getKibanaObject Result

    The following output properties are available:

    Data string
    (String) Exported Kibana objects.
    Id string
    KibanaVersion string
    (String) The version of Kibana used at the time of export.
    ObjectId string
    ObjectType string
    Timeouts GetKibanaObjectTimeouts
    Data string
    (String) Exported Kibana objects.
    Id string
    KibanaVersion string
    (String) The version of Kibana used at the time of export.
    ObjectId string
    ObjectType string
    Timeouts GetKibanaObjectTimeouts
    data String
    (String) Exported Kibana objects.
    id String
    kibanaVersion String
    (String) The version of Kibana used at the time of export.
    objectId String
    objectType String
    timeouts GetKibanaObjectTimeouts
    data string
    (String) Exported Kibana objects.
    id string
    kibanaVersion string
    (String) The version of Kibana used at the time of export.
    objectId string
    objectType string
    timeouts GetKibanaObjectTimeouts
    data str
    (String) Exported Kibana objects.
    id str
    kibana_version str
    (String) The version of Kibana used at the time of export.
    object_id str
    object_type str
    timeouts GetKibanaObjectTimeouts
    data String
    (String) Exported Kibana objects.
    id String
    kibanaVersion String
    (String) The version of Kibana used at the time of export.
    objectId String
    objectType String
    timeouts Property Map

    Supporting Types

    GetKibanaObjectTimeouts

    Read string
    Read string
    read String
    read string
    read str
    read String

    Package Details

    Repository
    logzio logzio/terraform-provider-logzio
    License
    Notes
    This Pulumi package is based on the logzio Terraform Provider.
    logzio logo
    logzio 1.17.1 published on Monday, Apr 14, 2025 by logzio