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

com.pulumi.vault.transit.kotlin.SecretCacheConfig.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.transit.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 [SecretCacheConfig].
 */
@PulumiTagMarker
public class SecretCacheConfigResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: SecretCacheConfigArgs = SecretCacheConfigArgs()

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

/**
 * Configure the cache for the Transit Secret Backend in Vault.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as vault from "@pulumi/vault";
 * const transit = new vault.Mount("transit", {
 *     path: "transit",
 *     type: "transit",
 *     description: "Example description",
 *     defaultLeaseTtlSeconds: 3600,
 *     maxLeaseTtlSeconds: 86400,
 * });
 * const cfg = new vault.transit.SecretCacheConfig("cfg", {
 *     backend: transit.path,
 *     size: 500,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_vault as vault
 * transit = vault.Mount("transit",
 *     path="transit",
 *     type="transit",
 *     description="Example description",
 *     default_lease_ttl_seconds=3600,
 *     max_lease_ttl_seconds=86400)
 * cfg = vault.transit.SecretCacheConfig("cfg",
 *     backend=transit.path,
 *     size=500)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Vault = Pulumi.Vault;
 * return await Deployment.RunAsync(() =>
 * {
 *     var transit = new Vault.Mount("transit", new()
 *     {
 *         Path = "transit",
 *         Type = "transit",
 *         Description = "Example description",
 *         DefaultLeaseTtlSeconds = 3600,
 *         MaxLeaseTtlSeconds = 86400,
 *     });
 *     var cfg = new Vault.Transit.SecretCacheConfig("cfg", new()
 *     {
 *         Backend = transit.Path,
 *         Size = 500,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
 * 	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/transit"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		transit, err := vault.NewMount(ctx, "transit", &vault.MountArgs{
 * 			Path:                   pulumi.String("transit"),
 * 			Type:                   pulumi.String("transit"),
 * 			Description:            pulumi.String("Example description"),
 * 			DefaultLeaseTtlSeconds: pulumi.Int(3600),
 * 			MaxLeaseTtlSeconds:     pulumi.Int(86400),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = transit.NewSecretCacheConfig(ctx, "cfg", &transit.SecretCacheConfigArgs{
 * 			Backend: transit.Path,
 * 			Size:    pulumi.Int(500),
 * 		})
 * 		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 com.pulumi.vault.transit.SecretCacheConfig;
 * import com.pulumi.vault.transit.SecretCacheConfigArgs;
 * 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 = new Mount("transit", MountArgs.builder()
 *             .path("transit")
 *             .type("transit")
 *             .description("Example description")
 *             .defaultLeaseTtlSeconds(3600)
 *             .maxLeaseTtlSeconds(86400)
 *             .build());
 *         var cfg = new SecretCacheConfig("cfg", SecretCacheConfigArgs.builder()
 *             .backend(transit.path())
 *             .size(500)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   transit:
 *     type: vault:Mount
 *     properties:
 *       path: transit
 *       type: transit
 *       description: Example description
 *       defaultLeaseTtlSeconds: 3600
 *       maxLeaseTtlSeconds: 86400
 *   cfg:
 *     type: vault:transit:SecretCacheConfig
 *     properties:
 *       backend: ${transit.path}
 *       size: 500
 * ```
 * 
 */
public class SecretCacheConfig internal constructor(
    override val javaResource: com.pulumi.vault.transit.SecretCacheConfig,
) : KotlinCustomResource(javaResource, SecretCacheConfigMapper) {
    /**
     * The path the transit secret backend is mounted at, with no leading or trailing `/`s.
     */
    public val backend: Output
        get() = javaResource.backend().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) })

    /**
     * The number of cache entries. 0 means unlimited.
     */
    public val size: Output
        get() = javaResource.size().applyValue({ args0 -> args0 })
}

public object SecretCacheConfigMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.vault.transit.SecretCacheConfig::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy