logzio.KibanaObject
Explore with Pulumi AI
# Kibana Object Provider
Provides a Logz.io kibana object resource. This can be used to export and import kibana objects.
- Learn more about kibana objects in the Logz.io Docs
Note:
- The import operation is not available for this resource.
- This resource wraps the import/export API.
- The DELETE operation just deletes the resource from the state. To actually delete the object you’ll need to manually delete it from the app.
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 mySearch = new logzio.KibanaObject("mySearch", {
kibanaVersion: "7.2.1",
data: fs.readFileSync("/path/to/your/object/config.json", "utf8"),
});
import pulumi
import pulumi_logzio as logzio
config = pulumi.Config()
api_token = config.require("apiToken")
my_search = logzio.KibanaObject("mySearch",
kibana_version="7.2.1",
data=(lambda path: open(path).read())("/path/to/your/object/config.json"))
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, "mySearch", &logzio.KibanaObjectArgs{
KibanaVersion: pulumi.String("7.2.1"),
Data: pulumi.String(readFileOrPanic("/path/to/your/object/config.json")),
})
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 mySearch = new Logzio.KibanaObject("mySearch", new()
{
KibanaVersion = "7.2.1",
Data = File.ReadAllText("/path/to/your/object/config.json"),
});
});
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 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 mySearch = new KibanaObject("mySearch", KibanaObjectArgs.builder()
.kibanaVersion("7.2.1")
.data(Files.readString(Paths.get("/path/to/your/object/config.json")))
.build());
}
}
configuration:
apiToken:
type: string
resources:
mySearch:
type: logzio:KibanaObject
properties:
kibanaVersion: 7.2.1
data:
fn::readFile: /path/to/your/object/config.json
Example of config.json
{
"_index": "logzioCustomerIndex*",
"_type": "_doc",
"_id": "search:tf-provider-test-search",
"_score": 1.290984,
"_source": {
"search": {
"hits": 0,
"columns": [
"message"
],
"description": "",
"sort": [
"@timestamp",
"desc"
],
"id": "tf-provider-test-search",
"title": "tf provider test create search",
"version": 1,
"_updatedAt": 1561454443631,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"highlight\":{\"pre_tags\":[\"@kibana-highlighted-field@\"],\"post_tags\":[\"@/kibana-highlighted-field@\"],\"fields\":{\"*\":{}},\"fragment_size\":2147483647},\"filter\":[],\"query\":{\"query\":\"type: tf-provider-test\",\"language\":\"lucene\"},\"source\":{\"excludes\":[]},\"highlightAll\":true,\"version\":true,\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}"
},
"panelsJSON": "[]"
},
"type": "search",
"updated_at": 1561454443631,
"references": [
{
"name": "kibanaSavedObjectMeta.searchSourceJSON.index",
"type": "index-pattern",
"id": "logzioCustomerIndex*"
}
],
"id": "tf-provider-test-search"
}
}
Create KibanaObject Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new KibanaObject(name: string, args: KibanaObjectArgs, opts?: CustomResourceOptions);
@overload
def KibanaObject(resource_name: str,
args: KibanaObjectArgs,
opts: Optional[ResourceOptions] = None)
@overload
def KibanaObject(resource_name: str,
opts: Optional[ResourceOptions] = None,
data: Optional[str] = None,
kibana_version: Optional[str] = None,
kibana_object_id: Optional[str] = None)
func NewKibanaObject(ctx *Context, name string, args KibanaObjectArgs, opts ...ResourceOption) (*KibanaObject, error)
public KibanaObject(string name, KibanaObjectArgs args, CustomResourceOptions? opts = null)
public KibanaObject(String name, KibanaObjectArgs args)
public KibanaObject(String name, KibanaObjectArgs args, CustomResourceOptions options)
type: logzio:KibanaObject
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args KibanaObjectArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args KibanaObjectArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args KibanaObjectArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args KibanaObjectArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args KibanaObjectArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var kibanaObjectResource = new Logzio.KibanaObject("kibanaObjectResource", new()
{
Data = "string",
KibanaVersion = "string",
KibanaObjectId = "string",
});
example, err := logzio.NewKibanaObject(ctx, "kibanaObjectResource", &logzio.KibanaObjectArgs{
Data: pulumi.String("string"),
KibanaVersion: pulumi.String("string"),
KibanaObjectId: pulumi.String("string"),
})
var kibanaObjectResource = new KibanaObject("kibanaObjectResource", KibanaObjectArgs.builder()
.data("string")
.kibanaVersion("string")
.kibanaObjectId("string")
.build());
kibana_object_resource = logzio.KibanaObject("kibanaObjectResource",
data="string",
kibana_version="string",
kibana_object_id="string")
const kibanaObjectResource = new logzio.KibanaObject("kibanaObjectResource", {
data: "string",
kibanaVersion: "string",
kibanaObjectId: "string",
});
type: logzio:KibanaObject
properties:
data: string
kibanaObjectId: string
kibanaVersion: string
KibanaObject Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The KibanaObject resource accepts the following input properties:
- Data string
- Exported Kibana objects. Should be a valid JSON that was retrieved from an export operation of the API.
- string
- The version of Kibana used at the time of export.
- Kibana
Object stringId
- Data string
- Exported Kibana objects. Should be a valid JSON that was retrieved from an export operation of the API.
- string
- The version of Kibana used at the time of export.
- Kibana
Object stringId
- data String
- Exported Kibana objects. Should be a valid JSON that was retrieved from an export operation of the API.
- String
- The version of Kibana used at the time of export.
- kibana
Object StringId
- data string
- Exported Kibana objects. Should be a valid JSON that was retrieved from an export operation of the API.
- string
- The version of Kibana used at the time of export.
- kibana
Object stringId
- data str
- Exported Kibana objects. Should be a valid JSON that was retrieved from an export operation of the API.
- kibana_
version str - The version of Kibana used at the time of export.
- kibana_
object_ strid
- data String
- Exported Kibana objects. Should be a valid JSON that was retrieved from an export operation of the API.
- String
- The version of Kibana used at the time of export.
- kibana
Object StringId
Outputs
All input properties are implicitly available as output properties. Additionally, the KibanaObject resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing KibanaObject Resource
Get an existing KibanaObject resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: KibanaObjectState, opts?: CustomResourceOptions): KibanaObject
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
data: Optional[str] = None,
kibana_object_id: Optional[str] = None,
kibana_version: Optional[str] = None) -> KibanaObject
func GetKibanaObject(ctx *Context, name string, id IDInput, state *KibanaObjectState, opts ...ResourceOption) (*KibanaObject, error)
public static KibanaObject Get(string name, Input<string> id, KibanaObjectState? state, CustomResourceOptions? opts = null)
public static KibanaObject get(String name, Output<String> id, KibanaObjectState state, CustomResourceOptions options)
resources: _: type: logzio:KibanaObject get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Data string
- Exported Kibana objects. Should be a valid JSON that was retrieved from an export operation of the API.
- Kibana
Object stringId - string
- The version of Kibana used at the time of export.
- Data string
- Exported Kibana objects. Should be a valid JSON that was retrieved from an export operation of the API.
- Kibana
Object stringId - string
- The version of Kibana used at the time of export.
- data String
- Exported Kibana objects. Should be a valid JSON that was retrieved from an export operation of the API.
- kibana
Object StringId - String
- The version of Kibana used at the time of export.
- data string
- Exported Kibana objects. Should be a valid JSON that was retrieved from an export operation of the API.
- kibana
Object stringId - string
- The version of Kibana used at the time of export.
- data str
- Exported Kibana objects. Should be a valid JSON that was retrieved from an export operation of the API.
- kibana_
object_ strid - kibana_
version str - The version of Kibana used at the time of export.
- data String
- Exported Kibana objects. Should be a valid JSON that was retrieved from an export operation of the API.
- kibana
Object StringId - String
- The version of Kibana used at the time of export.
Package Details
- Repository
- logzio logzio/terraform-provider-logzio
- License
- Notes
- This Pulumi package is based on the
logzio
Terraform Provider.