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

com.pulumi.vault.pkiSecret.kotlin.SecretBackendIssuer.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.pkiSecret.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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List

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

    public var args: SecretBackendIssuerArgs = SecretBackendIssuerArgs()

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

/**
 * ## 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",
 *     defaultLeaseTtlSeconds: 3600,
 *     maxLeaseTtlSeconds: 86400,
 * });
 * const root = new vault.pkisecret.SecretBackendRootCert("root", {
 *     backend: pki.path,
 *     type: "internal",
 *     commonName: "test",
 *     ttl: "86400",
 * });
 * const example = new vault.pkisecret.SecretBackendIssuer("example", {
 *     backend: root.backend,
 *     issuerRef: root.issuerId,
 *     issuerName: "example-issuer",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_vault as vault
 * pki = vault.Mount("pki",
 *     path="pki",
 *     type="pki",
 *     default_lease_ttl_seconds=3600,
 *     max_lease_ttl_seconds=86400)
 * root = vault.pki_secret.SecretBackendRootCert("root",
 *     backend=pki.path,
 *     type="internal",
 *     common_name="test",
 *     ttl="86400")
 * example = vault.pki_secret.SecretBackendIssuer("example",
 *     backend=root.backend,
 *     issuer_ref=root.issuer_id,
 *     issuer_name="example-issuer")
 * ```
 * ```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",
 *         DefaultLeaseTtlSeconds = 3600,
 *         MaxLeaseTtlSeconds = 86400,
 *     });
 *     var root = new Vault.PkiSecret.SecretBackendRootCert("root", new()
 *     {
 *         Backend = pki.Path,
 *         Type = "internal",
 *         CommonName = "test",
 *         Ttl = "86400",
 *     });
 *     var example = new Vault.PkiSecret.SecretBackendIssuer("example", new()
 *     {
 *         Backend = root.Backend,
 *         IssuerRef = root.IssuerId,
 *         IssuerName = "example-issuer",
 *     });
 * });
 * ```
 * ```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"),
 * 			DefaultLeaseTtlSeconds: pulumi.Int(3600),
 * 			MaxLeaseTtlSeconds:     pulumi.Int(86400),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		root, err := pkiSecret.NewSecretBackendRootCert(ctx, "root", &pkiSecret.SecretBackendRootCertArgs{
 * 			Backend:    pki.Path,
 * 			Type:       pulumi.String("internal"),
 * 			CommonName: pulumi.String("test"),
 * 			Ttl:        pulumi.String("86400"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = pkiSecret.NewSecretBackendIssuer(ctx, "example", &pkiSecret.SecretBackendIssuerArgs{
 * 			Backend:    root.Backend,
 * 			IssuerRef:  root.IssuerId,
 * 			IssuerName: pulumi.String("example-issuer"),
 * 		})
 * 		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.pkiSecret.SecretBackendRootCert;
 * import com.pulumi.vault.pkiSecret.SecretBackendRootCertArgs;
 * import com.pulumi.vault.pkiSecret.SecretBackendIssuer;
 * import com.pulumi.vault.pkiSecret.SecretBackendIssuerArgs;
 * 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")
 *             .defaultLeaseTtlSeconds(3600)
 *             .maxLeaseTtlSeconds(86400)
 *             .build());
 *         var root = new SecretBackendRootCert("root", SecretBackendRootCertArgs.builder()
 *             .backend(pki.path())
 *             .type("internal")
 *             .commonName("test")
 *             .ttl("86400")
 *             .build());
 *         var example = new SecretBackendIssuer("example", SecretBackendIssuerArgs.builder()
 *             .backend(root.backend())
 *             .issuerRef(root.issuerId())
 *             .issuerName("example-issuer")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   pki:
 *     type: vault:Mount
 *     properties:
 *       path: pki
 *       type: pki
 *       defaultLeaseTtlSeconds: 3600
 *       maxLeaseTtlSeconds: 86400
 *   root:
 *     type: vault:pkiSecret:SecretBackendRootCert
 *     properties:
 *       backend: ${pki.path}
 *       type: internal
 *       commonName: test
 *       ttl: '86400'
 *   example:
 *     type: vault:pkiSecret:SecretBackendIssuer
 *     properties:
 *       backend: ${root.backend}
 *       issuerRef: ${root.issuerId}
 *       issuerName: example-issuer
 * ```
 * 
 * ## Import
 * PKI secret backend issuer can be imported using the `id`, e.g.
 * ```sh
 * $ pulumi import vault:pkiSecret/secretBackendIssuer:SecretBackendIssuer example pki/issuer/bf9b0d48-d0dd-652c-30be-77d04fc7e94d
 * ```
 */
public class SecretBackendIssuer internal constructor(
    override val javaResource: com.pulumi.vault.pkiSecret.SecretBackendIssuer,
) : KotlinCustomResource(javaResource, SecretBackendIssuerMapper) {
    /**
     * The path the PKI secret backend is mounted at, with no
     * leading or trailing `/`s.
     */
    public val backend: Output
        get() = javaResource.backend().applyValue({ args0 -> args0 })

    /**
     * Specifies the URL values for the CRL
     * Distribution Points field.
     */
    public val crlDistributionPoints: Output>?
        get() = javaResource.crlDistributionPoints().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * Specifies that the AIA URL values should
     * be templated.
     */
    public val enableAiaUrlTemplating: Output?
        get() = javaResource.enableAiaUrlTemplating().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * ID of the issuer.
     */
    public val issuerId: Output
        get() = javaResource.issuerId().applyValue({ args0 -> args0 })

    /**
     * Name of the issuer.
     */
    public val issuerName: Output?
        get() = javaResource.issuerName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Reference to an existing issuer.
     */
    public val issuerRef: Output
        get() = javaResource.issuerRef().applyValue({ args0 -> args0 })

    /**
     * Specifies the URL values for the Issuing
     * Certificate field.
     */
    public val issuingCertificates: Output>?
        get() = javaResource.issuingCertificates().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * Behavior of a leaf's NotAfter field during
     * issuance.
     */
    public val leafNotAfterBehavior: Output
        get() = javaResource.leafNotAfterBehavior().applyValue({ args0 -> args0 })

    /**
     * Chain of issuer references to build this issuer's
     * computed CAChain field from, when non-empty.
     */
    public val manualChains: Output>?
        get() = javaResource.manualChains().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * 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 URL values for the OCSP Servers field.
     */
    public val ocspServers: Output>?
        get() = javaResource.ocspServers().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * Which signature algorithm to use
     * when building CRLs.
     */
    public val revocationSignatureAlgorithm: Output
        get() = javaResource.revocationSignatureAlgorithm().applyValue({ args0 -> args0 })

    /**
     * Allowed usages for this issuer.
     */
    public val usage: Output
        get() = javaResource.usage().applyValue({ args0 -> args0 })
}

public object SecretBackendIssuerMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.vault.pkiSecret.SecretBackendIssuer::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy