HashiCorp Vault

Pulumi Official
Package maintained by Pulumi
v5.5.0 published on Tuesday, May 31, 2022 by Pulumi

getNomadAccessToken

Example Usage

using Pulumi;
using Vault = Pulumi.Vault;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Vault.NomadSecretBackend("config", new Vault.NomadSecretBackendArgs
        {
            Backend = "nomad",
            Description = "test description",
            DefaultLeaseTtlSeconds = 3600,
            MaxLeaseTtlSeconds = 7200,
            Address = "https://127.0.0.1:4646",
            Token = "ae20ceaa-...",
        });
        var test = new Vault.NomadSecretRole("test", new Vault.NomadSecretRoleArgs
        {
            Backend = config.Backend,
            Role = "test",
            Type = "client",
            Policies = 
            {
                "readonly",
            },
        });
        var token = Output.Tuple(config.Backend, test.Role).Apply(values =>
        {
            var backend = values.Item1;
            var role = values.Item2;
            return Vault.GetNomadAccessToken.Invoke(new Vault.GetNomadAccessTokenInvokeArgs
            {
                Backend = backend,
                Role = role,
            });
        });
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		config, err := vault.NewNomadSecretBackend(ctx, "config", &vault.NomadSecretBackendArgs{
			Backend:                pulumi.String("nomad"),
			Description:            pulumi.String("test description"),
			DefaultLeaseTtlSeconds: pulumi.Int(3600),
			MaxLeaseTtlSeconds:     pulumi.Int(7200),
			Address:                pulumi.String("https://127.0.0.1:4646"),
			Token:                  pulumi.String("ae20ceaa-..."),
		})
		if err != nil {
			return err
		}
		test, err := vault.NewNomadSecretRole(ctx, "test", &vault.NomadSecretRoleArgs{
			Backend: config.Backend,
			Role:    pulumi.String("test"),
			Type:    pulumi.String("client"),
			Policies: pulumi.StringArray{
				pulumi.String("readonly"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_vault as vault

config = vault.NomadSecretBackend("config",
    backend="nomad",
    description="test description",
    default_lease_ttl_seconds=3600,
    max_lease_ttl_seconds=7200,
    address="https://127.0.0.1:4646",
    token="ae20ceaa-...")
test = vault.NomadSecretRole("test",
    backend=config.backend,
    role="test",
    type="client",
    policies=["readonly"])
token = pulumi.Output.all(config.backend, test.role).apply(lambda backend, role: vault.get_nomad_access_token_output(backend=backend,
    role=role))
import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";

const config = new vault.NomadSecretBackend("config", {
    backend: "nomad",
    description: "test description",
    defaultLeaseTtlSeconds: 3600,
    maxLeaseTtlSeconds: 7200,
    address: "https://127.0.0.1:4646",
    token: "ae20ceaa-...",
});
const test = new vault.NomadSecretRole("test", {
    backend: config.backend,
    role: "test",
    type: "client",
    policies: ["readonly"],
});
const token = pulumi.all([config.backend, test.role]).apply(([backend, role]) => vault.getNomadAccessTokenOutput({
    backend: backend,
    role: role,
}));

Coming soon!

Using getNomadAccessToken

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 getNomadAccessToken(args: GetNomadAccessTokenArgs, opts?: InvokeOptions): Promise<GetNomadAccessTokenResult>
function getNomadAccessTokenOutput(args: GetNomadAccessTokenOutputArgs, opts?: InvokeOptions): Output<GetNomadAccessTokenResult>
def get_nomad_access_token(backend: Optional[str] = None,
                           role: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetNomadAccessTokenResult
def get_nomad_access_token_output(backend: Optional[pulumi.Input[str]] = None,
                           role: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetNomadAccessTokenResult]
func GetNomadAccessToken(ctx *Context, args *GetNomadAccessTokenArgs, opts ...InvokeOption) (*GetNomadAccessTokenResult, error)
func GetNomadAccessTokenOutput(ctx *Context, args *GetNomadAccessTokenOutputArgs, opts ...InvokeOption) GetNomadAccessTokenResultOutput

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

public static class GetNomadAccessToken 
{
    public static Task<GetNomadAccessTokenResult> InvokeAsync(GetNomadAccessTokenArgs args, InvokeOptions? opts = null)
    public static Output<GetNomadAccessTokenResult> Invoke(GetNomadAccessTokenInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetNomadAccessTokenResult> getNomadAccessToken(GetNomadAccessTokenArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: vault:index/getNomadAccessToken:getNomadAccessToken
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Backend string

The path to the Nomad secret backend to read credentials from, with no leading or trailing /s.

Role string

The name of the Nomad secret backend role to generate a token for, with no leading or trailing /s.

Backend string

The path to the Nomad secret backend to read credentials from, with no leading or trailing /s.

Role string

The name of the Nomad secret backend role to generate a token for, with no leading or trailing /s.

backend String

The path to the Nomad secret backend to read credentials from, with no leading or trailing /s.

role String

The name of the Nomad secret backend role to generate a token for, with no leading or trailing /s.

backend string

The path to the Nomad secret backend to read credentials from, with no leading or trailing /s.

role string

The name of the Nomad secret backend role to generate a token for, with no leading or trailing /s.

backend str

The path to the Nomad secret backend to read credentials from, with no leading or trailing /s.

role str

The name of the Nomad secret backend role to generate a token for, with no leading or trailing /s.

backend String

The path to the Nomad secret backend to read credentials from, with no leading or trailing /s.

role String

The name of the Nomad secret backend role to generate a token for, with no leading or trailing /s.

getNomadAccessToken Result

The following output properties are available:

AccessorId string

The public identifier for a specific token. It can be used to look up information about a token or to revoke a token.

Backend string
Id string

The provider-assigned unique ID for this managed resource.

Role string
SecretId string

The token to be used when making requests to Nomad and should be kept private.

AccessorId string

The public identifier for a specific token. It can be used to look up information about a token or to revoke a token.

Backend string
Id string

The provider-assigned unique ID for this managed resource.

Role string
SecretId string

The token to be used when making requests to Nomad and should be kept private.

accessorId String

The public identifier for a specific token. It can be used to look up information about a token or to revoke a token.

backend String
id String

The provider-assigned unique ID for this managed resource.

role String
secretId String

The token to be used when making requests to Nomad and should be kept private.

accessorId string

The public identifier for a specific token. It can be used to look up information about a token or to revoke a token.

backend string
id string

The provider-assigned unique ID for this managed resource.

role string
secretId string

The token to be used when making requests to Nomad and should be kept private.

accessor_id str

The public identifier for a specific token. It can be used to look up information about a token or to revoke a token.

backend str
id str

The provider-assigned unique ID for this managed resource.

role str
secret_id str

The token to be used when making requests to Nomad and should be kept private.

accessorId String

The public identifier for a specific token. It can be used to look up information about a token or to revoke a token.

backend String
id String

The provider-assigned unique ID for this managed resource.

role String
secretId String

The token to be used when making requests to Nomad and should be kept private.

Package Details

Repository
https://github.com/pulumi/pulumi-vault
License
Apache-2.0
Notes

This Pulumi package is based on the vault Terraform Provider.