// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "./types"; import * as utilities from "./utilities"; /** * Creates or updates a component template. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-component-template.html * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as elasticstack from "@pulumi/elasticstack"; * * const myTemplateElasticsearchComponentTemplate = new elasticstack.ElasticsearchComponentTemplate("myTemplateElasticsearchComponentTemplate", {template: { * aliases: [{ * name: "my_template_test", * }], * settings: JSON.stringify({ * number_of_shards: "3", * }), * }}); * const myTemplateElasticsearchIndexTemplate = new elasticstack.ElasticsearchIndexTemplate("myTemplateElasticsearchIndexTemplate", { * indexPatterns: ["stream*"], * composedOfs: [myTemplateElasticsearchComponentTemplate.name], * }); * ``` * * ## Import * * ```sh * $ pulumi import elasticstack:index/elasticsearchComponentTemplate:ElasticsearchComponentTemplate my_template / * ``` */ export class ElasticsearchComponentTemplate extends pulumi.CustomResource { /** * Get an existing ElasticsearchComponentTemplate resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ public static get(name: string, id: pulumi.Input, state?: ElasticsearchComponentTemplateState, opts?: pulumi.CustomResourceOptions): ElasticsearchComponentTemplate { return new ElasticsearchComponentTemplate(name, state, { ...opts, id: id }); } /** @internal */ public static readonly __pulumiType = 'elasticstack:index/elasticsearchComponentTemplate:ElasticsearchComponentTemplate'; /** * Returns true if the given object is an instance of ElasticsearchComponentTemplate. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ public static isInstance(obj: any): obj is ElasticsearchComponentTemplate { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === ElasticsearchComponentTemplate.__pulumiType; } /** * Used to establish connection to Elasticsearch server. Overrides environment variables if present. */ public readonly elasticsearchConnection!: pulumi.Output; /** * Internal identifier of the resource */ public /*out*/ readonly id!: pulumi.Output; /** * Optional user metadata about the component template. */ public readonly metadata!: pulumi.Output; /** * Name of the component template to create. */ public readonly name!: pulumi.Output; /** * Template to be applied. It may optionally include an aliases, mappings, or settings configuration. */ public readonly template!: pulumi.Output; /** * Version number used to manage component templates externally. */ public readonly version!: pulumi.Output; /** * Create a ElasticsearchComponentTemplate resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: ElasticsearchComponentTemplateArgs, opts?: pulumi.CustomResourceOptions) constructor(name: string, argsOrState?: ElasticsearchComponentTemplateArgs | ElasticsearchComponentTemplateState, opts?: pulumi.CustomResourceOptions) { let resourceInputs: pulumi.Inputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState as ElasticsearchComponentTemplateState | undefined; resourceInputs["elasticsearchConnection"] = state ? state.elasticsearchConnection : undefined; resourceInputs["id"] = state ? state.id : undefined; resourceInputs["metadata"] = state ? state.metadata : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["template"] = state ? state.template : undefined; resourceInputs["version"] = state ? state.version : undefined; } else { const args = argsOrState as ElasticsearchComponentTemplateArgs | undefined; if ((!args || args.template === undefined) && !opts.urn) { throw new Error("Missing required property 'template'"); } resourceInputs["elasticsearchConnection"] = args ? args.elasticsearchConnection : undefined; resourceInputs["metadata"] = args ? args.metadata : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["template"] = args ? args.template : undefined; resourceInputs["version"] = args ? args.version : undefined; resourceInputs["id"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ElasticsearchComponentTemplate.__pulumiType, name, resourceInputs, opts); } } /** * Input properties used for looking up and filtering ElasticsearchComponentTemplate resources. */ export interface ElasticsearchComponentTemplateState { /** * Used to establish connection to Elasticsearch server. Overrides environment variables if present. */ elasticsearchConnection?: pulumi.Input; /** * Internal identifier of the resource */ id?: pulumi.Input; /** * Optional user metadata about the component template. */ metadata?: pulumi.Input; /** * Name of the component template to create. */ name?: pulumi.Input; /** * Template to be applied. It may optionally include an aliases, mappings, or settings configuration. */ template?: pulumi.Input; /** * Version number used to manage component templates externally. */ version?: pulumi.Input; } /** * The set of arguments for constructing a ElasticsearchComponentTemplate resource. */ export interface ElasticsearchComponentTemplateArgs { /** * Used to establish connection to Elasticsearch server. Overrides environment variables if present. */ elasticsearchConnection?: pulumi.Input; /** * Optional user metadata about the component template. */ metadata?: pulumi.Input; /** * Name of the component template to create. */ name?: pulumi.Input; /** * Template to be applied. It may optionally include an aliases, mappings, or settings configuration. */ template: pulumi.Input; /** * Version number used to manage component templates externally. */ version?: pulumi.Input; }