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

com.pulumi.vault.kotlin.Mount.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.4.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.vault.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map

/**
 * Builder for [Mount].
 */
@PulumiTagMarker
public class MountResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: MountArgs = MountArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend MountArgsBuilder.() -> Unit) {
        val builder = MountArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): Mount {
        val builtJavaResource = com.pulumi.vault.Mount(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Mount(builtJavaResource)
    }
}

/**
 * This resource enables a new secrets engine at the given path.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as vault from "@pulumi/vault";
 * const example = new vault.Mount("example", {
 *     path: "dummy",
 *     type: "generic",
 *     description: "This is an example mount",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_vault as vault
 * example = vault.Mount("example",
 *     path="dummy",
 *     type="generic",
 *     description="This is an example mount")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Vault = Pulumi.Vault;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Vault.Mount("example", new()
 *     {
 *         Path = "dummy",
 *         Type = "generic",
 *         Description = "This is an example mount",
 *     });
 * });
 * ```
 * ```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.NewMount(ctx, "example", &vault.MountArgs{
 * 			Path:        pulumi.String("dummy"),
 * 			Type:        pulumi.String("generic"),
 * 			Description: pulumi.String("This is an example mount"),
 * 		})
 * 		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.Mount;
 * import com.pulumi.vault.MountArgs;
 * 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 example = new Mount("example", MountArgs.builder()
 *             .path("dummy")
 *             .type("generic")
 *             .description("This is an example mount")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: vault:Mount
 *     properties:
 *       path: dummy
 *       type: generic
 *       description: This is an example mount
 * ```
 * 
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as vault from "@pulumi/vault";
 * const kvv2_example = new vault.Mount("kvv2-example", {
 *     path: "version2-example",
 *     type: "kv-v2",
 *     options: {
 *         version: "2",
 *         type: "kv-v2",
 *     },
 *     description: "This is an example KV Version 2 secret engine mount",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_vault as vault
 * kvv2_example = vault.Mount("kvv2-example",
 *     path="version2-example",
 *     type="kv-v2",
 *     options={
 *         "version": "2",
 *         "type": "kv-v2",
 *     },
 *     description="This is an example KV Version 2 secret engine mount")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Vault = Pulumi.Vault;
 * return await Deployment.RunAsync(() =>
 * {
 *     var kvv2_example = new Vault.Mount("kvv2-example", new()
 *     {
 *         Path = "version2-example",
 *         Type = "kv-v2",
 *         Options =
 *         {
 *             { "version", "2" },
 *             { "type", "kv-v2" },
 *         },
 *         Description = "This is an example KV Version 2 secret engine mount",
 *     });
 * });
 * ```
 * ```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.NewMount(ctx, "kvv2-example", &vault.MountArgs{
 * 			Path: pulumi.String("version2-example"),
 * 			Type: pulumi.String("kv-v2"),
 * 			Options: pulumi.Map{
 * 				"version": pulumi.Any("2"),
 * 				"type":    pulumi.Any("kv-v2"),
 * 			},
 * 			Description: pulumi.String("This is an example KV Version 2 secret engine mount"),
 * 		})
 * 		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.Mount;
 * import com.pulumi.vault.MountArgs;
 * 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 kvv2_example = new Mount("kvv2-example", MountArgs.builder()
 *             .path("version2-example")
 *             .type("kv-v2")
 *             .options(Map.ofEntries(
 *                 Map.entry("version", "2"),
 *                 Map.entry("type", "kv-v2")
 *             ))
 *             .description("This is an example KV Version 2 secret engine mount")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   kvv2-example:
 *     type: vault:Mount
 *     properties:
 *       path: version2-example
 *       type: kv-v2
 *       options:
 *         version: '2'
 *         type: kv-v2
 *       description: This is an example KV Version 2 secret engine mount
 * ```
 * 
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as vault from "@pulumi/vault";
 * const transit_example = new vault.Mount("transit-example", {
 *     path: "transit-example",
 *     type: "transit",
 *     description: "This is an example transit secret engine mount",
 *     options: {
 *         convergent_encryption: false,
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_vault as vault
 * transit_example = vault.Mount("transit-example",
 *     path="transit-example",
 *     type="transit",
 *     description="This is an example transit secret engine mount",
 *     options={
 *         "convergent_encryption": False,
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Vault = Pulumi.Vault;
 * return await Deployment.RunAsync(() =>
 * {
 *     var transit_example = new Vault.Mount("transit-example", new()
 *     {
 *         Path = "transit-example",
 *         Type = "transit",
 *         Description = "This is an example transit secret engine mount",
 *         Options =
 *         {
 *             { "convergent_encryption", false },
 *         },
 *     });
 * });
 * ```
 * ```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.NewMount(ctx, "transit-example", &vault.MountArgs{
 * 			Path:        pulumi.String("transit-example"),
 * 			Type:        pulumi.String("transit"),
 * 			Description: pulumi.String("This is an example transit secret engine mount"),
 * 			Options: pulumi.Map{
 * 				"convergent_encryption": pulumi.Any(false),
 * 			},
 * 		})
 * 		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.Mount;
 * import com.pulumi.vault.MountArgs;
 * 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 transit_example = new Mount("transit-example", MountArgs.builder()
 *             .path("transit-example")
 *             .type("transit")
 *             .description("This is an example transit secret engine mount")
 *             .options(Map.of("convergent_encryption", false))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   transit-example:
 *     type: vault:Mount
 *     properties:
 *       path: transit-example
 *       type: transit
 *       description: This is an example transit secret engine mount
 *       options:
 *         convergent_encryption: false
 * ```
 * 
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as vault from "@pulumi/vault";
 * const pki_example = new vault.Mount("pki-example", {
 *     path: "pki-example",
 *     type: "pki",
 *     description: "This is an example PKI mount",
 *     defaultLeaseTtlSeconds: 3600,
 *     maxLeaseTtlSeconds: 86400,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_vault as vault
 * pki_example = vault.Mount("pki-example",
 *     path="pki-example",
 *     type="pki",
 *     description="This is an example PKI mount",
 *     default_lease_ttl_seconds=3600,
 *     max_lease_ttl_seconds=86400)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Vault = Pulumi.Vault;
 * return await Deployment.RunAsync(() =>
 * {
 *     var pki_example = new Vault.Mount("pki-example", new()
 *     {
 *         Path = "pki-example",
 *         Type = "pki",
 *         Description = "This is an example PKI mount",
 *         DefaultLeaseTtlSeconds = 3600,
 *         MaxLeaseTtlSeconds = 86400,
 *     });
 * });
 * ```
 * ```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.NewMount(ctx, "pki-example", &vault.MountArgs{
 * 			Path:                   pulumi.String("pki-example"),
 * 			Type:                   pulumi.String("pki"),
 * 			Description:            pulumi.String("This is an example PKI mount"),
 * 			DefaultLeaseTtlSeconds: pulumi.Int(3600),
 * 			MaxLeaseTtlSeconds:     pulumi.Int(86400),
 * 		})
 * 		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.Mount;
 * import com.pulumi.vault.MountArgs;
 * 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_example = new Mount("pki-example", MountArgs.builder()
 *             .path("pki-example")
 *             .type("pki")
 *             .description("This is an example PKI mount")
 *             .defaultLeaseTtlSeconds(3600)
 *             .maxLeaseTtlSeconds(86400)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   pki-example:
 *     type: vault:Mount
 *     properties:
 *       path: pki-example
 *       type: pki
 *       description: This is an example PKI mount
 *       defaultLeaseTtlSeconds: 3600
 *       maxLeaseTtlSeconds: 86400
 * ```
 * 
 * ## Import
 * Mounts can be imported using the `path`, e.g.
 * ```sh
 * $ pulumi import vault:index/mount:Mount example dummy
 * ```
 */
public class Mount internal constructor(
    override val javaResource: com.pulumi.vault.Mount,
) : KotlinCustomResource(javaResource, MountMapper) {
    /**
     * The accessor for this mount.
     */
    public val accessor: Output
        get() = javaResource.accessor().applyValue({ args0 -> args0 })

    /**
     * Set of managed key registry entry names that the mount in question is allowed to access
     */
    public val allowedManagedKeys: Output>?
        get() = javaResource.allowedManagedKeys().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * List of headers to allow, allowing a plugin to include
     * them in the response.
     */
    public val allowedResponseHeaders: Output>?
        get() = javaResource.allowedResponseHeaders().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * Specifies the list of keys that will not be HMAC'd by audit devices in the request data object.
     */
    public val auditNonHmacRequestKeys: Output>
        get() = javaResource.auditNonHmacRequestKeys().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            })
        })

    /**
     * Specifies the list of keys that will not be HMAC'd by audit devices in the response data object.
     */
    public val auditNonHmacResponseKeys: Output>
        get() = javaResource.auditNonHmacResponseKeys().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            })
        })

    /**
     * Default lease duration for tokens and secrets in seconds
     */
    public val defaultLeaseTtlSeconds: Output
        get() = javaResource.defaultLeaseTtlSeconds().applyValue({ args0 -> args0 })

    /**
     * List of allowed authentication mount accessors the
     * backend can request delegated authentication for.
     */
    public val delegatedAuthAccessors: Output>?
        get() = javaResource.delegatedAuthAccessors().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * Human-friendly description of the mount
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Boolean flag that can be explicitly set to true to enable the secrets engine to access Vault's external entropy source
     */
    public val externalEntropyAccess: Output?
        get() = javaResource.externalEntropyAccess().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The key to use for signing plugin workload identity tokens. If
     * not provided, this will default to Vault's OIDC default key.
     */
    public val identityTokenKey: Output?
        get() = javaResource.identityTokenKey().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies whether to show this mount in the UI-specific
     * listing endpoint. Valid values are `unauth` or `hidden`. If not set, behaves like `hidden`.
     */
    public val listingVisibility: Output?
        get() = javaResource.listingVisibility().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Boolean flag that can be explicitly set to true to enforce local mount in HA environment
     */
    public val local: Output?
        get() = javaResource.local().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Maximum possible lease duration for tokens and secrets in seconds
     */
    public val maxLeaseTtlSeconds: Output
        get() = javaResource.maxLeaseTtlSeconds().applyValue({ args0 -> args0 })

    /**
     * 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/index.html#namespace).
     * *Available only for Vault Enterprise*.
     */
    public val namespace: Output?
        get() = javaResource.namespace().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Specifies mount type specific options that are passed to the backend
     */
    public val options: Output>?
        get() = javaResource.options().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * List of headers to allow and pass from the request to
     * the plugin.
     */
    public val passthroughRequestHeaders: Output>?
        get() = javaResource.passthroughRequestHeaders().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * Where the secret backend will be mounted
     */
    public val path: Output
        get() = javaResource.path().applyValue({ args0 -> args0 })

    /**
     * Specifies the semantic version of the plugin to use, e.g. "v1.0.0".
     * If unspecified, the server will select any matching unversioned plugin that may have been
     * registered, the latest versioned plugin registered, or a built-in plugin in that order of precedence.
     */
    public val pluginVersion: Output?
        get() = javaResource.pluginVersion().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Boolean flag that can be explicitly set to true to enable seal wrapping for the mount, causing values stored by the mount to be wrapped by the seal's encryption capability
     */
    public val sealWrap: Output
        get() = javaResource.sealWrap().applyValue({ args0 -> args0 })

    /**
     * Type of the backend, such as "aws"
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 -> args0 })
}

public object MountMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.vault.Mount::class == javaResource::class

    override fun map(javaResource: Resource): Mount = Mount(javaResource as com.pulumi.vault.Mount)
}

/**
 * @see [Mount].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [Mount].
 */
public suspend fun mount(name: String, block: suspend MountResourceBuilder.() -> Unit): Mount {
    val builder = MountResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [Mount].
 * @param name The _unique_ name of the resulting resource.
 */
public fun mount(name: String): Mount {
    val builder = MountResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy