All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.vault.pkiSecret.kotlin.PkiSecretFunctions.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.vault.pkiSecret.kotlin

import com.pulumi.vault.pkiSecret.PkiSecretFunctions.getBackendConfigEstPlain
import com.pulumi.vault.pkiSecret.PkiSecretFunctions.getBackendIssuerPlain
import com.pulumi.vault.pkiSecret.PkiSecretFunctions.getBackendIssuersPlain
import com.pulumi.vault.pkiSecret.PkiSecretFunctions.getBackendKeyPlain
import com.pulumi.vault.pkiSecret.PkiSecretFunctions.getBackendKeysPlain
import com.pulumi.vault.pkiSecret.kotlin.inputs.GetBackendConfigEstPlainArgs
import com.pulumi.vault.pkiSecret.kotlin.inputs.GetBackendConfigEstPlainArgsBuilder
import com.pulumi.vault.pkiSecret.kotlin.inputs.GetBackendIssuerPlainArgs
import com.pulumi.vault.pkiSecret.kotlin.inputs.GetBackendIssuerPlainArgsBuilder
import com.pulumi.vault.pkiSecret.kotlin.inputs.GetBackendIssuersPlainArgs
import com.pulumi.vault.pkiSecret.kotlin.inputs.GetBackendIssuersPlainArgsBuilder
import com.pulumi.vault.pkiSecret.kotlin.inputs.GetBackendKeyPlainArgs
import com.pulumi.vault.pkiSecret.kotlin.inputs.GetBackendKeyPlainArgsBuilder
import com.pulumi.vault.pkiSecret.kotlin.inputs.GetBackendKeysPlainArgs
import com.pulumi.vault.pkiSecret.kotlin.inputs.GetBackendKeysPlainArgsBuilder
import com.pulumi.vault.pkiSecret.kotlin.outputs.GetBackendConfigEstResult
import com.pulumi.vault.pkiSecret.kotlin.outputs.GetBackendIssuerResult
import com.pulumi.vault.pkiSecret.kotlin.outputs.GetBackendIssuersResult
import com.pulumi.vault.pkiSecret.kotlin.outputs.GetBackendKeyResult
import com.pulumi.vault.pkiSecret.kotlin.outputs.GetBackendKeysResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.vault.pkiSecret.kotlin.outputs.GetBackendConfigEstResult.Companion.toKotlin as getBackendConfigEstResultToKotlin
import com.pulumi.vault.pkiSecret.kotlin.outputs.GetBackendIssuerResult.Companion.toKotlin as getBackendIssuerResultToKotlin
import com.pulumi.vault.pkiSecret.kotlin.outputs.GetBackendIssuersResult.Companion.toKotlin as getBackendIssuersResultToKotlin
import com.pulumi.vault.pkiSecret.kotlin.outputs.GetBackendKeyResult.Companion.toKotlin as getBackendKeyResultToKotlin
import com.pulumi.vault.pkiSecret.kotlin.outputs.GetBackendKeysResult.Companion.toKotlin as getBackendKeysResultToKotlin

public object PkiSecretFunctions {
    /**
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as vault from "@pulumi/vault";
     * const pki = new vault.Mount("pki", {
     *     path: "pki",
     *     type: "pki",
     *     description: "PKI secret engine mount",
     * });
     * const estConfig = vault.pkiSecret.getBackendConfigEstOutput({
     *     backend: pki.path,
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_vault as vault
     * pki = vault.Mount("pki",
     *     path="pki",
     *     type="pki",
     *     description="PKI secret engine mount")
     * est_config = vault.pkiSecret.get_backend_config_est_output(backend=pki.path)
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Vault = Pulumi.Vault;
     * return await Deployment.RunAsync(() =>
     * {
     *     var pki = new Vault.Mount("pki", new()
     *     {
     *         Path = "pki",
     *         Type = "pki",
     *         Description = "PKI secret engine mount",
     *     });
     *     var estConfig = Vault.PkiSecret.GetBackendConfigEst.Invoke(new()
     *     {
     *         Backend = pki.Path,
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
     * 	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/pkiSecret"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		pki, err := vault.NewMount(ctx, "pki", &vault.MountArgs{
     * 			Path:        pulumi.String("pki"),
     * 			Type:        pulumi.String("pki"),
     * 			Description: pulumi.String("PKI secret engine mount"),
     * 		})
     * 		if err != nil {
     * 			return err
     * 		}
     * 		_ = pkiSecret.GetBackendConfigEstOutput(ctx, pkisecret.GetBackendConfigEstOutputArgs{
     * 			Backend: pki.Path,
     * 		}, nil)
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.vault.Mount;
     * import com.pulumi.vault.MountArgs;
     * import com.pulumi.vault.pkiSecret.PkiSecretFunctions;
     * import com.pulumi.vault.pkiSecret.inputs.GetBackendConfigEstArgs;
     * 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 pki = new Mount("pki", MountArgs.builder()
     *             .path("pki")
     *             .type("pki")
     *             .description("PKI secret engine mount")
     *             .build());
     *         final var estConfig = PkiSecretFunctions.getBackendConfigEst(GetBackendConfigEstArgs.builder()
     *             .backend(pki.path())
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * resources:
     *   pki:
     *     type: vault:Mount
     *     properties:
     *       path: pki
     *       type: pki
     *       description: PKI secret engine mount
     * variables:
     *   estConfig:
     *     fn::invoke:
     *       Function: vault:pkiSecret:getBackendConfigEst
     *       Arguments:
     *         backend: ${pki.path}
     * ```
     * 
     * @param argument A collection of arguments for invoking getBackendConfigEst.
     * @return A collection of values returned by getBackendConfigEst.
     */
    public suspend fun getBackendConfigEst(argument: GetBackendConfigEstPlainArgs): GetBackendConfigEstResult =
        getBackendConfigEstResultToKotlin(getBackendConfigEstPlain(argument.toJava()).await())

    /**
     * @see [getBackendConfigEst].
     * @param backend The path to the PKI secret backend to
     * read the EST configuration 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*.
     * @return A collection of values returned by getBackendConfigEst.
     */
    public suspend fun getBackendConfigEst(backend: String, namespace: String? = null): GetBackendConfigEstResult {
        val argument = GetBackendConfigEstPlainArgs(
            backend = backend,
            namespace = namespace,
        )
        return getBackendConfigEstResultToKotlin(getBackendConfigEstPlain(argument.toJava()).await())
    }

    /**
     * @see [getBackendConfigEst].
     * @param argument Builder for [com.pulumi.vault.pkiSecret.kotlin.inputs.GetBackendConfigEstPlainArgs].
     * @return A collection of values returned by getBackendConfigEst.
     */
    public suspend fun getBackendConfigEst(argument: suspend GetBackendConfigEstPlainArgsBuilder.() -> Unit): GetBackendConfigEstResult {
        val builder = GetBackendConfigEstPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getBackendConfigEstResultToKotlin(getBackendConfigEstPlain(builtArgument.toJava()).await())
    }

    /**
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as vault from "@pulumi/vault";
     * const pki = new vault.Mount("pki", {
     *     path: "pki",
     *     type: "pki",
     *     description: "PKI secret engine mount",
     * });
     * const root = new vault.pkisecret.SecretBackendRootCert("root", {
     *     backend: pki.path,
     *     type: "internal",
     *     commonName: "example",
     *     ttl: "86400",
     *     issuerName: "example",
     * });
     * const example = root.issuerId.apply(issuerId => vault.pkiSecret.getBackendIssuerOutput({
     *     backend: root.path,
     *     issuerRef: issuerId,
     * }));
     * ```
     * ```python
     * import pulumi
     * import pulumi_vault as vault
     * pki = vault.Mount("pki",
     *     path="pki",
     *     type="pki",
     *     description="PKI secret engine mount")
     * root = vault.pki_secret.SecretBackendRootCert("root",
     *     backend=pki.path,
     *     type="internal",
     *     common_name="example",
     *     ttl="86400",
     *     issuer_name="example")
     * example = root.issuer_id.apply(lambda issuer_id: vault.pkiSecret.get_backend_issuer_output(backend=root.path,
     *     issuer_ref=issuer_id))
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Vault = Pulumi.Vault;
     * return await Deployment.RunAsync(() =>
     * {
     *     var pki = new Vault.Mount("pki", new()
     *     {
     *         Path = "pki",
     *         Type = "pki",
     *         Description = "PKI secret engine mount",
     *     });
     *     var root = new Vault.PkiSecret.SecretBackendRootCert("root", new()
     *     {
     *         Backend = pki.Path,
     *         Type = "internal",
     *         CommonName = "example",
     *         Ttl = "86400",
     *         IssuerName = "example",
     *     });
     *     var example = Vault.PkiSecret.GetBackendIssuer.Invoke(new()
     *     {
     *         Backend = root.Path,
     *         IssuerRef = root.IssuerId,
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
     * 	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/pkiSecret"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		pki, err := vault.NewMount(ctx, "pki", &vault.MountArgs{
     * 			Path:        pulumi.String("pki"),
     * 			Type:        pulumi.String("pki"),
     * 			Description: pulumi.String("PKI secret engine mount"),
     * 		})
     * 		if err != nil {
     * 			return err
     * 		}
     * 		root, err := pkiSecret.NewSecretBackendRootCert(ctx, "root", &pkiSecret.SecretBackendRootCertArgs{
     * 			Backend:    pki.Path,
     * 			Type:       pulumi.String("internal"),
     * 			CommonName: pulumi.String("example"),
     * 			Ttl:        pulumi.String("86400"),
     * 			IssuerName: pulumi.String("example"),
     * 		})
     * 		if err != nil {
     * 			return err
     * 		}
     * 		_ = root.IssuerId.ApplyT(func(issuerId string) (pkisecret.GetBackendIssuerResult, error) {
     * 			return pkisecret.GetBackendIssuerResult(interface{}(pkiSecret.GetBackendIssuerOutput(ctx, pkisecret.GetBackendIssuerOutputArgs{
     * 				Backend:   root.Path,
     * 				IssuerRef: issuerId,
     * 			}, nil))), nil
     * 		}).(pkisecret.GetBackendIssuerResultOutput)
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.vault.Mount;
     * import com.pulumi.vault.MountArgs;
     * import com.pulumi.vault.pkiSecret.SecretBackendRootCert;
     * import com.pulumi.vault.pkiSecret.SecretBackendRootCertArgs;
     * import com.pulumi.vault.pkiSecret.PkiSecretFunctions;
     * import com.pulumi.vault.pkiSecret.inputs.GetBackendIssuerArgs;
     * 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 pki = new Mount("pki", MountArgs.builder()
     *             .path("pki")
     *             .type("pki")
     *             .description("PKI secret engine mount")
     *             .build());
     *         var root = new SecretBackendRootCert("root", SecretBackendRootCertArgs.builder()
     *             .backend(pki.path())
     *             .type("internal")
     *             .commonName("example")
     *             .ttl("86400")
     *             .issuerName("example")
     *             .build());
     *         final var example = PkiSecretFunctions.getBackendIssuer(GetBackendIssuerArgs.builder()
     *             .backend(root.path())
     *             .issuerRef(root.issuerId())
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * resources:
     *   pki:
     *     type: vault:Mount
     *     properties:
     *       path: pki
     *       type: pki
     *       description: PKI secret engine mount
     *   root:
     *     type: vault:pkiSecret:SecretBackendRootCert
     *     properties:
     *       backend: ${pki.path}
     *       type: internal
     *       commonName: example
     *       ttl: '86400'
     *       issuerName: example
     * variables:
     *   example:
     *     fn::invoke:
     *       Function: vault:pkiSecret:getBackendIssuer
     *       Arguments:
     *         backend: ${root.path}
     *         issuerRef: ${root.issuerId}
     * ```
     * 
     * @param argument A collection of arguments for invoking getBackendIssuer.
     * @return A collection of values returned by getBackendIssuer.
     */
    public suspend fun getBackendIssuer(argument: GetBackendIssuerPlainArgs): GetBackendIssuerResult =
        getBackendIssuerResultToKotlin(getBackendIssuerPlain(argument.toJava()).await())

    /**
     * @see [getBackendIssuer].
     * @param backend The path to the PKI secret backend to
     * read the issuer from, with no leading or trailing `/`s.
     * @param issuerRef Reference to an existing issuer.
     * @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 getBackendIssuer.
     */
    public suspend fun getBackendIssuer(
        backend: String,
        issuerRef: String,
        namespace: String? = null,
    ): GetBackendIssuerResult {
        val argument = GetBackendIssuerPlainArgs(
            backend = backend,
            issuerRef = issuerRef,
            namespace = namespace,
        )
        return getBackendIssuerResultToKotlin(getBackendIssuerPlain(argument.toJava()).await())
    }

    /**
     * @see [getBackendIssuer].
     * @param argument Builder for [com.pulumi.vault.pkiSecret.kotlin.inputs.GetBackendIssuerPlainArgs].
     * @return A collection of values returned by getBackendIssuer.
     */
    public suspend fun getBackendIssuer(argument: suspend GetBackendIssuerPlainArgsBuilder.() -> Unit): GetBackendIssuerResult {
        val builder = GetBackendIssuerPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getBackendIssuerResultToKotlin(getBackendIssuerPlain(builtArgument.toJava()).await())
    }

    /**
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as vault from "@pulumi/vault";
     * const pki = new vault.Mount("pki", {
     *     path: "pki",
     *     type: "pki",
     *     description: "PKI secret engine mount",
     * });
     * const root = new vault.pkisecret.SecretBackendRootCert("root", {
     *     backend: pki.path,
     *     type: "internal",
     *     commonName: "example",
     *     ttl: "86400",
     *     issuerName: "example",
     * });
     * const test = vault.pkiSecret.getBackendIssuersOutput({
     *     backend: root.backend,
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_vault as vault
     * pki = vault.Mount("pki",
     *     path="pki",
     *     type="pki",
     *     description="PKI secret engine mount")
     * root = vault.pki_secret.SecretBackendRootCert("root",
     *     backend=pki.path,
     *     type="internal",
     *     common_name="example",
     *     ttl="86400",
     *     issuer_name="example")
     * test = vault.pkiSecret.get_backend_issuers_output(backend=root.backend)
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Vault = Pulumi.Vault;
     * return await Deployment.RunAsync(() =>
     * {
     *     var pki = new Vault.Mount("pki", new()
     *     {
     *         Path = "pki",
     *         Type = "pki",
     *         Description = "PKI secret engine mount",
     *     });
     *     var root = new Vault.PkiSecret.SecretBackendRootCert("root", new()
     *     {
     *         Backend = pki.Path,
     *         Type = "internal",
     *         CommonName = "example",
     *         Ttl = "86400",
     *         IssuerName = "example",
     *     });
     *     var test = Vault.PkiSecret.GetBackendIssuers.Invoke(new()
     *     {
     *         Backend = root.Backend,
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
     * 	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/pkiSecret"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		pki, err := vault.NewMount(ctx, "pki", &vault.MountArgs{
     * 			Path:        pulumi.String("pki"),
     * 			Type:        pulumi.String("pki"),
     * 			Description: pulumi.String("PKI secret engine mount"),
     * 		})
     * 		if err != nil {
     * 			return err
     * 		}
     * 		root, err := pkiSecret.NewSecretBackendRootCert(ctx, "root", &pkiSecret.SecretBackendRootCertArgs{
     * 			Backend:    pki.Path,
     * 			Type:       pulumi.String("internal"),
     * 			CommonName: pulumi.String("example"),
     * 			Ttl:        pulumi.String("86400"),
     * 			IssuerName: pulumi.String("example"),
     * 		})
     * 		if err != nil {
     * 			return err
     * 		}
     * 		_ = pkiSecret.GetBackendIssuersOutput(ctx, pkisecret.GetBackendIssuersOutputArgs{
     * 			Backend: root.Backend,
     * 		}, nil)
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.vault.Mount;
     * import com.pulumi.vault.MountArgs;
     * import com.pulumi.vault.pkiSecret.SecretBackendRootCert;
     * import com.pulumi.vault.pkiSecret.SecretBackendRootCertArgs;
     * import com.pulumi.vault.pkiSecret.PkiSecretFunctions;
     * import com.pulumi.vault.pkiSecret.inputs.GetBackendIssuersArgs;
     * 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 pki = new Mount("pki", MountArgs.builder()
     *             .path("pki")
     *             .type("pki")
     *             .description("PKI secret engine mount")
     *             .build());
     *         var root = new SecretBackendRootCert("root", SecretBackendRootCertArgs.builder()
     *             .backend(pki.path())
     *             .type("internal")
     *             .commonName("example")
     *             .ttl("86400")
     *             .issuerName("example")
     *             .build());
     *         final var test = PkiSecretFunctions.getBackendIssuers(GetBackendIssuersArgs.builder()
     *             .backend(root.backend())
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * resources:
     *   pki:
     *     type: vault:Mount
     *     properties:
     *       path: pki
     *       type: pki
     *       description: PKI secret engine mount
     *   root:
     *     type: vault:pkiSecret:SecretBackendRootCert
     *     properties:
     *       backend: ${pki.path}
     *       type: internal
     *       commonName: example
     *       ttl: '86400'
     *       issuerName: example
     * variables:
     *   test:
     *     fn::invoke:
     *       Function: vault:pkiSecret:getBackendIssuers
     *       Arguments:
     *         backend: ${root.backend}
     * ```
     * 
     * @param argument A collection of arguments for invoking getBackendIssuers.
     * @return A collection of values returned by getBackendIssuers.
     */
    public suspend fun getBackendIssuers(argument: GetBackendIssuersPlainArgs): GetBackendIssuersResult =
        getBackendIssuersResultToKotlin(getBackendIssuersPlain(argument.toJava()).await())

    /**
     * @see [getBackendIssuers].
     * @param backend The path to the PKI secret backend to
     * read the issuers 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*.
     * @return A collection of values returned by getBackendIssuers.
     */
    public suspend fun getBackendIssuers(backend: String, namespace: String? = null): GetBackendIssuersResult {
        val argument = GetBackendIssuersPlainArgs(
            backend = backend,
            namespace = namespace,
        )
        return getBackendIssuersResultToKotlin(getBackendIssuersPlain(argument.toJava()).await())
    }

    /**
     * @see [getBackendIssuers].
     * @param argument Builder for [com.pulumi.vault.pkiSecret.kotlin.inputs.GetBackendIssuersPlainArgs].
     * @return A collection of values returned by getBackendIssuers.
     */
    public suspend fun getBackendIssuers(argument: suspend GetBackendIssuersPlainArgsBuilder.() -> Unit): GetBackendIssuersResult {
        val builder = GetBackendIssuersPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getBackendIssuersResultToKotlin(getBackendIssuersPlain(builtArgument.toJava()).await())
    }

    /**
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as vault from "@pulumi/vault";
     * const pki = new vault.Mount("pki", {
     *     path: "pki",
     *     type: "pki",
     *     description: "PKI secret engine mount",
     * });
     * const key = new vault.pkisecret.SecretBackendKey("key", {
     *     backend: pki.path,
     *     type: "internal",
     *     keyName: "example",
     *     keyType: "rsa",
     *     keyBits: 4096,
     * });
     * const example = key.keyId.apply(keyId => vault.pkiSecret.getBackendKeyOutput({
     *     backend: keyVaultMount.path,
     *     keyRef: keyId,
     * }));
     * ```
     * ```python
     * import pulumi
     * import pulumi_vault as vault
     * pki = vault.Mount("pki",
     *     path="pki",
     *     type="pki",
     *     description="PKI secret engine mount")
     * key = vault.pki_secret.SecretBackendKey("key",
     *     backend=pki.path,
     *     type="internal",
     *     key_name="example",
     *     key_type="rsa",
     *     key_bits=4096)
     * example = key.key_id.apply(lambda key_id: vault.pkiSecret.get_backend_key_output(backend=key_vault_mount["path"],
     *     key_ref=key_id))
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Vault = Pulumi.Vault;
     * return await Deployment.RunAsync(() =>
     * {
     *     var pki = new Vault.Mount("pki", new()
     *     {
     *         Path = "pki",
     *         Type = "pki",
     *         Description = "PKI secret engine mount",
     *     });
     *     var key = new Vault.PkiSecret.SecretBackendKey("key", new()
     *     {
     *         Backend = pki.Path,
     *         Type = "internal",
     *         KeyName = "example",
     *         KeyType = "rsa",
     *         KeyBits = 4096,
     *     });
     *     var example = Vault.PkiSecret.GetBackendKey.Invoke(new()
     *     {
     *         Backend = keyVaultMount.Path,
     *         KeyRef = key.KeyId,
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
     * 	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/pkiSecret"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		pki, err := vault.NewMount(ctx, "pki", &vault.MountArgs{
     * 			Path:        pulumi.String("pki"),
     * 			Type:        pulumi.String("pki"),
     * 			Description: pulumi.String("PKI secret engine mount"),
     * 		})
     * 		if err != nil {
     * 			return err
     * 		}
     * 		key, err := pkiSecret.NewSecretBackendKey(ctx, "key", &pkiSecret.SecretBackendKeyArgs{
     * 			Backend: pki.Path,
     * 			Type:    pulumi.String("internal"),
     * 			KeyName: pulumi.String("example"),
     * 			KeyType: pulumi.String("rsa"),
     * 			KeyBits: pulumi.Int(4096),
     * 		})
     * 		if err != nil {
     * 			return err
     * 		}
     * 		_ = key.KeyId.ApplyT(func(keyId string) (pkisecret.GetBackendKeyResult, error) {
     * 			return pkisecret.GetBackendKeyResult(interface{}(pkiSecret.GetBackendKeyOutput(ctx, pkisecret.GetBackendKeyOutputArgs{
     * 				Backend: keyVaultMount.Path,
     * 				KeyRef:  keyId,
     * 			}, nil))), nil
     * 		}).(pkisecret.GetBackendKeyResultOutput)
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.vault.Mount;
     * import com.pulumi.vault.MountArgs;
     * import com.pulumi.vault.pkiSecret.SecretBackendKey;
     * import com.pulumi.vault.pkiSecret.SecretBackendKeyArgs;
     * import com.pulumi.vault.pkiSecret.PkiSecretFunctions;
     * import com.pulumi.vault.pkiSecret.inputs.GetBackendKeyArgs;
     * 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 pki = new Mount("pki", MountArgs.builder()
     *             .path("pki")
     *             .type("pki")
     *             .description("PKI secret engine mount")
     *             .build());
     *         var key = new SecretBackendKey("key", SecretBackendKeyArgs.builder()
     *             .backend(pki.path())
     *             .type("internal")
     *             .keyName("example")
     *             .keyType("rsa")
     *             .keyBits("4096")
     *             .build());
     *         final var example = PkiSecretFunctions.getBackendKey(GetBackendKeyArgs.builder()
     *             .backend(keyVaultMount.path())
     *             .keyRef(key.keyId())
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * resources:
     *   pki:
     *     type: vault:Mount
     *     properties:
     *       path: pki
     *       type: pki
     *       description: PKI secret engine mount
     *   key:
     *     type: vault:pkiSecret:SecretBackendKey
     *     properties:
     *       backend: ${pki.path}
     *       type: internal
     *       keyName: example
     *       keyType: rsa
     *       keyBits: '4096'
     * variables:
     *   example:
     *     fn::invoke:
     *       Function: vault:pkiSecret:getBackendKey
     *       Arguments:
     *         backend: ${keyVaultMount.path}
     *         keyRef: ${key.keyId}
     * ```
     * 
     * @param argument A collection of arguments for invoking getBackendKey.
     * @return A collection of values returned by getBackendKey.
     */
    public suspend fun getBackendKey(argument: GetBackendKeyPlainArgs): GetBackendKeyResult =
        getBackendKeyResultToKotlin(getBackendKeyPlain(argument.toJava()).await())

    /**
     * @see [getBackendKey].
     * @param backend The path to the PKI secret backend to
     * read the key from, with no leading or trailing `/`s.
     * @param keyRef Reference to an existing key.
     * @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 getBackendKey.
     */
    public suspend fun getBackendKey(
        backend: String,
        keyRef: String,
        namespace: String? = null,
    ): GetBackendKeyResult {
        val argument = GetBackendKeyPlainArgs(
            backend = backend,
            keyRef = keyRef,
            namespace = namespace,
        )
        return getBackendKeyResultToKotlin(getBackendKeyPlain(argument.toJava()).await())
    }

    /**
     * @see [getBackendKey].
     * @param argument Builder for [com.pulumi.vault.pkiSecret.kotlin.inputs.GetBackendKeyPlainArgs].
     * @return A collection of values returned by getBackendKey.
     */
    public suspend fun getBackendKey(argument: suspend GetBackendKeyPlainArgsBuilder.() -> Unit): GetBackendKeyResult {
        val builder = GetBackendKeyPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getBackendKeyResultToKotlin(getBackendKeyPlain(builtArgument.toJava()).await())
    }

    /**
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as vault from "@pulumi/vault";
     * const pki = new vault.Mount("pki", {
     *     path: "pki",
     *     type: "pki",
     *     description: "PKI secret engine mount",
     * });
     * const root = new vault.pkisecret.SecretBackendRootCert("root", {
     *     backend: pki.path,
     *     type: "internal",
     *     commonName: "example",
     *     ttl: "86400",
     *     keyName: "example",
     * });
     * const example = vault.pkiSecret.getBackendKeysOutput({
     *     backend: root.backend,
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_vault as vault
     * pki = vault.Mount("pki",
     *     path="pki",
     *     type="pki",
     *     description="PKI secret engine mount")
     * root = vault.pki_secret.SecretBackendRootCert("root",
     *     backend=pki.path,
     *     type="internal",
     *     common_name="example",
     *     ttl="86400",
     *     key_name="example")
     * example = vault.pkiSecret.get_backend_keys_output(backend=root.backend)
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Vault = Pulumi.Vault;
     * return await Deployment.RunAsync(() =>
     * {
     *     var pki = new Vault.Mount("pki", new()
     *     {
     *         Path = "pki",
     *         Type = "pki",
     *         Description = "PKI secret engine mount",
     *     });
     *     var root = new Vault.PkiSecret.SecretBackendRootCert("root", new()
     *     {
     *         Backend = pki.Path,
     *         Type = "internal",
     *         CommonName = "example",
     *         Ttl = "86400",
     *         KeyName = "example",
     *     });
     *     var example = Vault.PkiSecret.GetBackendKeys.Invoke(new()
     *     {
     *         Backend = root.Backend,
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
     * 	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/pkiSecret"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		pki, err := vault.NewMount(ctx, "pki", &vault.MountArgs{
     * 			Path:        pulumi.String("pki"),
     * 			Type:        pulumi.String("pki"),
     * 			Description: pulumi.String("PKI secret engine mount"),
     * 		})
     * 		if err != nil {
     * 			return err
     * 		}
     * 		root, err := pkiSecret.NewSecretBackendRootCert(ctx, "root", &pkiSecret.SecretBackendRootCertArgs{
     * 			Backend:    pki.Path,
     * 			Type:       pulumi.String("internal"),
     * 			CommonName: pulumi.String("example"),
     * 			Ttl:        pulumi.String("86400"),
     * 			KeyName:    pulumi.String("example"),
     * 		})
     * 		if err != nil {
     * 			return err
     * 		}
     * 		_ = pkiSecret.GetBackendKeysOutput(ctx, pkisecret.GetBackendKeysOutputArgs{
     * 			Backend: root.Backend,
     * 		}, nil)
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.vault.Mount;
     * import com.pulumi.vault.MountArgs;
     * import com.pulumi.vault.pkiSecret.SecretBackendRootCert;
     * import com.pulumi.vault.pkiSecret.SecretBackendRootCertArgs;
     * import com.pulumi.vault.pkiSecret.PkiSecretFunctions;
     * import com.pulumi.vault.pkiSecret.inputs.GetBackendKeysArgs;
     * 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 pki = new Mount("pki", MountArgs.builder()
     *             .path("pki")
     *             .type("pki")
     *             .description("PKI secret engine mount")
     *             .build());
     *         var root = new SecretBackendRootCert("root", SecretBackendRootCertArgs.builder()
     *             .backend(pki.path())
     *             .type("internal")
     *             .commonName("example")
     *             .ttl("86400")
     *             .keyName("example")
     *             .build());
     *         final var example = PkiSecretFunctions.getBackendKeys(GetBackendKeysArgs.builder()
     *             .backend(root.backend())
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * resources:
     *   pki:
     *     type: vault:Mount
     *     properties:
     *       path: pki
     *       type: pki
     *       description: PKI secret engine mount
     *   root:
     *     type: vault:pkiSecret:SecretBackendRootCert
     *     properties:
     *       backend: ${pki.path}
     *       type: internal
     *       commonName: example
     *       ttl: '86400'
     *       keyName: example
     * variables:
     *   example:
     *     fn::invoke:
     *       Function: vault:pkiSecret:getBackendKeys
     *       Arguments:
     *         backend: ${root.backend}
     * ```
     * 
     * @param argument A collection of arguments for invoking getBackendKeys.
     * @return A collection of values returned by getBackendKeys.
     */
    public suspend fun getBackendKeys(argument: GetBackendKeysPlainArgs): GetBackendKeysResult =
        getBackendKeysResultToKotlin(getBackendKeysPlain(argument.toJava()).await())

    /**
     * @see [getBackendKeys].
     * @param backend The path to the PKI secret backend to
     * read the keys 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*.
     * @return A collection of values returned by getBackendKeys.
     */
    public suspend fun getBackendKeys(backend: String, namespace: String? = null): GetBackendKeysResult {
        val argument = GetBackendKeysPlainArgs(
            backend = backend,
            namespace = namespace,
        )
        return getBackendKeysResultToKotlin(getBackendKeysPlain(argument.toJava()).await())
    }

    /**
     * @see [getBackendKeys].
     * @param argument Builder for [com.pulumi.vault.pkiSecret.kotlin.inputs.GetBackendKeysPlainArgs].
     * @return A collection of values returned by getBackendKeys.
     */
    public suspend fun getBackendKeys(argument: suspend GetBackendKeysPlainArgsBuilder.() -> Unit): GetBackendKeysResult {
        val builder = GetBackendKeysPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getBackendKeysResultToKotlin(getBackendKeysPlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy