1. Packages
  2. Opensearch Provider
  3. API Docs
  4. getHost
opensearch 2.3.1 published on Monday, Apr 14, 2025 by opensearch-project

opensearch.getHost

Explore with Pulumi AI

opensearch logo
opensearch 2.3.1 published on Monday, Apr 14, 2025 by opensearch-project

    opensearch.getHost can be used to retrieve the host URL for the provider’s current cluster.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as opensearch from "@pulumi/opensearch";
    
    const test = opensearch.getHost({
        active: true,
    });
    
    import pulumi
    import pulumi_opensearch as opensearch
    
    test = opensearch.get_host(active=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/opensearch/v2/opensearch"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := opensearch.GetHost(ctx, &opensearch.GetHostArgs{
    			Active: true,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Opensearch = Pulumi.Opensearch;
    
    return await Deployment.RunAsync(() => 
    {
        var test = Opensearch.GetHost.Invoke(new()
        {
            Active = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.opensearch.OpensearchFunctions;
    import com.pulumi.opensearch.inputs.GetHostArgs;
    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 test = OpensearchFunctions.getHost(GetHostArgs.builder()
                .active(true)
                .build());
    
        }
    }
    
    variables:
      test:
        fn::invoke:
          function: opensearch:getHost
          arguments:
            active: true
    

    Using getHost

    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 getHost(args: GetHostArgs, opts?: InvokeOptions): Promise<GetHostResult>
    function getHostOutput(args: GetHostOutputArgs, opts?: InvokeOptions): Output<GetHostResult>
    def get_host(active: Optional[bool] = None,
                 id: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetHostResult
    def get_host_output(active: Optional[pulumi.Input[bool]] = None,
                 id: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetHostResult]
    func GetHost(ctx *Context, args *GetHostArgs, opts ...InvokeOption) (*GetHostResult, error)
    func GetHostOutput(ctx *Context, args *GetHostOutputArgs, opts ...InvokeOption) GetHostResultOutput

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

    public static class GetHost 
    {
        public static Task<GetHostResult> InvokeAsync(GetHostArgs args, InvokeOptions? opts = null)
        public static Output<GetHostResult> Invoke(GetHostInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetHostResult> getHost(GetHostArgs args, InvokeOptions options)
    public static Output<GetHostResult> getHost(GetHostArgs args, InvokeOptions options)
    
    fn::invoke:
      function: opensearch:index/getHost:getHost
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Active bool
    should be set to true
    Id string
    The ID of this resource.
    Active bool
    should be set to true
    Id string
    The ID of this resource.
    active Boolean
    should be set to true
    id String
    The ID of this resource.
    active boolean
    should be set to true
    id string
    The ID of this resource.
    active bool
    should be set to true
    id str
    The ID of this resource.
    active Boolean
    should be set to true
    id String
    The ID of this resource.

    getHost Result

    The following output properties are available:

    Active bool
    should be set to true
    Id string
    The ID of this resource.
    Url string
    the url of the active cluster
    Active bool
    should be set to true
    Id string
    The ID of this resource.
    Url string
    the url of the active cluster
    active Boolean
    should be set to true
    id String
    The ID of this resource.
    url String
    the url of the active cluster
    active boolean
    should be set to true
    id string
    The ID of this resource.
    url string
    the url of the active cluster
    active bool
    should be set to true
    id str
    The ID of this resource.
    url str
    the url of the active cluster
    active Boolean
    should be set to true
    id String
    The ID of this resource.
    url String
    the url of the active cluster

    Package Details

    Repository
    opensearch opensearch-project/terraform-provider-opensearch
    License
    Notes
    This Pulumi package is based on the opensearch Terraform Provider.
    opensearch logo
    opensearch 2.3.1 published on Monday, Apr 14, 2025 by opensearch-project