HashiCorp Nomad

v0.2.1 published on Tuesday, Dec 7, 2021 by Pulumi

getPlugin

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

using Pulumi;
using Nomad = Pulumi.Nomad;

class MyStack : Stack
{
    public MyStack()
    {
        var ebs = Output.Create(Nomad.GetPlugin.InvokeAsync(new Nomad.GetPluginArgs
        {
            PluginId = "aws-ebs0",
            WaitForHealthy = true,
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-nomad/sdk/go/nomad"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		opt0 := true
		_, err := nomad.GetPlugin(ctx, &GetPluginArgs{
			PluginId:       "aws-ebs0",
			WaitForHealthy: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_nomad as nomad

ebs = nomad.get_plugin(plugin_id="aws-ebs0",
    wait_for_healthy=True)
import * as pulumi from "@pulumi/pulumi";
import * as nomad from "@pulumi/nomad";

const ebs = pulumi.output(nomad.getPlugin({
    pluginId: "aws-ebs0",
    waitForHealthy: true,
}));

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)
}

The following arguments are supported:

getPlugin Result

The following output properties are available:

ControllerRequired bool
ControllersExpected int
ControllersHealthy int
Id string
The provider-assigned unique ID for this managed resource.
Nodes List<GetPluginNode>
NodesExpected int
NodesHealthy int
PluginId string
PluginProvider string
PluginProviderVersion string
WaitForHealthy bool
WaitForRegistration bool
ControllerRequired bool
ControllersExpected int
ControllersHealthy int
Id string
The provider-assigned unique ID for this managed resource.
Nodes []GetPluginNode
NodesExpected int
NodesHealthy int
PluginId string
PluginProvider string
PluginProviderVersion string
WaitForHealthy bool
WaitForRegistration bool
controllerRequired boolean
controllersExpected number
controllersHealthy number
id string
The provider-assigned unique ID for this managed resource.
nodes GetPluginNode[]
nodesExpected number
nodesHealthy number
pluginId string
pluginProvider string
pluginProviderVersion string
waitForHealthy boolean
waitForRegistration boolean

Supporting Types

GetPluginNode

Healthy bool
HealthyDescription string
Name string
Healthy bool
HealthyDescription string
Name string
healthy boolean
healthyDescription string
name string

Package Details

Repository
https://github.com/pulumi/pulumi-nomad
License
Apache-2.0
Notes
This Pulumi package is based on the nomad Terraform Provider.