1. Packages
  2. HashiCorp Nomad
  3. API Docs
  4. getPlugin
Nomad v2.2.0 published on Wednesday, Mar 13, 2024 by Pulumi

nomad.getPlugin

Explore with Pulumi AI

nomad logo
Nomad v2.2.0 published on Wednesday, Mar 13, 2024 by Pulumi

    Lookup a plugin by ID. The aim of this datasource is to determine whether a particular plugin exists on the cluster, to find information on the health and availability of the plugin, and to optionally wait for the plugin before performing actions the require an available plugin controller.

    If a plugin with the specified ID does not exist and the datasource is not configured to wait, it will result in an error. For simple existence checks, use the nomad.getPlugins listing datasource.

    Example Usage

    Check for the existence of a plugin:

    import * as pulumi from "@pulumi/pulumi";
    import * as nomad from "@pulumi/nomad";
    
    const ebs = nomad.getPlugin({
        pluginId: "aws-ebs0",
        waitForHealthy: true,
    });
    
    import pulumi
    import pulumi_nomad as nomad
    
    ebs = nomad.get_plugin(plugin_id="aws-ebs0",
        wait_for_healthy=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-nomad/sdk/v2/go/nomad"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := nomad.GetPlugin(ctx, &nomad.GetPluginArgs{
    			PluginId:       "aws-ebs0",
    			WaitForHealthy: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nomad = Pulumi.Nomad;
    
    return await Deployment.RunAsync(() => 
    {
        var ebs = Nomad.GetPlugin.Invoke(new()
        {
            PluginId = "aws-ebs0",
            WaitForHealthy = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.nomad.NomadFunctions;
    import com.pulumi.nomad.inputs.GetPluginArgs;
    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 ebs = NomadFunctions.getPlugin(GetPluginArgs.builder()
                .pluginId("aws-ebs0")
                .waitForHealthy(true)
                .build());
    
        }
    }
    
    variables:
      ebs:
        fn::invoke:
          Function: nomad:getPlugin
          Arguments:
            pluginId: aws-ebs0
            waitForHealthy: true
    

    This will check for a plugin with the ID aws-ebs0, waiting until the plugin is healthy before returning.

    Using getPlugin

    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 getPlugin(args: GetPluginArgs, opts?: InvokeOptions): Promise<GetPluginResult>
    function getPluginOutput(args: GetPluginOutputArgs, opts?: InvokeOptions): Output<GetPluginResult>
    def get_plugin(plugin_id: Optional[str] = None,
                   wait_for_healthy: Optional[bool] = None,
                   wait_for_registration: Optional[bool] = None,
                   opts: Optional[InvokeOptions] = None) -> GetPluginResult
    def get_plugin_output(plugin_id: Optional[pulumi.Input[str]] = None,
                   wait_for_healthy: Optional[pulumi.Input[bool]] = None,
                   wait_for_registration: Optional[pulumi.Input[bool]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetPluginResult]
    func GetPlugin(ctx *Context, args *GetPluginArgs, opts ...InvokeOption) (*GetPluginResult, error)
    func GetPluginOutput(ctx *Context, args *GetPluginOutputArgs, opts ...InvokeOption) GetPluginResultOutput

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

    public static class GetPlugin 
    {
        public static Task<GetPluginResult> InvokeAsync(GetPluginArgs args, InvokeOptions? opts = null)
        public static Output<GetPluginResult> Invoke(GetPluginInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPluginResult> getPlugin(GetPluginArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: nomad:index/getPlugin:getPlugin
      arguments:
        # arguments dictionary

    The following arguments are supported:

    PluginId string
    (string) ID of the plugin.
    WaitForHealthy bool
    (boolean) retry until the plugin exists and all controllers are healthy
    WaitForRegistration bool
    (boolean) if the plugin doesn't exist, retry until it does
    PluginId string
    (string) ID of the plugin.
    WaitForHealthy bool
    (boolean) retry until the plugin exists and all controllers are healthy
    WaitForRegistration bool
    (boolean) if the plugin doesn't exist, retry until it does
    pluginId String
    (string) ID of the plugin.
    waitForHealthy Boolean
    (boolean) retry until the plugin exists and all controllers are healthy
    waitForRegistration Boolean
    (boolean) if the plugin doesn't exist, retry until it does
    pluginId string
    (string) ID of the plugin.
    waitForHealthy boolean
    (boolean) retry until the plugin exists and all controllers are healthy
    waitForRegistration boolean
    (boolean) if the plugin doesn't exist, retry until it does
    plugin_id str
    (string) ID of the plugin.
    wait_for_healthy bool
    (boolean) retry until the plugin exists and all controllers are healthy
    wait_for_registration bool
    (boolean) if the plugin doesn't exist, retry until it does
    pluginId String
    (string) ID of the plugin.
    waitForHealthy Boolean
    (boolean) retry until the plugin exists and all controllers are healthy
    waitForRegistration Boolean
    (boolean) if the plugin doesn't exist, retry until it does

    getPlugin Result

    The following output properties are available:

    ControllerRequired bool
    (boolean) Whether a controller is required.
    ControllersExpected int
    (integer) The number of registered controllers.
    ControllersHealthy int
    (integer) The number of healthy controllers.
    Id string
    The provider-assigned unique ID for this managed resource.
    Nodes List<GetPluginNode>
    NodesExpected int
    (integer) The number of registered nodes.
    NodesHealthy int
    (integer) The number of healthy nodes.
    PluginId string
    (string) ID of the plugin
    PluginProvider string
    (string) Plugin provider name
    PluginProviderVersion string
    (string) Plugin provider version
    WaitForHealthy bool
    WaitForRegistration bool
    ControllerRequired bool
    (boolean) Whether a controller is required.
    ControllersExpected int
    (integer) The number of registered controllers.
    ControllersHealthy int
    (integer) The number of healthy controllers.
    Id string
    The provider-assigned unique ID for this managed resource.
    Nodes []GetPluginNode
    NodesExpected int
    (integer) The number of registered nodes.
    NodesHealthy int
    (integer) The number of healthy nodes.
    PluginId string
    (string) ID of the plugin
    PluginProvider string
    (string) Plugin provider name
    PluginProviderVersion string
    (string) Plugin provider version
    WaitForHealthy bool
    WaitForRegistration bool
    controllerRequired Boolean
    (boolean) Whether a controller is required.
    controllersExpected Integer
    (integer) The number of registered controllers.
    controllersHealthy Integer
    (integer) The number of healthy controllers.
    id String
    The provider-assigned unique ID for this managed resource.
    nodes List<GetPluginNode>
    nodesExpected Integer
    (integer) The number of registered nodes.
    nodesHealthy Integer
    (integer) The number of healthy nodes.
    pluginId String
    (string) ID of the plugin
    pluginProvider String
    (string) Plugin provider name
    pluginProviderVersion String
    (string) Plugin provider version
    waitForHealthy Boolean
    waitForRegistration Boolean
    controllerRequired boolean
    (boolean) Whether a controller is required.
    controllersExpected number
    (integer) The number of registered controllers.
    controllersHealthy number
    (integer) The number of healthy controllers.
    id string
    The provider-assigned unique ID for this managed resource.
    nodes GetPluginNode[]
    nodesExpected number
    (integer) The number of registered nodes.
    nodesHealthy number
    (integer) The number of healthy nodes.
    pluginId string
    (string) ID of the plugin
    pluginProvider string
    (string) Plugin provider name
    pluginProviderVersion string
    (string) Plugin provider version
    waitForHealthy boolean
    waitForRegistration boolean
    controller_required bool
    (boolean) Whether a controller is required.
    controllers_expected int
    (integer) The number of registered controllers.
    controllers_healthy int
    (integer) The number of healthy controllers.
    id str
    The provider-assigned unique ID for this managed resource.
    nodes Sequence[GetPluginNode]
    nodes_expected int
    (integer) The number of registered nodes.
    nodes_healthy int
    (integer) The number of healthy nodes.
    plugin_id str
    (string) ID of the plugin
    plugin_provider str
    (string) Plugin provider name
    plugin_provider_version str
    (string) Plugin provider version
    wait_for_healthy bool
    wait_for_registration bool
    controllerRequired Boolean
    (boolean) Whether a controller is required.
    controllersExpected Number
    (integer) The number of registered controllers.
    controllersHealthy Number
    (integer) The number of healthy controllers.
    id String
    The provider-assigned unique ID for this managed resource.
    nodes List<Property Map>
    nodesExpected Number
    (integer) The number of registered nodes.
    nodesHealthy Number
    (integer) The number of healthy nodes.
    pluginId String
    (string) ID of the plugin
    pluginProvider String
    (string) Plugin provider name
    pluginProviderVersion String
    (string) Plugin provider version
    waitForHealthy Boolean
    waitForRegistration Boolean

    Supporting Types

    GetPluginNode

    healthy Boolean
    healthyDescription String
    name String
    healthy boolean
    healthyDescription string
    name string
    healthy Boolean
    healthyDescription String
    name String

    Package Details

    Repository
    HashiCorp Nomad pulumi/pulumi-nomad
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the nomad Terraform Provider.
    nomad logo
    Nomad v2.2.0 published on Wednesday, Mar 13, 2024 by Pulumi