1. Packages
  2. Packages
  3. Elasticstack Provider
  4. API Docs
  5. getElasticsearchMlTrainedModel
Viewing docs for elasticstack 0.16.2
published on Saturday, Jul 4, 2026 by elastic
Viewing docs for elasticstack 0.16.2
published on Saturday, Jul 4, 2026 by elastic

    Retrieves an Elasticsearch ML trained model. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trained-models.html

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as elasticstack from "@pulumi/elasticstack";
    
    const example = elasticstack.getElasticsearchMlTrainedModel({
        modelId: "lang_ident_model_current",
    });
    
    import pulumi
    import pulumi_elasticstack as elasticstack
    
    example = elasticstack.get_elasticsearch_ml_trained_model(model_id="lang_ident_model_current")
    
    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 {
    		_, err := elasticstack.GetElasticsearchMlTrainedModel(ctx, &elasticstack.GetElasticsearchMlTrainedModelArgs{
    			ModelId: "lang_ident_model_current",
    		}, nil)
    		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 example = Elasticstack.GetElasticsearchMlTrainedModel.Invoke(new()
        {
            ModelId = "lang_ident_model_current",
        });
    
    });
    
    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.GetElasticsearchMlTrainedModelArgs;
    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 example = ElasticstackFunctions.getElasticsearchMlTrainedModel(GetElasticsearchMlTrainedModelArgs.builder()
                .modelId("lang_ident_model_current")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: elasticstack:getElasticsearchMlTrainedModel
          arguments:
            modelId: lang_ident_model_current
    
    Example coming soon!
    

    Using getElasticsearchMlTrainedModel

    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 getElasticsearchMlTrainedModel(args: GetElasticsearchMlTrainedModelArgs, opts?: InvokeOptions): Promise<GetElasticsearchMlTrainedModelResult>
    function getElasticsearchMlTrainedModelOutput(args: GetElasticsearchMlTrainedModelOutputArgs, opts?: InvokeOptions): Output<GetElasticsearchMlTrainedModelResult>
    def get_elasticsearch_ml_trained_model(elasticsearch_connections: Optional[Sequence[GetElasticsearchMlTrainedModelElasticsearchConnection]] = None,
                                           model_id: Optional[str] = None,
                                           opts: Optional[InvokeOptions] = None) -> GetElasticsearchMlTrainedModelResult
    def get_elasticsearch_ml_trained_model_output(elasticsearch_connections: pulumi.Input[Optional[Sequence[pulumi.Input[GetElasticsearchMlTrainedModelElasticsearchConnectionArgs]]]] = None,
                                           model_id: pulumi.Input[Optional[str]] = None,
                                           opts: Optional[InvokeOptions] = None) -> Output[GetElasticsearchMlTrainedModelResult]
    func GetElasticsearchMlTrainedModel(ctx *Context, args *GetElasticsearchMlTrainedModelArgs, opts ...InvokeOption) (*GetElasticsearchMlTrainedModelResult, error)
    func GetElasticsearchMlTrainedModelOutput(ctx *Context, args *GetElasticsearchMlTrainedModelOutputArgs, opts ...InvokeOption) GetElasticsearchMlTrainedModelResultOutput

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

    public static class GetElasticsearchMlTrainedModel 
    {
        public static Task<GetElasticsearchMlTrainedModelResult> InvokeAsync(GetElasticsearchMlTrainedModelArgs args, InvokeOptions? opts = null)
        public static Output<GetElasticsearchMlTrainedModelResult> Invoke(GetElasticsearchMlTrainedModelInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetElasticsearchMlTrainedModelResult> getElasticsearchMlTrainedModel(GetElasticsearchMlTrainedModelArgs args, InvokeOptions options)
    public static Output<GetElasticsearchMlTrainedModelResult> getElasticsearchMlTrainedModel(GetElasticsearchMlTrainedModelArgs args, InvokeOptions options)
    
    fn::invoke:
      function: elasticstack:index/getElasticsearchMlTrainedModel:getElasticsearchMlTrainedModel
      arguments:
        # arguments dictionary
    data "elasticstack_getelasticsearchmltrainedmodel" "name" {
        # arguments
    }

    The following arguments are supported:

    ModelId string
    The identifier for the trained model.
    ElasticsearchConnections List<GetElasticsearchMlTrainedModelElasticsearchConnection>
    Elasticsearch connection configuration block.
    ModelId string
    The identifier for the trained model.
    ElasticsearchConnections []GetElasticsearchMlTrainedModelElasticsearchConnection
    Elasticsearch connection configuration block.
    model_id string
    The identifier for the trained model.
    elasticsearch_connections list(object)
    Elasticsearch connection configuration block.
    modelId String
    The identifier for the trained model.
    elasticsearchConnections List<GetElasticsearchMlTrainedModelElasticsearchConnection>
    Elasticsearch connection configuration block.
    modelId string
    The identifier for the trained model.
    elasticsearchConnections GetElasticsearchMlTrainedModelElasticsearchConnection[]
    Elasticsearch connection configuration block.
    model_id str
    The identifier for the trained model.
    elasticsearch_connections Sequence[GetElasticsearchMlTrainedModelElasticsearchConnection]
    Elasticsearch connection configuration block.
    modelId String
    The identifier for the trained model.
    elasticsearchConnections List<Property Map>
    Elasticsearch connection configuration block.

    getElasticsearchMlTrainedModel Result

    The following output properties are available:

    CreateTime string
    The time when the trained model was created.
    CreatedBy string
    Information on the creator of the trained model.
    DefaultFieldMap Dictionary<string, string>
    Any field map described in the inference configuration takes precedence.
    Description string
    The free-text description of the trained model.
    FullyDefined bool
    True if the full model definition is present.
    Id string
    Internal identifier of the resource
    InferenceConfigJson string
    JSON string of the default inference configuration.
    InputJson string
    JSON string of the model input field names.
    LicenseLevel string
    The license level of the trained model.
    MetadataJson string
    JSON string of the model metadata.
    ModelId string
    The identifier for the trained model.
    ModelSizeBytes double
    The estimated memory usage in bytes to keep the trained model in memory.
    ModelType string
    The model type.
    PlatformArchitecture string
    The platform identifier (e.g. linux-x86_64).
    Tags List<string>
    A set of tags for the trained model.
    Version string
    The Elasticsearch version number in which the trained model was created.
    ElasticsearchConnections List<GetElasticsearchMlTrainedModelElasticsearchConnection>
    Elasticsearch connection configuration block.
    CreateTime string
    The time when the trained model was created.
    CreatedBy string
    Information on the creator of the trained model.
    DefaultFieldMap map[string]string
    Any field map described in the inference configuration takes precedence.
    Description string
    The free-text description of the trained model.
    FullyDefined bool
    True if the full model definition is present.
    Id string
    Internal identifier of the resource
    InferenceConfigJson string
    JSON string of the default inference configuration.
    InputJson string
    JSON string of the model input field names.
    LicenseLevel string
    The license level of the trained model.
    MetadataJson string
    JSON string of the model metadata.
    ModelId string
    The identifier for the trained model.
    ModelSizeBytes float64
    The estimated memory usage in bytes to keep the trained model in memory.
    ModelType string
    The model type.
    PlatformArchitecture string
    The platform identifier (e.g. linux-x86_64).
    Tags []string
    A set of tags for the trained model.
    Version string
    The Elasticsearch version number in which the trained model was created.
    ElasticsearchConnections []GetElasticsearchMlTrainedModelElasticsearchConnection
    Elasticsearch connection configuration block.
    create_time string
    The time when the trained model was created.
    created_by string
    Information on the creator of the trained model.
    default_field_map map(string)
    Any field map described in the inference configuration takes precedence.
    description string
    The free-text description of the trained model.
    fully_defined bool
    True if the full model definition is present.
    id string
    Internal identifier of the resource
    inference_config_json string
    JSON string of the default inference configuration.
    input_json string
    JSON string of the model input field names.
    license_level string
    The license level of the trained model.
    metadata_json string
    JSON string of the model metadata.
    model_id string
    The identifier for the trained model.
    model_size_bytes number
    The estimated memory usage in bytes to keep the trained model in memory.
    model_type string
    The model type.
    platform_architecture string
    The platform identifier (e.g. linux-x86_64).
    tags list(string)
    A set of tags for the trained model.
    version string
    The Elasticsearch version number in which the trained model was created.
    elasticsearch_connections list(object)
    Elasticsearch connection configuration block.
    createTime String
    The time when the trained model was created.
    createdBy String
    Information on the creator of the trained model.
    defaultFieldMap Map<String,String>
    Any field map described in the inference configuration takes precedence.
    description String
    The free-text description of the trained model.
    fullyDefined Boolean
    True if the full model definition is present.
    id String
    Internal identifier of the resource
    inferenceConfigJson String
    JSON string of the default inference configuration.
    inputJson String
    JSON string of the model input field names.
    licenseLevel String
    The license level of the trained model.
    metadataJson String
    JSON string of the model metadata.
    modelId String
    The identifier for the trained model.
    modelSizeBytes Double
    The estimated memory usage in bytes to keep the trained model in memory.
    modelType String
    The model type.
    platformArchitecture String
    The platform identifier (e.g. linux-x86_64).
    tags List<String>
    A set of tags for the trained model.
    version String
    The Elasticsearch version number in which the trained model was created.
    elasticsearchConnections List<GetElasticsearchMlTrainedModelElasticsearchConnection>
    Elasticsearch connection configuration block.
    createTime string
    The time when the trained model was created.
    createdBy string
    Information on the creator of the trained model.
    defaultFieldMap {[key: string]: string}
    Any field map described in the inference configuration takes precedence.
    description string
    The free-text description of the trained model.
    fullyDefined boolean
    True if the full model definition is present.
    id string
    Internal identifier of the resource
    inferenceConfigJson string
    JSON string of the default inference configuration.
    inputJson string
    JSON string of the model input field names.
    licenseLevel string
    The license level of the trained model.
    metadataJson string
    JSON string of the model metadata.
    modelId string
    The identifier for the trained model.
    modelSizeBytes number
    The estimated memory usage in bytes to keep the trained model in memory.
    modelType string
    The model type.
    platformArchitecture string
    The platform identifier (e.g. linux-x86_64).
    tags string[]
    A set of tags for the trained model.
    version string
    The Elasticsearch version number in which the trained model was created.
    elasticsearchConnections GetElasticsearchMlTrainedModelElasticsearchConnection[]
    Elasticsearch connection configuration block.
    create_time str
    The time when the trained model was created.
    created_by str
    Information on the creator of the trained model.
    default_field_map Mapping[str, str]
    Any field map described in the inference configuration takes precedence.
    description str
    The free-text description of the trained model.
    fully_defined bool
    True if the full model definition is present.
    id str
    Internal identifier of the resource
    inference_config_json str
    JSON string of the default inference configuration.
    input_json str
    JSON string of the model input field names.
    license_level str
    The license level of the trained model.
    metadata_json str
    JSON string of the model metadata.
    model_id str
    The identifier for the trained model.
    model_size_bytes float
    The estimated memory usage in bytes to keep the trained model in memory.
    model_type str
    The model type.
    platform_architecture str
    The platform identifier (e.g. linux-x86_64).
    tags Sequence[str]
    A set of tags for the trained model.
    version str
    The Elasticsearch version number in which the trained model was created.
    elasticsearch_connections Sequence[GetElasticsearchMlTrainedModelElasticsearchConnection]
    Elasticsearch connection configuration block.
    createTime String
    The time when the trained model was created.
    createdBy String
    Information on the creator of the trained model.
    defaultFieldMap Map<String>
    Any field map described in the inference configuration takes precedence.
    description String
    The free-text description of the trained model.
    fullyDefined Boolean
    True if the full model definition is present.
    id String
    Internal identifier of the resource
    inferenceConfigJson String
    JSON string of the default inference configuration.
    inputJson String
    JSON string of the model input field names.
    licenseLevel String
    The license level of the trained model.
    metadataJson String
    JSON string of the model metadata.
    modelId String
    The identifier for the trained model.
    modelSizeBytes Number
    The estimated memory usage in bytes to keep the trained model in memory.
    modelType String
    The model type.
    platformArchitecture String
    The platform identifier (e.g. linux-x86_64).
    tags List<String>
    A set of tags for the trained model.
    version String
    The Elasticsearch version number in which the trained model was created.
    elasticsearchConnections List<Property Map>
    Elasticsearch connection configuration block.

    Supporting Types

    GetElasticsearchMlTrainedModelElasticsearchConnection

    ApiKey string
    API Key to use for authentication to Elasticsearch
    BearerToken string
    Bearer Token to use for authentication to Elasticsearch
    CaData string
    PEM-encoded custom Certificate Authority certificate
    CaFile string
    Path to a custom Certificate Authority certificate
    CaFingerprint string
    SHA-256 hex fingerprint (64 hexadecimal characters, no colons or separators) of the server TLS certificate used to pin the connection instead of a full CA chain
    CertData string
    PEM encoded certificate for client auth
    CertFile string
    Path to a file containing the PEM encoded certificate for client auth
    Endpoints List<string>
    EsClientAuthentication string
    ES Client Authentication field to be used with the JWT token
    Headers Dictionary<string, string>
    A list of headers to be sent with each request to Elasticsearch.
    Insecure bool
    Disable TLS certificate validation
    KeyData string
    PEM encoded private key for client auth
    KeyFile string
    Path to a file containing the PEM encoded private key for client auth
    Password string
    Password to use for API authentication to Elasticsearch.
    Username string
    Username to use for API authentication to Elasticsearch.
    ApiKey string
    API Key to use for authentication to Elasticsearch
    BearerToken string
    Bearer Token to use for authentication to Elasticsearch
    CaData string
    PEM-encoded custom Certificate Authority certificate
    CaFile string
    Path to a custom Certificate Authority certificate
    CaFingerprint string
    SHA-256 hex fingerprint (64 hexadecimal characters, no colons or separators) of the server TLS certificate used to pin the connection instead of a full CA chain
    CertData string
    PEM encoded certificate for client auth
    CertFile string
    Path to a file containing the PEM encoded certificate for client auth
    Endpoints []string
    EsClientAuthentication string
    ES Client Authentication field to be used with the JWT token
    Headers map[string]string
    A list of headers to be sent with each request to Elasticsearch.
    Insecure bool
    Disable TLS certificate validation
    KeyData string
    PEM encoded private key for client auth
    KeyFile string
    Path to a file containing the PEM encoded private key for client auth
    Password string
    Password to use for API authentication to Elasticsearch.
    Username string
    Username to use for API authentication to Elasticsearch.
    api_key string
    API Key to use for authentication to Elasticsearch
    bearer_token string
    Bearer Token to use for authentication to Elasticsearch
    ca_data string
    PEM-encoded custom Certificate Authority certificate
    ca_file string
    Path to a custom Certificate Authority certificate
    ca_fingerprint string
    SHA-256 hex fingerprint (64 hexadecimal characters, no colons or separators) of the server TLS certificate used to pin the connection instead of a full CA chain
    cert_data string
    PEM encoded certificate for client auth
    cert_file string
    Path to a file containing the PEM encoded certificate for client auth
    endpoints list(string)
    es_client_authentication string
    ES Client Authentication field to be used with the JWT token
    headers map(string)
    A list of headers to be sent with each request to Elasticsearch.
    insecure bool
    Disable TLS certificate validation
    key_data string
    PEM encoded private key for client auth
    key_file string
    Path to a file containing the PEM encoded private key for client auth
    password string
    Password to use for API authentication to Elasticsearch.
    username string
    Username to use for API authentication to Elasticsearch.
    apiKey String
    API Key to use for authentication to Elasticsearch
    bearerToken String
    Bearer Token to use for authentication to Elasticsearch
    caData String
    PEM-encoded custom Certificate Authority certificate
    caFile String
    Path to a custom Certificate Authority certificate
    caFingerprint String
    SHA-256 hex fingerprint (64 hexadecimal characters, no colons or separators) of the server TLS certificate used to pin the connection instead of a full CA chain
    certData String
    PEM encoded certificate for client auth
    certFile String
    Path to a file containing the PEM encoded certificate for client auth
    endpoints List<String>
    esClientAuthentication String
    ES Client Authentication field to be used with the JWT token
    headers Map<String,String>
    A list of headers to be sent with each request to Elasticsearch.
    insecure Boolean
    Disable TLS certificate validation
    keyData String
    PEM encoded private key for client auth
    keyFile String
    Path to a file containing the PEM encoded private key for client auth
    password String
    Password to use for API authentication to Elasticsearch.
    username String
    Username to use for API authentication to Elasticsearch.
    apiKey string
    API Key to use for authentication to Elasticsearch
    bearerToken string
    Bearer Token to use for authentication to Elasticsearch
    caData string
    PEM-encoded custom Certificate Authority certificate
    caFile string
    Path to a custom Certificate Authority certificate
    caFingerprint string
    SHA-256 hex fingerprint (64 hexadecimal characters, no colons or separators) of the server TLS certificate used to pin the connection instead of a full CA chain
    certData string
    PEM encoded certificate for client auth
    certFile string
    Path to a file containing the PEM encoded certificate for client auth
    endpoints string[]
    esClientAuthentication string
    ES Client Authentication field to be used with the JWT token
    headers {[key: string]: string}
    A list of headers to be sent with each request to Elasticsearch.
    insecure boolean
    Disable TLS certificate validation
    keyData string
    PEM encoded private key for client auth
    keyFile string
    Path to a file containing the PEM encoded private key for client auth
    password string
    Password to use for API authentication to Elasticsearch.
    username string
    Username to use for API authentication to Elasticsearch.
    api_key str
    API Key to use for authentication to Elasticsearch
    bearer_token str
    Bearer Token to use for authentication to Elasticsearch
    ca_data str
    PEM-encoded custom Certificate Authority certificate
    ca_file str
    Path to a custom Certificate Authority certificate
    ca_fingerprint str
    SHA-256 hex fingerprint (64 hexadecimal characters, no colons or separators) of the server TLS certificate used to pin the connection instead of a full CA chain
    cert_data str
    PEM encoded certificate for client auth
    cert_file str
    Path to a file containing the PEM encoded certificate for client auth
    endpoints Sequence[str]
    es_client_authentication str
    ES Client Authentication field to be used with the JWT token
    headers Mapping[str, str]
    A list of headers to be sent with each request to Elasticsearch.
    insecure bool
    Disable TLS certificate validation
    key_data str
    PEM encoded private key for client auth
    key_file str
    Path to a file containing the PEM encoded private key for client auth
    password str
    Password to use for API authentication to Elasticsearch.
    username str
    Username to use for API authentication to Elasticsearch.
    apiKey String
    API Key to use for authentication to Elasticsearch
    bearerToken String
    Bearer Token to use for authentication to Elasticsearch
    caData String
    PEM-encoded custom Certificate Authority certificate
    caFile String
    Path to a custom Certificate Authority certificate
    caFingerprint String
    SHA-256 hex fingerprint (64 hexadecimal characters, no colons or separators) of the server TLS certificate used to pin the connection instead of a full CA chain
    certData String
    PEM encoded certificate for client auth
    certFile String
    Path to a file containing the PEM encoded certificate for client auth
    endpoints List<String>
    esClientAuthentication String
    ES Client Authentication field to be used with the JWT token
    headers Map<String>
    A list of headers to be sent with each request to Elasticsearch.
    insecure Boolean
    Disable TLS certificate validation
    keyData String
    PEM encoded private key for client auth
    keyFile String
    Path to a file containing the PEM encoded private key for client auth
    password String
    Password to use for API authentication to Elasticsearch.
    username String
    Username to use for API authentication to Elasticsearch.

    Package Details

    Repository
    elasticstack elastic/terraform-provider-elasticstack
    License
    Notes
    This Pulumi package is based on the elasticstack Terraform Provider.
    Viewing docs for elasticstack 0.16.2
    published on Saturday, Jul 4, 2026 by elastic

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial