1. Packages
  2. Elasticstack Provider
  3. API Docs
  4. getElasticsearchIngestProcessorFail
elasticstack 0.11.15 published on Wednesday, Apr 23, 2025 by elastic

elasticstack.getElasticsearchIngestProcessorFail

Explore with Pulumi AI

Raises an exception. This is useful for when you expect a pipeline to fail and want to relay a specific message to the requester.

See: https://www.elastic.co/guide/en/elasticsearch/reference/current/fail-processor.html

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as elasticstack from "@pulumi/elasticstack";

const fail = elasticstack.getElasticsearchIngestProcessorFail({
    "if": "ctx.tags.contains('production') != true",
    message: "The production tag is not present, found tags: {{{tags}}}",
});
const myIngestPipeline = new elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", {processors: [fail.then(fail => fail.json)]});
Copy
import pulumi
import pulumi_elasticstack as elasticstack

fail = elasticstack.get_elasticsearch_ingest_processor_fail(if_="ctx.tags.contains('production') != true",
    message="The production tag is not present, found tags: {{{tags}}}")
my_ingest_pipeline = elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", processors=[fail.json])
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/elasticstack/elasticstack"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		fail, err := elasticstack.GetElasticsearchIngestProcessorFail(ctx, &elasticstack.GetElasticsearchIngestProcessorFailArgs{
			If:      pulumi.StringRef("ctx.tags.contains('production') != true"),
			Message: "The production tag is not present, found tags: {{{tags}}}",
		}, nil)
		if err != nil {
			return err
		}
		_, err = elasticstack.NewElasticsearchIngestPipeline(ctx, "myIngestPipeline", &elasticstack.ElasticsearchIngestPipelineArgs{
			Processors: pulumi.StringArray{
				pulumi.String(fail.Json),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Elasticstack = Pulumi.Elasticstack;

return await Deployment.RunAsync(() => 
{
    var fail = Elasticstack.GetElasticsearchIngestProcessorFail.Invoke(new()
    {
        If = "ctx.tags.contains('production') != true",
        Message = "The production tag is not present, found tags: {{{tags}}}",
    });

    var myIngestPipeline = new Elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", new()
    {
        Processors = new[]
        {
            fail.Apply(getElasticsearchIngestProcessorFailResult => getElasticsearchIngestProcessorFailResult.Json),
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.elasticstack.ElasticstackFunctions;
import com.pulumi.elasticstack.inputs.GetElasticsearchIngestProcessorFailArgs;
import com.pulumi.elasticstack.ElasticsearchIngestPipeline;
import com.pulumi.elasticstack.ElasticsearchIngestPipelineArgs;
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 fail = ElasticstackFunctions.getElasticsearchIngestProcessorFail(GetElasticsearchIngestProcessorFailArgs.builder()
            .if_("ctx.tags.contains('production') != true")
            .message("The production tag is not present, found tags: {{{tags}}}")
            .build());

        var myIngestPipeline = new ElasticsearchIngestPipeline("myIngestPipeline", ElasticsearchIngestPipelineArgs.builder()
            .processors(fail.applyValue(getElasticsearchIngestProcessorFailResult -> getElasticsearchIngestProcessorFailResult.json()))
            .build());

    }
}
Copy
resources:
  myIngestPipeline:
    type: elasticstack:ElasticsearchIngestPipeline
    properties:
      processors:
        - ${fail.json}
variables:
  fail:
    fn::invoke:
      function: elasticstack:getElasticsearchIngestProcessorFail
      arguments:
        if: ctx.tags.contains('production') != true
        message: 'The production tag is not present, found tags: {{{tags}}}'
Copy

Using getElasticsearchIngestProcessorFail

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 getElasticsearchIngestProcessorFail(args: GetElasticsearchIngestProcessorFailArgs, opts?: InvokeOptions): Promise<GetElasticsearchIngestProcessorFailResult>
function getElasticsearchIngestProcessorFailOutput(args: GetElasticsearchIngestProcessorFailOutputArgs, opts?: InvokeOptions): Output<GetElasticsearchIngestProcessorFailResult>
Copy
def get_elasticsearch_ingest_processor_fail(description: Optional[str] = None,
                                            if_: Optional[str] = None,
                                            ignore_failure: Optional[bool] = None,
                                            message: Optional[str] = None,
                                            on_failures: Optional[Sequence[str]] = None,
                                            tag: Optional[str] = None,
                                            opts: Optional[InvokeOptions] = None) -> GetElasticsearchIngestProcessorFailResult
def get_elasticsearch_ingest_processor_fail_output(description: Optional[pulumi.Input[str]] = None,
                                            if_: Optional[pulumi.Input[str]] = None,
                                            ignore_failure: Optional[pulumi.Input[bool]] = None,
                                            message: Optional[pulumi.Input[str]] = None,
                                            on_failures: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                            tag: Optional[pulumi.Input[str]] = None,
                                            opts: Optional[InvokeOptions] = None) -> Output[GetElasticsearchIngestProcessorFailResult]
Copy
func GetElasticsearchIngestProcessorFail(ctx *Context, args *GetElasticsearchIngestProcessorFailArgs, opts ...InvokeOption) (*GetElasticsearchIngestProcessorFailResult, error)
func GetElasticsearchIngestProcessorFailOutput(ctx *Context, args *GetElasticsearchIngestProcessorFailOutputArgs, opts ...InvokeOption) GetElasticsearchIngestProcessorFailResultOutput
Copy

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

public static class GetElasticsearchIngestProcessorFail 
{
    public static Task<GetElasticsearchIngestProcessorFailResult> InvokeAsync(GetElasticsearchIngestProcessorFailArgs args, InvokeOptions? opts = null)
    public static Output<GetElasticsearchIngestProcessorFailResult> Invoke(GetElasticsearchIngestProcessorFailInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetElasticsearchIngestProcessorFailResult> getElasticsearchIngestProcessorFail(GetElasticsearchIngestProcessorFailArgs args, InvokeOptions options)
public static Output<GetElasticsearchIngestProcessorFailResult> getElasticsearchIngestProcessorFail(GetElasticsearchIngestProcessorFailArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: elasticstack:index/getElasticsearchIngestProcessorFail:getElasticsearchIngestProcessorFail
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Message This property is required. string
The error message thrown by the processor.
Description string
Description of the processor.
If string
Conditionally execute the processor
IgnoreFailure bool
Ignore failures for the processor.
OnFailures List<string>
Handle failures for the processor.
Tag string
Identifier for the processor.
Message This property is required. string
The error message thrown by the processor.
Description string
Description of the processor.
If string
Conditionally execute the processor
IgnoreFailure bool
Ignore failures for the processor.
OnFailures []string
Handle failures for the processor.
Tag string
Identifier for the processor.
message This property is required. String
The error message thrown by the processor.
description String
Description of the processor.
if_ String
Conditionally execute the processor
ignoreFailure Boolean
Ignore failures for the processor.
onFailures List<String>
Handle failures for the processor.
tag String
Identifier for the processor.
message This property is required. string
The error message thrown by the processor.
description string
Description of the processor.
if string
Conditionally execute the processor
ignoreFailure boolean
Ignore failures for the processor.
onFailures string[]
Handle failures for the processor.
tag string
Identifier for the processor.
message This property is required. str
The error message thrown by the processor.
description str
Description of the processor.
if_ str
Conditionally execute the processor
ignore_failure bool
Ignore failures for the processor.
on_failures Sequence[str]
Handle failures for the processor.
tag str
Identifier for the processor.
message This property is required. String
The error message thrown by the processor.
description String
Description of the processor.
if String
Conditionally execute the processor
ignoreFailure Boolean
Ignore failures for the processor.
onFailures List<String>
Handle failures for the processor.
tag String
Identifier for the processor.

getElasticsearchIngestProcessorFail Result

The following output properties are available:

Id string
Internal identifier of the resource
Json string
JSON representation of this data source.
Message string
The error message thrown by the processor.
Description string
Description of the processor.
If string
Conditionally execute the processor
IgnoreFailure bool
Ignore failures for the processor.
OnFailures List<string>
Handle failures for the processor.
Tag string
Identifier for the processor.
Id string
Internal identifier of the resource
Json string
JSON representation of this data source.
Message string
The error message thrown by the processor.
Description string
Description of the processor.
If string
Conditionally execute the processor
IgnoreFailure bool
Ignore failures for the processor.
OnFailures []string
Handle failures for the processor.
Tag string
Identifier for the processor.
id String
Internal identifier of the resource
json String
JSON representation of this data source.
message String
The error message thrown by the processor.
description String
Description of the processor.
if_ String
Conditionally execute the processor
ignoreFailure Boolean
Ignore failures for the processor.
onFailures List<String>
Handle failures for the processor.
tag String
Identifier for the processor.
id string
Internal identifier of the resource
json string
JSON representation of this data source.
message string
The error message thrown by the processor.
description string
Description of the processor.
if string
Conditionally execute the processor
ignoreFailure boolean
Ignore failures for the processor.
onFailures string[]
Handle failures for the processor.
tag string
Identifier for the processor.
id str
Internal identifier of the resource
json str
JSON representation of this data source.
message str
The error message thrown by the processor.
description str
Description of the processor.
if_ str
Conditionally execute the processor
ignore_failure bool
Ignore failures for the processor.
on_failures Sequence[str]
Handle failures for the processor.
tag str
Identifier for the processor.
id String
Internal identifier of the resource
json String
JSON representation of this data source.
message String
The error message thrown by the processor.
description String
Description of the processor.
if String
Conditionally execute the processor
ignoreFailure Boolean
Ignore failures for the processor.
onFailures List<String>
Handle failures for the processor.
tag String
Identifier for the processor.

Package Details

Repository
elasticstack elastic/terraform-provider-elasticstack
License
Notes
This Pulumi package is based on the elasticstack Terraform Provider.