// *** 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 * as utilities from "./utilities"; /** * Helper data source to which can be used to create a processor to append one or more values to an existing array if the field already exists and it is an array. * Converts a scalar to an array and appends one or more values to it if the field exists and it is a scalar. Creates an array containing the provided values if the field doesn’t exist. * * See: https://www.elastic.co/guide/en/elasticsearch/reference/current/append-processor.html * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as elasticstack from "@pulumi/elasticstack"; * * const tags = elasticstack.ElasticsearchIngestProcessorAppend({ * field: "tags", * values: [ * "production", * "{{{app}}}", * "{{{owner}}}", * ], * }); * const myIngestPipeline = new elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", {processors: [tags.then(tags => tags.json)]}); * ``` */ export function elasticsearchIngestProcessorAppend(args: ElasticsearchIngestProcessorAppendArgs, opts?: pulumi.InvokeOptions): Promise { if (!opts) { opts = {} } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); return pulumi.runtime.invoke("elasticstack:index/elasticsearchIngestProcessorAppend:ElasticsearchIngestProcessorAppend", { "allowDuplicates": args.allowDuplicates, "description": args.description, "field": args.field, "if": args.if, "ignoreFailure": args.ignoreFailure, "mediaType": args.mediaType, "onFailures": args.onFailures, "tag": args.tag, "values": args.values, }, opts); } /** * A collection of arguments for invoking ElasticsearchIngestProcessorAppend. */ export interface ElasticsearchIngestProcessorAppendArgs { /** * If `false`, the processor does not append values already present in the field. */ allowDuplicates?: boolean; /** * Description of the processor. */ description?: string; /** * The field to be appended to. */ field: string; /** * Conditionally execute the processor */ if?: string; /** * Ignore failures for the processor. */ ignoreFailure?: boolean; /** * The media type for encoding value. Applies only when value is a template snippet. Must be one of `application/json`, `text/plain`, or `application/x-www-form-urlencoded`. */ mediaType?: string; /** * Handle failures for the processor. */ onFailures?: string[]; /** * Identifier for the processor. */ tag?: string; /** * The value to be appended. */ values: string[]; } /** * A collection of values returned by ElasticsearchIngestProcessorAppend. */ export interface ElasticsearchIngestProcessorAppendResult { /** * If `false`, the processor does not append values already present in the field. */ readonly allowDuplicates?: boolean; /** * Description of the processor. */ readonly description?: string; /** * The field to be appended to. */ readonly field: string; /** * Internal identifier of the resource */ readonly id: string; /** * Conditionally execute the processor */ readonly if?: string; /** * Ignore failures for the processor. */ readonly ignoreFailure?: boolean; /** * JSON representation of this data source. */ readonly json: string; /** * The media type for encoding value. Applies only when value is a template snippet. Must be one of `application/json`, `text/plain`, or `application/x-www-form-urlencoded`. */ readonly mediaType?: string; /** * Handle failures for the processor. */ readonly onFailures?: string[]; /** * Identifier for the processor. */ readonly tag?: string; /** * The value to be appended. */ readonly values: string[]; } export function elasticsearchIngestProcessorAppendOutput(args: ElasticsearchIngestProcessorAppendOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply(a => elasticsearchIngestProcessorAppend(a, opts)) } /** * A collection of arguments for invoking ElasticsearchIngestProcessorAppend. */ export interface ElasticsearchIngestProcessorAppendOutputArgs { /** * If `false`, the processor does not append values already present in the field. */ allowDuplicates?: pulumi.Input; /** * Description of the processor. */ description?: pulumi.Input; /** * The field to be appended to. */ field: pulumi.Input; /** * Conditionally execute the processor */ if?: pulumi.Input; /** * Ignore failures for the processor. */ ignoreFailure?: pulumi.Input; /** * The media type for encoding value. Applies only when value is a template snippet. Must be one of `application/json`, `text/plain`, or `application/x-www-form-urlencoded`. */ mediaType?: pulumi.Input; /** * Handle failures for the processor. */ onFailures?: pulumi.Input[]>; /** * Identifier for the processor. */ tag?: pulumi.Input; /** * The value to be appended. */ values: pulumi.Input[]>; }