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

com.pulumi.azure.appservice.kotlin.CertificateOrder.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.appservice.kotlin

import com.pulumi.azure.appservice.kotlin.outputs.CertificateOrderCertificate
import com.pulumi.azure.appservice.kotlin.outputs.CertificateOrderCertificate.Companion.toKotlin
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
import kotlin.collections.Map

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

    public var args: CertificateOrderArgs = CertificateOrderArgs()

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

/**
 * Manages an App Service Certificate Order.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleCertificateOrder = new azure.appservice.CertificateOrder("example", {
 *     name: "example-cert-order",
 *     resourceGroupName: example.name,
 *     location: "global",
 *     distinguishedName: "CN=example.com",
 *     productType: "Standard",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_certificate_order = azure.appservice.CertificateOrder("example",
 *     name="example-cert-order",
 *     resource_group_name=example.name,
 *     location="global",
 *     distinguished_name="CN=example.com",
 *     product_type="Standard")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleCertificateOrder = new Azure.AppService.CertificateOrder("example", new()
 *     {
 *         Name = "example-cert-order",
 *         ResourceGroupName = example.Name,
 *         Location = "global",
 *         DistinguishedName = "CN=example.com",
 *         ProductType = "Standard",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = appservice.NewCertificateOrder(ctx, "example", &appservice.CertificateOrderArgs{
 * 			Name:              pulumi.String("example-cert-order"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          pulumi.String("global"),
 * 			DistinguishedName: pulumi.String("CN=example.com"),
 * 			ProductType:       pulumi.String("Standard"),
 * 		})
 * 		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.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.appservice.CertificateOrder;
 * import com.pulumi.azure.appservice.CertificateOrderArgs;
 * 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleCertificateOrder = new CertificateOrder("exampleCertificateOrder", CertificateOrderArgs.builder()
 *             .name("example-cert-order")
 *             .resourceGroupName(example.name())
 *             .location("global")
 *             .distinguishedName("CN=example.com")
 *             .productType("Standard")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleCertificateOrder:
 *     type: azure:appservice:CertificateOrder
 *     name: example
 *     properties:
 *       name: example-cert-order
 *       resourceGroupName: ${example.name}
 *       location: global
 *       distinguishedName: CN=example.com
 *       productType: Standard
 * ```
 * 
 * ## Import
 * App Service Certificate Orders can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:appservice/certificateOrder:CertificateOrder example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.CertificateRegistration/certificateOrders/certificateorder1
 * ```
 */
public class CertificateOrder internal constructor(
    override val javaResource: com.pulumi.azure.appservice.CertificateOrder,
) : KotlinCustomResource(javaResource, CertificateOrderMapper) {
    /**
     * Reasons why App Service Certificate is not renewable at the current moment.
     */
    public val appServiceCertificateNotRenewableReasons: Output>
        get() = javaResource.appServiceCertificateNotRenewableReasons().applyValue({ args0 ->
            args0.map({ args0 -> args0 })
        })

    /**
     * true if the certificate should be automatically renewed when it expires; otherwise, false. Defaults to `true`.
     */
    public val autoRenew: Output?
        get() = javaResource.autoRenew().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * State of the Key Vault secret. A `certificates` block as defined below.
     */
    public val certificates: Output>
        get() = javaResource.certificates().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    toKotlin(args0)
                })
            })
        })

    /**
     * Last CSR that was created for this order.
     */
    public val csr: Output
        get() = javaResource.csr().applyValue({ args0 -> args0 })

    /**
     * The Distinguished Name for the App Service Certificate Order.
     * > **NOTE:** Either `csr` or `distinguished_name` must be set - but not both.
     */
    public val distinguishedName: Output
        get() = javaResource.distinguishedName().applyValue({ args0 -> args0 })

    /**
     * Domain verification token.
     */
    public val domainVerificationToken: Output
        get() = javaResource.domainVerificationToken().applyValue({ args0 -> args0 })

    /**
     * Certificate expiration time.
     */
    public val expirationTime: Output
        get() = javaResource.expirationTime().applyValue({ args0 -> args0 })

    /**
     * Certificate thumbprint intermediate certificate.
     */
    public val intermediateThumbprint: Output
        get() = javaResource.intermediateThumbprint().applyValue({ args0 -> args0 })

    /**
     * Whether the private key is external or not.
     */
    public val isPrivateKeyExternal: Output
        get() = javaResource.isPrivateKeyExternal().applyValue({ args0 -> args0 })

    /**
     * Certificate key size. Defaults to `2048`.
     */
    public val keySize: Output?
        get() = javaResource.keySize().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. Currently the only valid value is `global`.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Specifies the name of the certificate. Changing this forces a new resource to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Certificate product type, such as `Standard` or `WildCard`. Defaults to `Standard`.
     */
    public val productType: Output?
        get() = javaResource.productType().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The name of the resource group in which to create the certificate. Changing this forces a new resource to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

    /**
     * Certificate thumbprint for root certificate.
     */
    public val rootThumbprint: Output
        get() = javaResource.rootThumbprint().applyValue({ args0 -> args0 })

    /**
     * Certificate thumbprint for signed certificate.
     */
    public val signedCertificateThumbprint: Output
        get() = javaResource.signedCertificateThumbprint().applyValue({ args0 -> args0 })

    /**
     * Current order status.
     */
    public val status: Output
        get() = javaResource.status().applyValue({ args0 -> args0 })

    /**
     * (Optional) A mapping of tags to assign to the resource.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * Duration in years (must be between `1` and `3`). Defaults to `1`.
     */
    public val validityInYears: Output?
        get() = javaResource.validityInYears().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })
}

public object CertificateOrderMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.appservice.CertificateOrder::class == javaResource::class

    override fun map(javaResource: Resource): CertificateOrder = CertificateOrder(
        javaResource as
            com.pulumi.azure.appservice.CertificateOrder,
    )
}

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy