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

com.pulumi.cloudflare.kotlin.CustomSsl.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: 5.40.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.cloudflare.kotlin

import com.pulumi.cloudflare.kotlin.outputs.CustomSslCustomSslOptions
import com.pulumi.cloudflare.kotlin.outputs.CustomSslCustomSslPriority
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 com.pulumi.cloudflare.kotlin.outputs.CustomSslCustomSslOptions.Companion.toKotlin as customSslCustomSslOptionsToKotlin
import com.pulumi.cloudflare.kotlin.outputs.CustomSslCustomSslPriority.Companion.toKotlin as customSslCustomSslPriorityToKotlin

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

    public var args: CustomSslArgs = CustomSslArgs()

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

/**
 * Provides a Cloudflare custom SSL resource.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as cloudflare from "@pulumi/cloudflare";
 * const example = new cloudflare.CustomSsl("example", {
 *     zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
 *     customSslOptions: {
 *         certificate: "-----INSERT CERTIFICATE-----",
 *         privateKey: "-----INSERT PRIVATE KEY-----",
 *         bundleMethod: "ubiquitous",
 *         geoRestrictions: "us",
 *         type: "legacy_custom",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_cloudflare as cloudflare
 * example = cloudflare.CustomSsl("example",
 *     zone_id="0da42c8d2132a9ddaf714f9e7c920711",
 *     custom_ssl_options={
 *         "certificate": "-----INSERT CERTIFICATE-----",
 *         "private_key": "-----INSERT PRIVATE KEY-----",
 *         "bundle_method": "ubiquitous",
 *         "geo_restrictions": "us",
 *         "type": "legacy_custom",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Cloudflare = Pulumi.Cloudflare;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Cloudflare.CustomSsl("example", new()
 *     {
 *         ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
 *         CustomSslOptions = new Cloudflare.Inputs.CustomSslCustomSslOptionsArgs
 *         {
 *             Certificate = "-----INSERT CERTIFICATE-----",
 *             PrivateKey = "-----INSERT PRIVATE KEY-----",
 *             BundleMethod = "ubiquitous",
 *             GeoRestrictions = "us",
 *             Type = "legacy_custom",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := cloudflare.NewCustomSsl(ctx, "example", &cloudflare.CustomSslArgs{
 * 			ZoneId: pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
 * 			CustomSslOptions: &cloudflare.CustomSslCustomSslOptionsArgs{
 * 				Certificate:     pulumi.String("-----INSERT CERTIFICATE-----"),
 * 				PrivateKey:      pulumi.String("-----INSERT PRIVATE KEY-----"),
 * 				BundleMethod:    pulumi.String("ubiquitous"),
 * 				GeoRestrictions: pulumi.String("us"),
 * 				Type:            pulumi.String("legacy_custom"),
 * 			},
 * 		})
 * 		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.cloudflare.CustomSsl;
 * import com.pulumi.cloudflare.CustomSslArgs;
 * import com.pulumi.cloudflare.inputs.CustomSslCustomSslOptionsArgs;
 * 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 CustomSsl("example", CustomSslArgs.builder()
 *             .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
 *             .customSslOptions(CustomSslCustomSslOptionsArgs.builder()
 *                 .certificate("-----INSERT CERTIFICATE-----")
 *                 .privateKey("-----INSERT PRIVATE KEY-----")
 *                 .bundleMethod("ubiquitous")
 *                 .geoRestrictions("us")
 *                 .type("legacy_custom")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: cloudflare:CustomSsl
 *     properties:
 *       zoneId: 0da42c8d2132a9ddaf714f9e7c920711
 *       customSslOptions:
 *         certificate: '-----INSERT CERTIFICATE-----'
 *         privateKey: '-----INSERT PRIVATE KEY-----'
 *         bundleMethod: ubiquitous
 *         geoRestrictions: us
 *         type: legacy_custom
 * ```
 * 
 * ## Import
 * ```sh
 * $ pulumi import cloudflare:index/customSsl:CustomSsl example /
 * ```
 */
public class CustomSsl internal constructor(
    override val javaResource: com.pulumi.cloudflare.CustomSsl,
) : KotlinCustomResource(javaResource, CustomSslMapper) {
    /**
     * The certificate associated parameters. **Modifying this attribute will force creation of a new resource.**
     */
    public val customSslOptions: Output?
        get() = javaResource.customSslOptions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> customSslCustomSslOptionsToKotlin(args0) })
            }).orElse(null)
        })

    public val customSslPriorities: Output>?
        get() = javaResource.customSslPriorities().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        customSslCustomSslPriorityToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    public val expiresOn: Output
        get() = javaResource.expiresOn().applyValue({ args0 -> args0 })

    public val hosts: Output>
        get() = javaResource.hosts().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    public val issuer: Output
        get() = javaResource.issuer().applyValue({ args0 -> args0 })

    public val modifiedOn: Output
        get() = javaResource.modifiedOn().applyValue({ args0 -> args0 })

    public val priority: Output
        get() = javaResource.priority().applyValue({ args0 -> args0 })

    public val signature: Output
        get() = javaResource.signature().applyValue({ args0 -> args0 })

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

    public val uploadedOn: Output
        get() = javaResource.uploadedOn().applyValue({ args0 -> args0 })

    /**
     * The zone identifier to target for the resource.
     */
    public val zoneId: Output
        get() = javaResource.zoneId().applyValue({ args0 -> args0 })
}

public object CustomSslMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.cloudflare.CustomSsl::class == javaResource::class

    override fun map(javaResource: Resource): CustomSsl = CustomSsl(
        javaResource as
            com.pulumi.cloudflare.CustomSsl,
    )
}

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy