com.pulumi.vault.kmip.kotlin.SecretBackend.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.kmip.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
import kotlin.collections.List
/**
* Builder for [SecretBackend].
*/
@PulumiTagMarker
public class SecretBackendResourceBuilder internal constructor() {
public var name: String? = null
public var args: SecretBackendArgs = SecretBackendArgs()
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 SecretBackendArgsBuilder.() -> Unit) {
val builder = SecretBackendArgsBuilder()
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(): SecretBackend {
val builtJavaResource = com.pulumi.vault.kmip.SecretBackend(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return SecretBackend(builtJavaResource)
}
}
/**
* Manages KMIP Secret backends in a Vault server. This feature requires
* Vault Enterprise. See the [Vault documentation](https://www.vaultproject.io/docs/secrets/kmip)
* for more information.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const _default = new vault.kmip.SecretBackend("default", {
* path: "kmip",
* description: "Vault KMIP backend",
* listenAddrs: [
* "127.0.0.1:5696",
* "127.0.0.1:8080",
* ],
* tlsCaKeyType: "rsa",
* tlsCaKeyBits: 4096,
* defaultTlsClientKeyType: "rsa",
* defaultTlsClientKeyBits: 4096,
* defaultTlsClientTtl: 86400,
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* default = vault.kmip.SecretBackend("default",
* path="kmip",
* description="Vault KMIP backend",
* listen_addrs=[
* "127.0.0.1:5696",
* "127.0.0.1:8080",
* ],
* tls_ca_key_type="rsa",
* tls_ca_key_bits=4096,
* default_tls_client_key_type="rsa",
* default_tls_client_key_bits=4096,
* default_tls_client_ttl=86400)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Vault.Kmip.SecretBackend("default", new()
* {
* Path = "kmip",
* Description = "Vault KMIP backend",
* ListenAddrs = new[]
* {
* "127.0.0.1:5696",
* "127.0.0.1:8080",
* },
* TlsCaKeyType = "rsa",
* TlsCaKeyBits = 4096,
* DefaultTlsClientKeyType = "rsa",
* DefaultTlsClientKeyBits = 4096,
* DefaultTlsClientTtl = 86400,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault/kmip"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := kmip.NewSecretBackend(ctx, "default", &kmip.SecretBackendArgs{
* Path: pulumi.String("kmip"),
* Description: pulumi.String("Vault KMIP backend"),
* ListenAddrs: pulumi.StringArray{
* pulumi.String("127.0.0.1:5696"),
* pulumi.String("127.0.0.1:8080"),
* },
* TlsCaKeyType: pulumi.String("rsa"),
* TlsCaKeyBits: pulumi.Int(4096),
* DefaultTlsClientKeyType: pulumi.String("rsa"),
* DefaultTlsClientKeyBits: pulumi.Int(4096),
* DefaultTlsClientTtl: 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.kmip.SecretBackend;
* import com.pulumi.vault.kmip.SecretBackendArgs;
* 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 default_ = new SecretBackend("default", SecretBackendArgs.builder()
* .path("kmip")
* .description("Vault KMIP backend")
* .listenAddrs(
* "127.0.0.1:5696",
* "127.0.0.1:8080")
* .tlsCaKeyType("rsa")
* .tlsCaKeyBits(4096)
* .defaultTlsClientKeyType("rsa")
* .defaultTlsClientKeyBits(4096)
* .defaultTlsClientTtl(86400)
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: vault:kmip:SecretBackend
* properties:
* path: kmip
* description: Vault KMIP backend
* listenAddrs:
* - 127.0.0.1:5696
* - 127.0.0.1:8080
* tlsCaKeyType: rsa
* tlsCaKeyBits: 4096
* defaultTlsClientKeyType: rsa
* defaultTlsClientKeyBits: 4096
* defaultTlsClientTtl: 86400
* ```
*
* ## Import
* KMIP Secret backend can be imported using the `path`, e.g.
* ```sh
* $ pulumi import vault:kmip/secretBackend:SecretBackend default kmip
* ```
*/
public class SecretBackend internal constructor(
override val javaResource: com.pulumi.vault.kmip.SecretBackend,
) : KotlinCustomResource(javaResource, SecretBackendMapper) {
/**
* Client certificate key bits, valid values depend on key type.
*/
public val defaultTlsClientKeyBits: Output
get() = javaResource.defaultTlsClientKeyBits().applyValue({ args0 -> args0 })
/**
* Client certificate key type, `rsa` or `ec`.
*/
public val defaultTlsClientKeyType: Output
get() = javaResource.defaultTlsClientKeyType().applyValue({ args0 -> args0 })
/**
* Client certificate TTL in seconds
*/
public val defaultTlsClientTtl: Output
get() = javaResource.defaultTlsClientTtl().applyValue({ args0 -> args0 })
/**
* A human-friendly description for this 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)
})
/**
* Addresses the KMIP server should listen on (`host:port`).
*/
public val listenAddrs: Output>
get() = javaResource.listenAddrs().applyValue({ args0 -> args0.map({ 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 unique path this backend should be mounted at. Must
* not begin or end with a `/`. Defaults to `kmip`.
*/
public val path: Output
get() = javaResource.path().applyValue({ args0 -> args0 })
/**
* Hostnames to include in the server's TLS certificate as SAN DNS names. The first will be used as the common name (CN).
*/
public val serverHostnames: Output>
get() = javaResource.serverHostnames().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
/**
* IPs to include in the server's TLS certificate as SAN IP addresses.
*/
public val serverIps: Output>
get() = javaResource.serverIps().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
/**
* CA key bits, valid values depend on key type.
*/
public val tlsCaKeyBits: Output
get() = javaResource.tlsCaKeyBits().applyValue({ args0 -> args0 })
/**
* CA key type, rsa or ec.
*/
public val tlsCaKeyType: Output
get() = javaResource.tlsCaKeyType().applyValue({ args0 -> args0 })
/**
* Minimum TLS version to accept.
*/
public val tlsMinVersion: Output
get() = javaResource.tlsMinVersion().applyValue({ args0 -> args0 })
}
public object SecretBackendMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.vault.kmip.SecretBackend::class == javaResource::class
override fun map(javaResource: Resource): SecretBackend = SecretBackend(
javaResource as
com.pulumi.vault.kmip.SecretBackend,
)
}
/**
* @see [SecretBackend].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [SecretBackend].
*/
public suspend fun secretBackend(
name: String,
block: suspend SecretBackendResourceBuilder.() -> Unit,
): SecretBackend {
val builder = SecretBackendResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [SecretBackend].
* @param name The _unique_ name of the resulting resource.
*/
public fun secretBackend(name: String): SecretBackend {
val builder = SecretBackendResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy