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

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

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

    public var args: SecretBackendCertArgs = SecretBackendCertArgs()

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

/**
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as vault from "@pulumi/vault";
 * const app = new vault.pkisecret.SecretBackendCert("app", {
 *     backend: intermediate.path,
 *     name: test.name,
 *     commonName: "app.my.domain",
 * }, {
 *     dependsOn: [admin],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_vault as vault
 * app = vault.pki_secret.SecretBackendCert("app",
 *     backend=intermediate["path"],
 *     name=test["name"],
 *     common_name="app.my.domain",
 *     opts = pulumi.ResourceOptions(depends_on=[admin]))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Vault = Pulumi.Vault;
 * return await Deployment.RunAsync(() =>
 * {
 *     var app = new Vault.PkiSecret.SecretBackendCert("app", new()
 *     {
 *         Backend = intermediate.Path,
 *         Name = test.Name,
 *         CommonName = "app.my.domain",
 *     }, new CustomResourceOptions
 *     {
 *         DependsOn =
 *         {
 *             admin,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"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 {
 * 		_, err := pkiSecret.NewSecretBackendCert(ctx, "app", &pkiSecret.SecretBackendCertArgs{
 * 			Backend:    pulumi.Any(intermediate.Path),
 * 			Name:       pulumi.Any(test.Name),
 * 			CommonName: pulumi.String("app.my.domain"),
 * 		}, pulumi.DependsOn([]pulumi.Resource{
 * 			admin,
 * 		}))
 * 		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.pkiSecret.SecretBackendCert;
 * import com.pulumi.vault.pkiSecret.SecretBackendCertArgs;
 * import com.pulumi.resources.CustomResourceOptions;
 * 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 app = new SecretBackendCert("app", SecretBackendCertArgs.builder()
 *             .backend(intermediate.path())
 *             .name(test.name())
 *             .commonName("app.my.domain")
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(admin)
 *                 .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   app:
 *     type: vault:pkiSecret:SecretBackendCert
 *     properties:
 *       backend: ${intermediate.path}
 *       name: ${test.name}
 *       commonName: app.my.domain
 *     options:
 *       dependson:
 *         - ${admin}
 * ```
 * 
 */
public class SecretBackendCert internal constructor(
    override val javaResource: com.pulumi.vault.pkiSecret.SecretBackendCert,
) : KotlinCustomResource(javaResource, SecretBackendCertMapper) {
    /**
     * List of alternative names
     */
    public val altNames: Output>?
        get() = javaResource.altNames().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * If set to `true`, certs will be renewed if the expiration is within `min_seconds_remaining`. Default `false`
     */
    public val autoRenew: Output?
        get() = javaResource.autoRenew().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The PKI secret backend the resource belongs to.
     */
    public val backend: Output
        get() = javaResource.backend().applyValue({ args0 -> args0 })

    /**
     * The CA chain
     */
    public val caChain: Output
        get() = javaResource.caChain().applyValue({ args0 -> args0 })

    /**
     * The certificate
     */
    public val certificate: Output
        get() = javaResource.certificate().applyValue({ args0 -> args0 })

    /**
     * CN of certificate to create
     */
    public val commonName: Output
        get() = javaResource.commonName().applyValue({ args0 -> args0 })

    /**
     * Flag to exclude CN from SANs
     */
    public val excludeCnFromSans: Output?
        get() = javaResource.excludeCnFromSans().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The expiration date of the certificate in unix epoch format
     */
    public val expiration: Output
        get() = javaResource.expiration().applyValue({ args0 -> args0 })

    /**
     * The format of data
     */
    public val format: Output?
        get() = javaResource.format().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * List of alternative IPs
     */
    public val ipSans: Output>?
        get() = javaResource.ipSans().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * Specifies the default issuer of this request.
     */
    public val issuerRef: Output?
        get() = javaResource.issuerRef().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The issuing CA
     */
    public val issuingCa: Output
        get() = javaResource.issuingCa().applyValue({ args0 -> args0 })

    /**
     * Generate a new certificate when the expiration is within this number of seconds, default is 604800 (7 days)
     */
    public val minSecondsRemaining: Output?
        get() = javaResource.minSecondsRemaining().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Name of the role to create the certificate against
     */
    public val name: Output
        get() = javaResource.name().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) })

    /**
     * List of other SANs
     */
    public val otherSans: Output>?
        get() = javaResource.otherSans().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * The private key
     */
    public val privateKey: Output
        get() = javaResource.privateKey().applyValue({ args0 -> args0 })

    /**
     * The private key format
     */
    public val privateKeyFormat: Output?
        get() = javaResource.privateKeyFormat().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The private key type
     */
    public val privateKeyType: Output
        get() = javaResource.privateKeyType().applyValue({ args0 -> args0 })

    /**
     * `true` if the current time (during refresh) is after the start of the early renewal window declared by `min_seconds_remaining`, and `false` otherwise; if `auto_renew` is set to `true` then the provider will plan to replace the certificate once renewal is pending.
     */
    public val renewPending: Output
        get() = javaResource.renewPending().applyValue({ args0 -> args0 })

    /**
     * If set to `true`, the certificate will be revoked on resource destruction.
     */
    public val revoke: Output?
        get() = javaResource.revoke().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The serial number
     */
    public val serialNumber: Output
        get() = javaResource.serialNumber().applyValue({ args0 -> args0 })

    /**
     * Time to live
     */
    public val ttl: Output?
        get() = javaResource.ttl().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * List of alternative URIs
     */
    public val uriSans: Output>?
        get() = javaResource.uriSans().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * List of Subject User IDs
     */
    public val userIds: Output>?
        get() = javaResource.userIds().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })
}

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy