1. Packages
  2. Azure Classic
  3. API Docs
  4. elasticcloud
  5. getElasticsearch

We recommend using Azure Native.

Azure v6.23.0 published on Thursday, May 22, 2025 by Pulumi

azure.elasticcloud.getElasticsearch

Explore with Pulumi AI

We recommend using Azure Native.

Azure v6.23.0 published on Thursday, May 22, 2025 by Pulumi

Use this data source to access information about an existing Elasticsearch resource.

Example Usage

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

const example = azure.elasticcloud.getElasticsearch({
    name: "my-elastic-search",
    resourceGroupName: "example-resources",
});
export const elasticsearchEndpoint = example.then(example => example.elasticsearchServiceUrl);
export const kibanaEndpoint = example.then(example => example.kibanaServiceUrl);
Copy
import pulumi
import pulumi_azure as azure

example = azure.elasticcloud.get_elasticsearch(name="my-elastic-search",
    resource_group_name="example-resources")
pulumi.export("elasticsearchEndpoint", example.elasticsearch_service_url)
pulumi.export("kibanaEndpoint", example.kibana_service_url)
Copy
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/elasticcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := elasticcloud.LookupElasticsearch(ctx, &elasticcloud.LookupElasticsearchArgs{
			Name:              "my-elastic-search",
			ResourceGroupName: "example-resources",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("elasticsearchEndpoint", example.ElasticsearchServiceUrl)
		ctx.Export("kibanaEndpoint", example.KibanaServiceUrl)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = Azure.ElasticCloud.GetElasticsearch.Invoke(new()
    {
        Name = "my-elastic-search",
        ResourceGroupName = "example-resources",
    });

    return new Dictionary<string, object?>
    {
        ["elasticsearchEndpoint"] = example.Apply(getElasticsearchResult => getElasticsearchResult.ElasticsearchServiceUrl),
        ["kibanaEndpoint"] = example.Apply(getElasticsearchResult => getElasticsearchResult.KibanaServiceUrl),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.elasticcloud.ElasticcloudFunctions;
import com.pulumi.azure.elasticcloud.inputs.GetElasticsearchArgs;
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 = ElasticcloudFunctions.getElasticsearch(GetElasticsearchArgs.builder()
            .name("my-elastic-search")
            .resourceGroupName("example-resources")
            .build());

        ctx.export("elasticsearchEndpoint", example.elasticsearchServiceUrl());
        ctx.export("kibanaEndpoint", example.kibanaServiceUrl());
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: azure:elasticcloud:getElasticsearch
      arguments:
        name: my-elastic-search
        resourceGroupName: example-resources
outputs:
  elasticsearchEndpoint: ${example.elasticsearchServiceUrl}
  kibanaEndpoint: ${example.kibanaServiceUrl}
Copy

API Providers

This data source uses the following Azure API Providers:

  • Microsoft.Elastic: 2023-06-01

Using getElasticsearch

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 getElasticsearch(args: GetElasticsearchArgs, opts?: InvokeOptions): Promise<GetElasticsearchResult>
function getElasticsearchOutput(args: GetElasticsearchOutputArgs, opts?: InvokeOptions): Output<GetElasticsearchResult>
Copy
def get_elasticsearch(logs: Optional[Sequence[GetElasticsearchLog]] = None,
                      name: Optional[str] = None,
                      resource_group_name: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetElasticsearchResult
def get_elasticsearch_output(logs: Optional[pulumi.Input[Sequence[pulumi.Input[GetElasticsearchLogArgs]]]] = None,
                      name: Optional[pulumi.Input[str]] = None,
                      resource_group_name: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetElasticsearchResult]
Copy
func LookupElasticsearch(ctx *Context, args *LookupElasticsearchArgs, opts ...InvokeOption) (*LookupElasticsearchResult, error)
func LookupElasticsearchOutput(ctx *Context, args *LookupElasticsearchOutputArgs, opts ...InvokeOption) LookupElasticsearchResultOutput
Copy

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

public static class GetElasticsearch 
{
    public static Task<GetElasticsearchResult> InvokeAsync(GetElasticsearchArgs args, InvokeOptions? opts = null)
    public static Output<GetElasticsearchResult> Invoke(GetElasticsearchInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetElasticsearchResult> getElasticsearch(GetElasticsearchArgs args, InvokeOptions options)
public static Output<GetElasticsearchResult> getElasticsearch(GetElasticsearchArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure:elasticcloud/getElasticsearch:getElasticsearch
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
The name of the Elasticsearch resource.
ResourceGroupName This property is required. string
The name of the resource group in which the Elasticsearch exists.
Logs List<GetElasticsearchLog>
A logs block as defined below.
Name This property is required. string
The name of the Elasticsearch resource.
ResourceGroupName This property is required. string
The name of the resource group in which the Elasticsearch exists.
Logs []GetElasticsearchLog
A logs block as defined below.
name This property is required. String
The name of the Elasticsearch resource.
resourceGroupName This property is required. String
The name of the resource group in which the Elasticsearch exists.
logs List<GetElasticsearchLog>
A logs block as defined below.
name This property is required. string
The name of the Elasticsearch resource.
resourceGroupName This property is required. string
The name of the resource group in which the Elasticsearch exists.
logs GetElasticsearchLog[]
A logs block as defined below.
name This property is required. str
The name of the Elasticsearch resource.
resource_group_name This property is required. str
The name of the resource group in which the Elasticsearch exists.
logs Sequence[GetElasticsearchLog]
A logs block as defined below.
name This property is required. String
The name of the Elasticsearch resource.
resourceGroupName This property is required. String
The name of the resource group in which the Elasticsearch exists.
logs List<Property Map>
A logs block as defined below.

getElasticsearch Result

The following output properties are available:

ElasticCloudDeploymentId string
The ID of the Deployment within Elastic Cloud.
ElasticCloudEmailAddress string
The Email Address which is associated with this Elasticsearch account.
ElasticCloudSsoDefaultUrl string
The Default URL used for Single Sign On (SSO) to Elastic Cloud.
ElasticCloudUserId string
The ID of the User Account within Elastic Cloud.
ElasticsearchServiceUrl string
The URL to the Elasticsearch Service associated with this Elasticsearch.
Id string
The provider-assigned unique ID for this managed resource.
KibanaServiceUrl string
The URL to the Kibana Dashboard associated with this Elasticsearch.
KibanaSsoUri string
The URI used for SSO to the Kibana Dashboard associated with this Elasticsearch.
Location string
The Azure Region in which this Elasticsearch exists.
Logs List<GetElasticsearchLog>
A logs block as defined below.
MonitoringEnabled bool
Specifies if monitoring is enabled on this Elasticsearch or not.
Name string
The name (key) of the Tag which should be filtered.
ResourceGroupName string
SkuName string
The name of the SKU used for this Elasticsearch.
Tags Dictionary<string, string>
A mapping of tags assigned to the Elasticsearch.
ElasticCloudDeploymentId string
The ID of the Deployment within Elastic Cloud.
ElasticCloudEmailAddress string
The Email Address which is associated with this Elasticsearch account.
ElasticCloudSsoDefaultUrl string
The Default URL used for Single Sign On (SSO) to Elastic Cloud.
ElasticCloudUserId string
The ID of the User Account within Elastic Cloud.
ElasticsearchServiceUrl string
The URL to the Elasticsearch Service associated with this Elasticsearch.
Id string
The provider-assigned unique ID for this managed resource.
KibanaServiceUrl string
The URL to the Kibana Dashboard associated with this Elasticsearch.
KibanaSsoUri string
The URI used for SSO to the Kibana Dashboard associated with this Elasticsearch.
Location string
The Azure Region in which this Elasticsearch exists.
Logs []GetElasticsearchLog
A logs block as defined below.
MonitoringEnabled bool
Specifies if monitoring is enabled on this Elasticsearch or not.
Name string
The name (key) of the Tag which should be filtered.
ResourceGroupName string
SkuName string
The name of the SKU used for this Elasticsearch.
Tags map[string]string
A mapping of tags assigned to the Elasticsearch.
elasticCloudDeploymentId String
The ID of the Deployment within Elastic Cloud.
elasticCloudEmailAddress String
The Email Address which is associated with this Elasticsearch account.
elasticCloudSsoDefaultUrl String
The Default URL used for Single Sign On (SSO) to Elastic Cloud.
elasticCloudUserId String
The ID of the User Account within Elastic Cloud.
elasticsearchServiceUrl String
The URL to the Elasticsearch Service associated with this Elasticsearch.
id String
The provider-assigned unique ID for this managed resource.
kibanaServiceUrl String
The URL to the Kibana Dashboard associated with this Elasticsearch.
kibanaSsoUri String
The URI used for SSO to the Kibana Dashboard associated with this Elasticsearch.
location String
The Azure Region in which this Elasticsearch exists.
logs List<GetElasticsearchLog>
A logs block as defined below.
monitoringEnabled Boolean
Specifies if monitoring is enabled on this Elasticsearch or not.
name String
The name (key) of the Tag which should be filtered.
resourceGroupName String
skuName String
The name of the SKU used for this Elasticsearch.
tags Map<String,String>
A mapping of tags assigned to the Elasticsearch.
elasticCloudDeploymentId string
The ID of the Deployment within Elastic Cloud.
elasticCloudEmailAddress string
The Email Address which is associated with this Elasticsearch account.
elasticCloudSsoDefaultUrl string
The Default URL used for Single Sign On (SSO) to Elastic Cloud.
elasticCloudUserId string
The ID of the User Account within Elastic Cloud.
elasticsearchServiceUrl string
The URL to the Elasticsearch Service associated with this Elasticsearch.
id string
The provider-assigned unique ID for this managed resource.
kibanaServiceUrl string
The URL to the Kibana Dashboard associated with this Elasticsearch.
kibanaSsoUri string
The URI used for SSO to the Kibana Dashboard associated with this Elasticsearch.
location string
The Azure Region in which this Elasticsearch exists.
logs GetElasticsearchLog[]
A logs block as defined below.
monitoringEnabled boolean
Specifies if monitoring is enabled on this Elasticsearch or not.
name string
The name (key) of the Tag which should be filtered.
resourceGroupName string
skuName string
The name of the SKU used for this Elasticsearch.
tags {[key: string]: string}
A mapping of tags assigned to the Elasticsearch.
elastic_cloud_deployment_id str
The ID of the Deployment within Elastic Cloud.
elastic_cloud_email_address str
The Email Address which is associated with this Elasticsearch account.
elastic_cloud_sso_default_url str
The Default URL used for Single Sign On (SSO) to Elastic Cloud.
elastic_cloud_user_id str
The ID of the User Account within Elastic Cloud.
elasticsearch_service_url str
The URL to the Elasticsearch Service associated with this Elasticsearch.
id str
The provider-assigned unique ID for this managed resource.
kibana_service_url str
The URL to the Kibana Dashboard associated with this Elasticsearch.
kibana_sso_uri str
The URI used for SSO to the Kibana Dashboard associated with this Elasticsearch.
location str
The Azure Region in which this Elasticsearch exists.
logs Sequence[GetElasticsearchLog]
A logs block as defined below.
monitoring_enabled bool
Specifies if monitoring is enabled on this Elasticsearch or not.
name str
The name (key) of the Tag which should be filtered.
resource_group_name str
sku_name str
The name of the SKU used for this Elasticsearch.
tags Mapping[str, str]
A mapping of tags assigned to the Elasticsearch.
elasticCloudDeploymentId String
The ID of the Deployment within Elastic Cloud.
elasticCloudEmailAddress String
The Email Address which is associated with this Elasticsearch account.
elasticCloudSsoDefaultUrl String
The Default URL used for Single Sign On (SSO) to Elastic Cloud.
elasticCloudUserId String
The ID of the User Account within Elastic Cloud.
elasticsearchServiceUrl String
The URL to the Elasticsearch Service associated with this Elasticsearch.
id String
The provider-assigned unique ID for this managed resource.
kibanaServiceUrl String
The URL to the Kibana Dashboard associated with this Elasticsearch.
kibanaSsoUri String
The URI used for SSO to the Kibana Dashboard associated with this Elasticsearch.
location String
The Azure Region in which this Elasticsearch exists.
logs List<Property Map>
A logs block as defined below.
monitoringEnabled Boolean
Specifies if monitoring is enabled on this Elasticsearch or not.
name String
The name (key) of the Tag which should be filtered.
resourceGroupName String
skuName String
The name of the SKU used for this Elasticsearch.
tags Map<String>
A mapping of tags assigned to the Elasticsearch.

Supporting Types

GetElasticsearchLog

FilteringTags This property is required. List<GetElasticsearchLogFilteringTag>
A list of filtering_tag blocks as defined above.
SendActivityLogs This property is required. bool
Should the Azure Activity Logs should be sent to the Elasticsearch cluster?
SendAzureadLogs This property is required. bool
Should the AzureAD Logs should be sent to the Elasticsearch cluster?
SendSubscriptionLogs This property is required. bool
Should the Azure Subscription Logs should be sent to the Elasticsearch cluster?
FilteringTags This property is required. []GetElasticsearchLogFilteringTag
A list of filtering_tag blocks as defined above.
SendActivityLogs This property is required. bool
Should the Azure Activity Logs should be sent to the Elasticsearch cluster?
SendAzureadLogs This property is required. bool
Should the AzureAD Logs should be sent to the Elasticsearch cluster?
SendSubscriptionLogs This property is required. bool
Should the Azure Subscription Logs should be sent to the Elasticsearch cluster?
filteringTags This property is required. List<GetElasticsearchLogFilteringTag>
A list of filtering_tag blocks as defined above.
sendActivityLogs This property is required. Boolean
Should the Azure Activity Logs should be sent to the Elasticsearch cluster?
sendAzureadLogs This property is required. Boolean
Should the AzureAD Logs should be sent to the Elasticsearch cluster?
sendSubscriptionLogs This property is required. Boolean
Should the Azure Subscription Logs should be sent to the Elasticsearch cluster?
filteringTags This property is required. GetElasticsearchLogFilteringTag[]
A list of filtering_tag blocks as defined above.
sendActivityLogs This property is required. boolean
Should the Azure Activity Logs should be sent to the Elasticsearch cluster?
sendAzureadLogs This property is required. boolean
Should the AzureAD Logs should be sent to the Elasticsearch cluster?
sendSubscriptionLogs This property is required. boolean
Should the Azure Subscription Logs should be sent to the Elasticsearch cluster?
filtering_tags This property is required. Sequence[GetElasticsearchLogFilteringTag]
A list of filtering_tag blocks as defined above.
send_activity_logs This property is required. bool
Should the Azure Activity Logs should be sent to the Elasticsearch cluster?
send_azuread_logs This property is required. bool
Should the AzureAD Logs should be sent to the Elasticsearch cluster?
send_subscription_logs This property is required. bool
Should the Azure Subscription Logs should be sent to the Elasticsearch cluster?
filteringTags This property is required. List<Property Map>
A list of filtering_tag blocks as defined above.
sendActivityLogs This property is required. Boolean
Should the Azure Activity Logs should be sent to the Elasticsearch cluster?
sendAzureadLogs This property is required. Boolean
Should the AzureAD Logs should be sent to the Elasticsearch cluster?
sendSubscriptionLogs This property is required. Boolean
Should the Azure Subscription Logs should be sent to the Elasticsearch cluster?

GetElasticsearchLogFilteringTag

Action This property is required. string
The type of action which is taken when the Tag matches the name and value.
Name This property is required. string
The name of the Elasticsearch resource.
Value This property is required. string
The value of the Tag which should be filtered.
Action This property is required. string
The type of action which is taken when the Tag matches the name and value.
Name This property is required. string
The name of the Elasticsearch resource.
Value This property is required. string
The value of the Tag which should be filtered.
action This property is required. String
The type of action which is taken when the Tag matches the name and value.
name This property is required. String
The name of the Elasticsearch resource.
value This property is required. String
The value of the Tag which should be filtered.
action This property is required. string
The type of action which is taken when the Tag matches the name and value.
name This property is required. string
The name of the Elasticsearch resource.
value This property is required. string
The value of the Tag which should be filtered.
action This property is required. str
The type of action which is taken when the Tag matches the name and value.
name This property is required. str
The name of the Elasticsearch resource.
value This property is required. str
The value of the Tag which should be filtered.
action This property is required. String
The type of action which is taken when the Tag matches the name and value.
name This property is required. String
The name of the Elasticsearch resource.
value This property is required. String
The value of the Tag which should be filtered.

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.

We recommend using Azure Native.

Azure v6.23.0 published on Thursday, May 22, 2025 by Pulumi