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

elasticstack.getElasticsearchIngestProcessorSetSecurityUser

Explore with Pulumi AI

elasticstack logo
elasticstack 0.11.15 published on Wednesday, Apr 23, 2025 by elastic

    Sets user-related details (such as username, roles, email, full_name, metadata, api_key, realm and authentication_type) from the current authenticated user to the current document by pre-processing the ingest. The api_key property exists only if the user authenticates with an API key. It is an object containing the id, name and metadata (if it exists and is non-empty) fields of the API key. The realm property is also an object with two fields, name and type. When using API key authentication, the realm property refers to the realm from which the API key is created. The authentication_type property is a string that can take value from REALM, API_KEY, TOKEN and ANONYMOUS.

    See: https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-node-set-security-user-processor.html

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as elasticstack from "@pulumi/elasticstack";
    
    const user = elasticstack.getElasticsearchIngestProcessorSetSecurityUser({
        field: "user",
        properties: [
            "username",
            "realm",
        ],
    });
    const myIngestPipeline = new elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", {processors: [user.then(user => user.json)]});
    
    import pulumi
    import pulumi_elasticstack as elasticstack
    
    user = elasticstack.get_elasticsearch_ingest_processor_set_security_user(field="user",
        properties=[
            "username",
            "realm",
        ])
    my_ingest_pipeline = elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", processors=[user.json])
    
    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 {
    		user, err := elasticstack.GetElasticsearchIngestProcessorSetSecurityUser(ctx, &elasticstack.GetElasticsearchIngestProcessorSetSecurityUserArgs{
    			Field: "user",
    			Properties: []string{
    				"username",
    				"realm",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = elasticstack.NewElasticsearchIngestPipeline(ctx, "myIngestPipeline", &elasticstack.ElasticsearchIngestPipelineArgs{
    			Processors: pulumi.StringArray{
    				pulumi.String(user.Json),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Elasticstack = Pulumi.Elasticstack;
    
    return await Deployment.RunAsync(() => 
    {
        var user = Elasticstack.GetElasticsearchIngestProcessorSetSecurityUser.Invoke(new()
        {
            Field = "user",
            Properties = new[]
            {
                "username",
                "realm",
            },
        });
    
        var myIngestPipeline = new Elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", new()
        {
            Processors = new[]
            {
                user.Apply(getElasticsearchIngestProcessorSetSecurityUserResult => getElasticsearchIngestProcessorSetSecurityUserResult.Json),
            },
        });
    
    });
    
    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.GetElasticsearchIngestProcessorSetSecurityUserArgs;
    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 user = ElasticstackFunctions.getElasticsearchIngestProcessorSetSecurityUser(GetElasticsearchIngestProcessorSetSecurityUserArgs.builder()
                .field("user")
                .properties(            
                    "username",
                    "realm")
                .build());
    
            var myIngestPipeline = new ElasticsearchIngestPipeline("myIngestPipeline", ElasticsearchIngestPipelineArgs.builder()
                .processors(user.applyValue(getElasticsearchIngestProcessorSetSecurityUserResult -> getElasticsearchIngestProcessorSetSecurityUserResult.json()))
                .build());
    
        }
    }
    
    resources:
      myIngestPipeline:
        type: elasticstack:ElasticsearchIngestPipeline
        properties:
          processors:
            - ${user.json}
    variables:
      user:
        fn::invoke:
          function: elasticstack:getElasticsearchIngestProcessorSetSecurityUser
          arguments:
            field: user
            properties:
              - username
              - realm
    

    Using getElasticsearchIngestProcessorSetSecurityUser

    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 getElasticsearchIngestProcessorSetSecurityUser(args: GetElasticsearchIngestProcessorSetSecurityUserArgs, opts?: InvokeOptions): Promise<GetElasticsearchIngestProcessorSetSecurityUserResult>
    function getElasticsearchIngestProcessorSetSecurityUserOutput(args: GetElasticsearchIngestProcessorSetSecurityUserOutputArgs, opts?: InvokeOptions): Output<GetElasticsearchIngestProcessorSetSecurityUserResult>
    def get_elasticsearch_ingest_processor_set_security_user(description: Optional[str] = None,
                                                             field: Optional[str] = None,
                                                             if_: Optional[str] = None,
                                                             ignore_failure: Optional[bool] = None,
                                                             on_failures: Optional[Sequence[str]] = None,
                                                             properties: Optional[Sequence[str]] = None,
                                                             tag: Optional[str] = None,
                                                             opts: Optional[InvokeOptions] = None) -> GetElasticsearchIngestProcessorSetSecurityUserResult
    def get_elasticsearch_ingest_processor_set_security_user_output(description: Optional[pulumi.Input[str]] = None,
                                                             field: Optional[pulumi.Input[str]] = None,
                                                             if_: Optional[pulumi.Input[str]] = None,
                                                             ignore_failure: Optional[pulumi.Input[bool]] = None,
                                                             on_failures: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                                             properties: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                                             tag: Optional[pulumi.Input[str]] = None,
                                                             opts: Optional[InvokeOptions] = None) -> Output[GetElasticsearchIngestProcessorSetSecurityUserResult]
    func GetElasticsearchIngestProcessorSetSecurityUser(ctx *Context, args *GetElasticsearchIngestProcessorSetSecurityUserArgs, opts ...InvokeOption) (*GetElasticsearchIngestProcessorSetSecurityUserResult, error)
    func GetElasticsearchIngestProcessorSetSecurityUserOutput(ctx *Context, args *GetElasticsearchIngestProcessorSetSecurityUserOutputArgs, opts ...InvokeOption) GetElasticsearchIngestProcessorSetSecurityUserResultOutput

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

    public static class GetElasticsearchIngestProcessorSetSecurityUser 
    {
        public static Task<GetElasticsearchIngestProcessorSetSecurityUserResult> InvokeAsync(GetElasticsearchIngestProcessorSetSecurityUserArgs args, InvokeOptions? opts = null)
        public static Output<GetElasticsearchIngestProcessorSetSecurityUserResult> Invoke(GetElasticsearchIngestProcessorSetSecurityUserInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetElasticsearchIngestProcessorSetSecurityUserResult> getElasticsearchIngestProcessorSetSecurityUser(GetElasticsearchIngestProcessorSetSecurityUserArgs args, InvokeOptions options)
    public static Output<GetElasticsearchIngestProcessorSetSecurityUserResult> getElasticsearchIngestProcessorSetSecurityUser(GetElasticsearchIngestProcessorSetSecurityUserArgs args, InvokeOptions options)
    
    fn::invoke:
      function: elasticstack:index/getElasticsearchIngestProcessorSetSecurityUser:getElasticsearchIngestProcessorSetSecurityUser
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Field string
    The field to store the user information into.
    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.
    Properties List<string>
    Controls what user related properties are added to the field.
    Tag string
    Identifier for the processor.
    Field string
    The field to store the user information into.
    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.
    Properties []string
    Controls what user related properties are added to the field.
    Tag string
    Identifier for the processor.
    field String
    The field to store the user information into.
    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.
    properties List<String>
    Controls what user related properties are added to the field.
    tag String
    Identifier for the processor.
    field string
    The field to store the user information into.
    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.
    properties string[]
    Controls what user related properties are added to the field.
    tag string
    Identifier for the processor.
    field str
    The field to store the user information into.
    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.
    properties Sequence[str]
    Controls what user related properties are added to the field.
    tag str
    Identifier for the processor.
    field String
    The field to store the user information into.
    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.
    properties List<String>
    Controls what user related properties are added to the field.
    tag String
    Identifier for the processor.

    getElasticsearchIngestProcessorSetSecurityUser Result

    The following output properties are available:

    Field string
    The field to store the user information into.
    Id string
    Internal identifier of the resource.
    Json string
    JSON representation of this data source.
    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.
    Properties List<string>
    Controls what user related properties are added to the field.
    Tag string
    Identifier for the processor.
    Field string
    The field to store the user information into.
    Id string
    Internal identifier of the resource.
    Json string
    JSON representation of this data source.
    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.
    Properties []string
    Controls what user related properties are added to the field.
    Tag string
    Identifier for the processor.
    field String
    The field to store the user information into.
    id String
    Internal identifier of the resource.
    json String
    JSON representation of this data source.
    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.
    properties List<String>
    Controls what user related properties are added to the field.
    tag String
    Identifier for the processor.
    field string
    The field to store the user information into.
    id string
    Internal identifier of the resource.
    json string
    JSON representation of this data source.
    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.
    properties string[]
    Controls what user related properties are added to the field.
    tag string
    Identifier for the processor.
    field str
    The field to store the user information into.
    id str
    Internal identifier of the resource.
    json str
    JSON representation of this data source.
    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.
    properties Sequence[str]
    Controls what user related properties are added to the field.
    tag str
    Identifier for the processor.
    field String
    The field to store the user information into.
    id String
    Internal identifier of the resource.
    json String
    JSON representation of this data source.
    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.
    properties List<String>
    Controls what user related properties are added to the field.
    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.
    elasticstack logo
    elasticstack 0.11.15 published on Wednesday, Apr 23, 2025 by elastic