com.pulumi.vault.kotlin.VaultFunctions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-vault-kotlin Show documentation
Show all versions of pulumi-vault-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.vault.kotlin
import com.pulumi.vault.VaultFunctions.getAuthBackendPlain
import com.pulumi.vault.VaultFunctions.getAuthBackendsPlain
import com.pulumi.vault.VaultFunctions.getNamespacePlain
import com.pulumi.vault.VaultFunctions.getNamespacesPlain
import com.pulumi.vault.VaultFunctions.getNomadAccessTokenPlain
import com.pulumi.vault.VaultFunctions.getPolicyDocumentPlain
import com.pulumi.vault.VaultFunctions.getRaftAutopilotStatePlain
import com.pulumi.vault.kotlin.inputs.GetAuthBackendPlainArgs
import com.pulumi.vault.kotlin.inputs.GetAuthBackendPlainArgsBuilder
import com.pulumi.vault.kotlin.inputs.GetAuthBackendsPlainArgs
import com.pulumi.vault.kotlin.inputs.GetAuthBackendsPlainArgsBuilder
import com.pulumi.vault.kotlin.inputs.GetNamespacePlainArgs
import com.pulumi.vault.kotlin.inputs.GetNamespacePlainArgsBuilder
import com.pulumi.vault.kotlin.inputs.GetNamespacesPlainArgs
import com.pulumi.vault.kotlin.inputs.GetNamespacesPlainArgsBuilder
import com.pulumi.vault.kotlin.inputs.GetNomadAccessTokenPlainArgs
import com.pulumi.vault.kotlin.inputs.GetNomadAccessTokenPlainArgsBuilder
import com.pulumi.vault.kotlin.inputs.GetPolicyDocumentPlainArgs
import com.pulumi.vault.kotlin.inputs.GetPolicyDocumentPlainArgsBuilder
import com.pulumi.vault.kotlin.inputs.GetPolicyDocumentRule
import com.pulumi.vault.kotlin.inputs.GetRaftAutopilotStatePlainArgs
import com.pulumi.vault.kotlin.inputs.GetRaftAutopilotStatePlainArgsBuilder
import com.pulumi.vault.kotlin.outputs.GetAuthBackendResult
import com.pulumi.vault.kotlin.outputs.GetAuthBackendsResult
import com.pulumi.vault.kotlin.outputs.GetNamespaceResult
import com.pulumi.vault.kotlin.outputs.GetNamespacesResult
import com.pulumi.vault.kotlin.outputs.GetNomadAccessTokenResult
import com.pulumi.vault.kotlin.outputs.GetPolicyDocumentResult
import com.pulumi.vault.kotlin.outputs.GetRaftAutopilotStateResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.vault.kotlin.outputs.GetAuthBackendResult.Companion.toKotlin as getAuthBackendResultToKotlin
import com.pulumi.vault.kotlin.outputs.GetAuthBackendsResult.Companion.toKotlin as getAuthBackendsResultToKotlin
import com.pulumi.vault.kotlin.outputs.GetNamespaceResult.Companion.toKotlin as getNamespaceResultToKotlin
import com.pulumi.vault.kotlin.outputs.GetNamespacesResult.Companion.toKotlin as getNamespacesResultToKotlin
import com.pulumi.vault.kotlin.outputs.GetNomadAccessTokenResult.Companion.toKotlin as getNomadAccessTokenResultToKotlin
import com.pulumi.vault.kotlin.outputs.GetPolicyDocumentResult.Companion.toKotlin as getPolicyDocumentResultToKotlin
import com.pulumi.vault.kotlin.outputs.GetRaftAutopilotStateResult.Companion.toKotlin as getRaftAutopilotStateResultToKotlin
public object VaultFunctions {
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const example = vault.getAuthBackend({
* path: "userpass",
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* example = vault.get_auth_backend(path="userpass")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var example = Vault.GetAuthBackend.Invoke(new()
* {
* Path = "userpass",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := vault.LookupAuthBackend(ctx, &vault.LookupAuthBackendArgs{
* Path: "userpass",
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.vault.VaultFunctions;
* import com.pulumi.vault.inputs.GetAuthBackendArgs;
* 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 = VaultFunctions.getAuthBackend(GetAuthBackendArgs.builder()
* .path("userpass")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* example:
* fn::invoke:
* Function: vault:getAuthBackend
* Arguments:
* path: userpass
* ```
*
* @param argument A collection of arguments for invoking getAuthBackend.
* @return A collection of values returned by getAuthBackend.
*/
public suspend fun getAuthBackend(argument: GetAuthBackendPlainArgs): GetAuthBackendResult =
getAuthBackendResultToKotlin(getAuthBackendPlain(argument.toJava()).await())
/**
* @see [getAuthBackend].
* @param namespace The namespace of the target resource.
* The value should not contain leading or trailing forward slashes.
* The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
* *Available only for Vault Enterprise*.
* @param path The auth backend mount point.
* @return A collection of values returned by getAuthBackend.
*/
public suspend fun getAuthBackend(namespace: String? = null, path: String): GetAuthBackendResult {
val argument = GetAuthBackendPlainArgs(
namespace = namespace,
path = path,
)
return getAuthBackendResultToKotlin(getAuthBackendPlain(argument.toJava()).await())
}
/**
* @see [getAuthBackend].
* @param argument Builder for [com.pulumi.vault.kotlin.inputs.GetAuthBackendPlainArgs].
* @return A collection of values returned by getAuthBackend.
*/
public suspend fun getAuthBackend(argument: suspend GetAuthBackendPlainArgsBuilder.() -> Unit): GetAuthBackendResult {
val builder = GetAuthBackendPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getAuthBackendResultToKotlin(getAuthBackendPlain(builtArgument.toJava()).await())
}
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const example = vault.getAuthBackends({});
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* example = vault.get_auth_backends()
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var example = Vault.GetAuthBackends.Invoke();
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := vault.GetAuthBackends(ctx, nil, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.vault.VaultFunctions;
* import com.pulumi.vault.inputs.GetAuthBackendsArgs;
* 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 = VaultFunctions.getAuthBackends();
* }
* }
* ```
* ```yaml
* variables:
* example:
* fn::invoke:
* Function: vault:getAuthBackends
* Arguments: {}
* ```
*
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const example-filter = vault.getAuthBackends({
* type: "kubernetes",
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* example_filter = vault.get_auth_backends(type="kubernetes")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var example_filter = Vault.GetAuthBackends.Invoke(new()
* {
* Type = "kubernetes",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := vault.GetAuthBackends(ctx, &vault.GetAuthBackendsArgs{
* Type: pulumi.StringRef("kubernetes"),
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.vault.VaultFunctions;
* import com.pulumi.vault.inputs.GetAuthBackendsArgs;
* 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-filter = VaultFunctions.getAuthBackends(GetAuthBackendsArgs.builder()
* .type("kubernetes")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* example-filter:
* fn::invoke:
* Function: vault:getAuthBackends
* Arguments:
* type: kubernetes
* ```
*
* @param argument A collection of arguments for invoking getAuthBackends.
* @return A collection of values returned by getAuthBackends.
*/
public suspend fun getAuthBackends(argument: GetAuthBackendsPlainArgs): GetAuthBackendsResult =
getAuthBackendsResultToKotlin(getAuthBackendsPlain(argument.toJava()).await())
/**
* @see [getAuthBackends].
* @param namespace The namespace of the target resource.
* The value should not contain leading or trailing forward slashes.
* The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
* *Available only for Vault Enterprise*.
* @param type The name of the auth method type. Allows filtering of backends returned by type.
* @return A collection of values returned by getAuthBackends.
*/
public suspend fun getAuthBackends(namespace: String? = null, type: String? = null): GetAuthBackendsResult {
val argument = GetAuthBackendsPlainArgs(
namespace = namespace,
type = type,
)
return getAuthBackendsResultToKotlin(getAuthBackendsPlain(argument.toJava()).await())
}
/**
* @see [getAuthBackends].
* @param argument Builder for [com.pulumi.vault.kotlin.inputs.GetAuthBackendsPlainArgs].
* @return A collection of values returned by getAuthBackends.
*/
public suspend fun getAuthBackends(argument: suspend GetAuthBackendsPlainArgsBuilder.() -> Unit): GetAuthBackendsResult {
val builder = GetAuthBackendsPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getAuthBackendsResultToKotlin(getAuthBackendsPlain(builtArgument.toJava()).await())
}
/**
* ## Example Usage
* ### Current namespace
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const current = vault.getNamespace({});
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* current = vault.get_namespace()
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var current = Vault.GetNamespace.Invoke();
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := vault.LookupNamespace(ctx, nil, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.vault.VaultFunctions;
* import com.pulumi.vault.inputs.GetNamespaceArgs;
* 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 current = VaultFunctions.getNamespace();
* }
* }
* ```
* ```yaml
* variables:
* current:
* fn::invoke:
* Function: vault:getNamespace
* Arguments: {}
* ```
*
* ### Single namespace
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const ns1 = vault.getNamespace({
* path: "ns1",
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* ns1 = vault.get_namespace(path="ns1")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var ns1 = Vault.GetNamespace.Invoke(new()
* {
* Path = "ns1",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := vault.LookupNamespace(ctx, &vault.LookupNamespaceArgs{
* Path: pulumi.StringRef("ns1"),
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.vault.VaultFunctions;
* import com.pulumi.vault.inputs.GetNamespaceArgs;
* 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 ns1 = VaultFunctions.getNamespace(GetNamespaceArgs.builder()
* .path("ns1")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* ns1:
* fn::invoke:
* Function: vault:getNamespace
* Arguments:
* path: ns1
* ```
*
* ### Nested namespace
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const child = vault.getNamespace({
* namespace: "parent",
* path: "child",
* });
* const fullPath = child.then(child => child.id);
* // -> foo/parent/child/
* const pathFq = child.then(child => child.pathFq);
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* child = vault.get_namespace(namespace="parent",
* path="child")
* full_path = child.id
* # -> foo/parent/child/
* path_fq = child.path_fq
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var child = Vault.GetNamespace.Invoke(new()
* {
* Namespace = "parent",
* Path = "child",
* });
* var fullPath = child.Apply(getNamespaceResult => getNamespaceResult.Id);
* // -> foo/parent/child/
* var pathFq = child.Apply(getNamespaceResult => getNamespaceResult.PathFq);
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* child, err := vault.LookupNamespace(ctx, &vault.LookupNamespaceArgs{
* Namespace: pulumi.StringRef("parent"),
* Path: pulumi.StringRef("child"),
* }, nil)
* if err != nil {
* return err
* }
* _ := child.Id
* // -> foo/parent/child/
* _ := child.PathFq
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.vault.VaultFunctions;
* import com.pulumi.vault.inputs.GetNamespaceArgs;
* 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 child = VaultFunctions.getNamespace(GetNamespaceArgs.builder()
* .namespace("parent")
* .path("child")
* .build());
* final var fullPath = child.applyValue(getNamespaceResult -> getNamespaceResult.id());
* // -> foo/parent/child/
* final var pathFq = child.applyValue(getNamespaceResult -> getNamespaceResult.pathFq());
* }
* }
* ```
* ```yaml
* variables:
* child:
* fn::invoke:
* Function: vault:getNamespace
* Arguments:
* namespace: parent
* path: child
* fullPath: ${child.id}
* # -> foo/parent/child/
* pathFq: ${child.pathFq}
* ```
*
* @param argument A collection of arguments for invoking getNamespace.
* @return A collection of values returned by getNamespace.
*/
public suspend fun getNamespace(argument: GetNamespacePlainArgs): GetNamespaceResult =
getNamespaceResultToKotlin(getNamespacePlain(argument.toJava()).await())
/**
* @see [getNamespace].
* @param namespace The namespace to provision the resource in.
* The value should not contain leading or trailing forward slashes.
* The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault#namespace).
* @param path The path of the namespace. Must not have a trailing `/`.
* If not specified or empty, path attributes are set for the current namespace
* based on the `namespace` arguments of the provider and this data source.
* Other path related attributes will be empty in this case.
* @return A collection of values returned by getNamespace.
*/
public suspend fun getNamespace(namespace: String? = null, path: String? = null): GetNamespaceResult {
val argument = GetNamespacePlainArgs(
namespace = namespace,
path = path,
)
return getNamespaceResultToKotlin(getNamespacePlain(argument.toJava()).await())
}
/**
* @see [getNamespace].
* @param argument Builder for [com.pulumi.vault.kotlin.inputs.GetNamespacePlainArgs].
* @return A collection of values returned by getNamespace.
*/
public suspend fun getNamespace(argument: suspend GetNamespacePlainArgsBuilder.() -> Unit): GetNamespaceResult {
val builder = GetNamespacePlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getNamespaceResultToKotlin(getNamespacePlain(builtArgument.toJava()).await())
}
/**
* ## Example Usage
* ### Child namespaces
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const children = vault.getNamespaces({});
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* children = vault.get_namespaces()
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var children = Vault.GetNamespaces.Invoke();
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := vault.GetNamespaces(ctx, nil, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.vault.VaultFunctions;
* import com.pulumi.vault.inputs.GetNamespacesArgs;
* 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 children = VaultFunctions.getNamespaces();
* }
* }
* ```
* ```yaml
* variables:
* children:
* fn::invoke:
* Function: vault:getNamespaces
* Arguments: {}
* ```
*
* ### Nested namespace
* To fetch the details of nested namespaces:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const children = vault.getNamespaces({
* namespace: "parent",
* });
* const child = .reduce((__obj, [, ]) => ({ ...__obj, [__key]: vault.getNamespace({
* namespace: _arg0_.namespace,
* path: __key,
* }) }));
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* children = vault.get_namespaces(namespace="parent")
* child = {__key: vault.get_namespace(namespace=children.namespace,
* path=__key) for __key, __value in children.paths}
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var children = Vault.GetNamespaces.Invoke(new()
* {
* Namespace = "parent",
* });
* var child = .ToDictionary(item => {
* var __key = item.Key;
* return __key;
* }, item => {
* var __key = item.Key;
* return Vault.GetNamespace.Invoke(new()
* {
* Namespace = _arg0_.Namespace,
* Path = __key,
* });
* });
* });
* ```
*
* @param argument A collection of arguments for invoking getNamespaces.
* @return A collection of values returned by getNamespaces.
*/
public suspend fun getNamespaces(argument: GetNamespacesPlainArgs): GetNamespacesResult =
getNamespacesResultToKotlin(getNamespacesPlain(argument.toJava()).await())
/**
* @see [getNamespaces].
* @param namespace The namespace to provision the resource in.
* The value should not contain leading or trailing forward slashes.
* The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault#namespace).
* @return A collection of values returned by getNamespaces.
*/
public suspend fun getNamespaces(namespace: String? = null): GetNamespacesResult {
val argument = GetNamespacesPlainArgs(
namespace = namespace,
)
return getNamespacesResultToKotlin(getNamespacesPlain(argument.toJava()).await())
}
/**
* @see [getNamespaces].
* @param argument Builder for [com.pulumi.vault.kotlin.inputs.GetNamespacesPlainArgs].
* @return A collection of values returned by getNamespaces.
*/
public suspend fun getNamespaces(argument: suspend GetNamespacesPlainArgsBuilder.() -> Unit): GetNamespacesResult {
val builder = GetNamespacesPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getNamespacesResultToKotlin(getNamespacesPlain(builtArgument.toJava()).await())
}
/**
* ## Example Usage
*
* ```typescript
* 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,
* }));
* ```
* ```python
* 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))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var config = new Vault.NomadSecretBackend("config", new()
* {
* 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()
* {
* Backend = config.Backend,
* Role = "test",
* Type = "client",
* Policies = new[]
* {
* "readonly",
* },
* });
* var token = Vault.GetNomadAccessToken.Invoke(new()
* {
* Backend = config.Backend,
* Role = test.Role,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/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
* }
* _ = pulumi.All(config.Backend, test.Role).ApplyT(func(_args []interface{}) (vault.GetNomadAccessTokenResult, error) {
* backend := _args[0].(*string)
* role := _args[1].(string)
* return vault.GetNomadAccessTokenResult(interface{}(vault.GetNomadAccessTokenOutput(ctx, vault.GetNomadAccessTokenOutputArgs{
* Backend: backend,
* Role: role,
* }, nil))), nil
* }).(vault.GetNomadAccessTokenResultOutput)
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.vault.NomadSecretBackend;
* import com.pulumi.vault.NomadSecretBackendArgs;
* import com.pulumi.vault.NomadSecretRole;
* import com.pulumi.vault.NomadSecretRoleArgs;
* import com.pulumi.vault.VaultFunctions;
* import com.pulumi.vault.inputs.GetNomadAccessTokenArgs;
* 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) {
* var config = new NomadSecretBackend("config", NomadSecretBackendArgs.builder()
* .backend("nomad")
* .description("test description")
* .defaultLeaseTtlSeconds("3600")
* .maxLeaseTtlSeconds("7200")
* .address("https://127.0.0.1:4646")
* .token("ae20ceaa-...")
* .build());
* var test = new NomadSecretRole("test", NomadSecretRoleArgs.builder()
* .backend(config.backend())
* .role("test")
* .type("client")
* .policies("readonly")
* .build());
* final var token = VaultFunctions.getNomadAccessToken(GetNomadAccessTokenArgs.builder()
* .backend(config.backend())
* .role(test.role())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* config:
* type: vault:NomadSecretBackend
* properties:
* backend: nomad
* description: test description
* defaultLeaseTtlSeconds: '3600'
* maxLeaseTtlSeconds: '7200'
* address: https://127.0.0.1:4646
* token: ae20ceaa-...
* test:
* type: vault:NomadSecretRole
* properties:
* backend: ${config.backend}
* role: test
* type: client
* policies:
* - readonly
* variables:
* token:
* fn::invoke:
* Function: vault:getNomadAccessToken
* Arguments:
* backend: ${config.backend}
* role: ${test.role}
* ```
*
* @param argument A collection of arguments for invoking getNomadAccessToken.
* @return A collection of values returned by getNomadAccessToken.
*/
public suspend fun getNomadAccessToken(argument: GetNomadAccessTokenPlainArgs): GetNomadAccessTokenResult =
getNomadAccessTokenResultToKotlin(getNomadAccessTokenPlain(argument.toJava()).await())
/**
* @see [getNomadAccessToken].
* @param backend The path to the Nomad secret backend to
* read credentials from, with no leading or trailing `/`s.
* @param namespace The namespace of the target resource.
* The value should not contain leading or trailing forward slashes.
* The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
* *Available only for Vault Enterprise*.
* @param role The name of the Nomad secret backend role to generate
* a token for, with no leading or trailing `/`s.
* @return A collection of values returned by getNomadAccessToken.
*/
public suspend fun getNomadAccessToken(
backend: String,
namespace: String? = null,
role: String,
): GetNomadAccessTokenResult {
val argument = GetNomadAccessTokenPlainArgs(
backend = backend,
namespace = namespace,
role = role,
)
return getNomadAccessTokenResultToKotlin(getNomadAccessTokenPlain(argument.toJava()).await())
}
/**
* @see [getNomadAccessToken].
* @param argument Builder for [com.pulumi.vault.kotlin.inputs.GetNomadAccessTokenPlainArgs].
* @return A collection of values returned by getNomadAccessToken.
*/
public suspend fun getNomadAccessToken(argument: suspend GetNomadAccessTokenPlainArgsBuilder.() -> Unit): GetNomadAccessTokenResult {
val builder = GetNomadAccessTokenPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getNomadAccessTokenResultToKotlin(getNomadAccessTokenPlain(builtArgument.toJava()).await())
}
/**
* This is a data source which can be used to construct a HCL representation of an Vault policy document, for use with resources which expect policy documents, such as the `vault.Policy` resource.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const example = vault.getPolicyDocument({
* rules: [{
* path: "secret/*",
* capabilities: [
* "create",
* "read",
* "update",
* "delete",
* "list",
* ],
* description: "allow all on secrets",
* }],
* });
* const examplePolicy = new vault.Policy("example", {
* name: "example_policy",
* policy: example.then(example => example.hcl),
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* example = vault.get_policy_document(rules=[vault.GetPolicyDocumentRuleArgs(
* path="secret/*",
* capabilities=[
* "create",
* "read",
* "update",
* "delete",
* "list",
* ],
* description="allow all on secrets",
* )])
* example_policy = vault.Policy("example",
* name="example_policy",
* policy=example.hcl)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var example = Vault.GetPolicyDocument.Invoke(new()
* {
* Rules = new[]
* {
* new Vault.Inputs.GetPolicyDocumentRuleInputArgs
* {
* Path = "secret/*",
* Capabilities = new[]
* {
* "create",
* "read",
* "update",
* "delete",
* "list",
* },
* Description = "allow all on secrets",
* },
* },
* });
* var examplePolicy = new Vault.Policy("example", new()
* {
* Name = "example_policy",
* PolicyContents = example.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Hcl),
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := vault.GetPolicyDocument(ctx, &vault.GetPolicyDocumentArgs{
* Rules: []vault.GetPolicyDocumentRule{
* {
* Path: "secret/*",
* Capabilities: []string{
* "create",
* "read",
* "update",
* "delete",
* "list",
* },
* Description: pulumi.StringRef("allow all on secrets"),
* },
* },
* }, nil)
* if err != nil {
* return err
* }
* _, err = vault.NewPolicy(ctx, "example", &vault.PolicyArgs{
* Name: pulumi.String("example_policy"),
* Policy: pulumi.String(example.Hcl),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.vault.VaultFunctions;
* import com.pulumi.vault.inputs.GetPolicyDocumentArgs;
* import com.pulumi.vault.Policy;
* import com.pulumi.vault.PolicyArgs;
* 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 = VaultFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
* .rules(GetPolicyDocumentRuleArgs.builder()
* .path("secret/*")
* .capabilities(
* "create",
* "read",
* "update",
* "delete",
* "list")
* .description("allow all on secrets")
* .build())
* .build());
* var examplePolicy = new Policy("examplePolicy", PolicyArgs.builder()
* .name("example_policy")
* .policy(example.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.hcl()))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* examplePolicy:
* type: vault:Policy
* name: example
* properties:
* name: example_policy
* policy: ${example.hcl}
* variables:
* example:
* fn::invoke:
* Function: vault:getPolicyDocument
* Arguments:
* rules:
* - path: secret/*
* capabilities:
* - create
* - read
* - update
* - delete
* - list
* description: allow all on secrets
* ```
*
* @param argument A collection of arguments for invoking getPolicyDocument.
* @return A collection of values returned by getPolicyDocument.
* */*/*/*/*/*/
*/
public suspend fun getPolicyDocument(argument: GetPolicyDocumentPlainArgs): GetPolicyDocumentResult =
getPolicyDocumentResultToKotlin(getPolicyDocumentPlain(argument.toJava()).await())
/**
* @see [getPolicyDocument].
* @param namespace
* @param rules
* @return A collection of values returned by getPolicyDocument.
*/
public suspend fun getPolicyDocument(
namespace: String? = null,
rules: List? = null,
): GetPolicyDocumentResult {
val argument = GetPolicyDocumentPlainArgs(
namespace = namespace,
rules = rules,
)
return getPolicyDocumentResultToKotlin(getPolicyDocumentPlain(argument.toJava()).await())
}
/**
* @see [getPolicyDocument].
* @param argument Builder for [com.pulumi.vault.kotlin.inputs.GetPolicyDocumentPlainArgs].
* @return A collection of values returned by getPolicyDocument.
*/
public suspend fun getPolicyDocument(argument: suspend GetPolicyDocumentPlainArgsBuilder.() -> Unit): GetPolicyDocumentResult {
val builder = GetPolicyDocumentPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getPolicyDocumentResultToKotlin(getPolicyDocumentPlain(builtArgument.toJava()).await())
}
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* export = async () => {
* const main = await vault.getRaftAutopilotState({});
* return {
* "failure-tolerance": main.failureTolerance,
* };
* }
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* main = vault.get_raft_autopilot_state()
* pulumi.export("failure-tolerance", main.failure_tolerance)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var main = Vault.GetRaftAutopilotState.Invoke();
* return new Dictionary
* {
* ["failure-tolerance"] = main.Apply(getRaftAutopilotStateResult => getRaftAutopilotStateResult.FailureTolerance),
* };
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* main, err := vault.GetRaftAutopilotState(ctx, nil, nil)
* if err != nil {
* return err
* }
* ctx.Export("failure-tolerance", main.FailureTolerance)
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.vault.VaultFunctions;
* import com.pulumi.vault.inputs.GetRaftAutopilotStateArgs;
* 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 main = VaultFunctions.getRaftAutopilotState();
* ctx.export("failure-tolerance", main.applyValue(getRaftAutopilotStateResult -> getRaftAutopilotStateResult.failureTolerance()));
* }
* }
* ```
* ```yaml
* variables:
* main:
* fn::invoke:
* Function: vault:getRaftAutopilotState
* Arguments: {}
* outputs:
* failure-tolerance: ${main.failureTolerance}
* ```
*
* @param argument A collection of arguments for invoking getRaftAutopilotState.
* @return A collection of values returned by getRaftAutopilotState.
*/
public suspend fun getRaftAutopilotState(argument: GetRaftAutopilotStatePlainArgs): GetRaftAutopilotStateResult =
getRaftAutopilotStateResultToKotlin(getRaftAutopilotStatePlain(argument.toJava()).await())
/**
* @see [getRaftAutopilotState].
* @param namespace The namespace of the target resource.
* The value should not contain leading or trailing forward slashes.
* The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
* *Available only for Vault Enterprise*.
* @return A collection of values returned by getRaftAutopilotState.
*/
public suspend fun getRaftAutopilotState(namespace: String? = null): GetRaftAutopilotStateResult {
val argument = GetRaftAutopilotStatePlainArgs(
namespace = namespace,
)
return getRaftAutopilotStateResultToKotlin(getRaftAutopilotStatePlain(argument.toJava()).await())
}
/**
* @see [getRaftAutopilotState].
* @param argument Builder for [com.pulumi.vault.kotlin.inputs.GetRaftAutopilotStatePlainArgs].
* @return A collection of values returned by getRaftAutopilotState.
*/
public suspend fun getRaftAutopilotState(argument: suspend GetRaftAutopilotStatePlainArgsBuilder.() -> Unit): GetRaftAutopilotStateResult {
val builder = GetRaftAutopilotStatePlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getRaftAutopilotStateResultToKotlin(getRaftAutopilotStatePlain(builtArgument.toJava()).await())
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy