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

com.pulumi.vault.kotlin.NomadSecretBackend.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.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

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

    public var args: NomadSecretBackendArgs = NomadSecretBackendArgs()

    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 NomadSecretBackendArgsBuilder.() -> Unit) {
        val builder = NomadSecretBackendArgsBuilder()
        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(): NomadSecretBackend {
        val builtJavaResource = com.pulumi.vault.NomadSecretBackend(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return NomadSecretBackend(builtJavaResource)
    }
}

/**
 * ## 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,
 *     maxTtl: 240,
 *     address: "https://127.0.0.1:4646",
 *     token: "ae20ceaa-...",
 *     ttl: 120,
 * });
 * ```
 * ```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,
 *     max_ttl=240,
 *     address="https://127.0.0.1:4646",
 *     token="ae20ceaa-...",
 *     ttl=120)
 * ```
 * ```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,
 *         MaxTtl = 240,
 *         Address = "https://127.0.0.1:4646",
 *         Token = "ae20ceaa-...",
 *         Ttl = 120,
 *     });
 * });
 * ```
 * ```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.NewNomadSecretBackend(ctx, "config", &vault.NomadSecretBackendArgs{
 * 			Backend:                pulumi.String("nomad"),
 * 			Description:            pulumi.String("test description"),
 * 			DefaultLeaseTtlSeconds: pulumi.Int(3600),
 * 			MaxLeaseTtlSeconds:     pulumi.Int(7200),
 * 			MaxTtl:                 pulumi.Int(240),
 * 			Address:                pulumi.String("https://127.0.0.1:4646"),
 * 			Token:                  pulumi.String("ae20ceaa-..."),
 * 			Ttl:                    pulumi.Int(120),
 * 		})
 * 		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.NomadSecretBackend;
 * import com.pulumi.vault.NomadSecretBackendArgs;
 * 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")
 *             .maxTtl("240")
 *             .address("https://127.0.0.1:4646")
 *             .token("ae20ceaa-...")
 *             .ttl("120")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   config:
 *     type: vault:NomadSecretBackend
 *     properties:
 *       backend: nomad
 *       description: test description
 *       defaultLeaseTtlSeconds: '3600'
 *       maxLeaseTtlSeconds: '7200'
 *       maxTtl: '240'
 *       address: https://127.0.0.1:4646
 *       token: ae20ceaa-...
 *       ttl: '120'
 * ```
 * 
 * ## Import
 * Nomad secret backend can be imported using the `backend`, e.g.
 * ```sh
 * $ pulumi import vault:index/nomadSecretBackend:NomadSecretBackend nomad nomad
 * ```
 */
public class NomadSecretBackend internal constructor(
    override val javaResource: com.pulumi.vault.NomadSecretBackend,
) : KotlinCustomResource(javaResource, NomadSecretBackendMapper) {
    /**
     * Specifies the address of the Nomad instance, provided
     * as "protocol://host:port" like "http://127.0.0.1:4646".
     */
    public val address: Output?
        get() = javaResource.address().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The unique path this backend should be mounted at. Must
     * not begin or end with a `/`. Defaults to `nomad`.
     */
    public val backend: Output?
        get() = javaResource.backend().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * CA certificate to use when verifying the Nomad server certificate, must be
     * x509 PEM encoded.
     */
    public val caCert: Output?
        get() = javaResource.caCert().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Client certificate to provide to the Nomad server, must be x509 PEM encoded.
     */
    public val clientCert: Output?
        get() = javaResource.clientCert().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Client certificate key to provide to the Nomad server, must be x509 PEM encoded.
     */
    public val clientKey: Output?
        get() = javaResource.clientKey().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

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

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

    /**
     * If set, opts out of mount migration on path updates.
     * See here for more info on [Mount Migration](https://www.vaultproject.io/docs/concepts/mount-migration)
     */
    public val disableRemount: Output?
        get() = javaResource.disableRemount().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Mark the secrets engine as local-only. Local engines are not replicated or removed by
     * replication.Tolerance duration to use when checking the last rotation time.
     */
    public val local: Output?
        get() = javaResource.local().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

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

    /**
     * Specifies the maximum length to use for the name of the Nomad token
     * generated with Generate Credential. If omitted, 0 is used and ignored, defaulting to the max value allowed
     * by the Nomad version.
     */
    public val maxTokenNameLength: Output
        get() = javaResource.maxTokenNameLength().applyValue({ args0 -> args0 })

    /**
     * Maximum possible lease duration for secrets in seconds.
     */
    public val maxTtl: Output
        get() = javaResource.maxTtl().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 the Nomad Management token to use.
     */
    public val token: Output?
        get() = javaResource.token().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Specifies the ttl of the lease for the generated token.
     */
    public val ttl: Output
        get() = javaResource.ttl().applyValue({ args0 -> args0 })
}

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy