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

com.pulumi.gcp.appengine.kotlin.DomainMapping.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: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.appengine.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.appengine.kotlin.outputs.DomainMappingResourceRecord
import com.pulumi.gcp.appengine.kotlin.outputs.DomainMappingSslSettings
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
import com.pulumi.gcp.appengine.kotlin.outputs.DomainMappingResourceRecord.Companion.toKotlin as domainMappingResourceRecordToKotlin
import com.pulumi.gcp.appengine.kotlin.outputs.DomainMappingSslSettings.Companion.toKotlin as domainMappingSslSettingsToKotlin

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

    public var args: DomainMappingArgs = DomainMappingArgs()

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

/**
 * A domain serving an App Engine application.
 * To get more information about DomainMapping, see:
 * * [API documentation](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.domainMappings)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/appengine/docs/standard/python/mapping-custom-domains)
 * ## Example Usage
 * ### App Engine Domain Mapping Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const domainMapping = new gcp.appengine.DomainMapping("domain_mapping", {
 *     domainName: "verified-domain.com",
 *     sslSettings: {
 *         sslManagementType: "AUTOMATIC",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * domain_mapping = gcp.appengine.DomainMapping("domain_mapping",
 *     domain_name="verified-domain.com",
 *     ssl_settings=gcp.appengine.DomainMappingSslSettingsArgs(
 *         ssl_management_type="AUTOMATIC",
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var domainMapping = new Gcp.AppEngine.DomainMapping("domain_mapping", new()
 *     {
 *         DomainName = "verified-domain.com",
 *         SslSettings = new Gcp.AppEngine.Inputs.DomainMappingSslSettingsArgs
 *         {
 *             SslManagementType = "AUTOMATIC",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/appengine"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := appengine.NewDomainMapping(ctx, "domain_mapping", &appengine.DomainMappingArgs{
 * 			DomainName: pulumi.String("verified-domain.com"),
 * 			SslSettings: &appengine.DomainMappingSslSettingsArgs{
 * 				SslManagementType: pulumi.String("AUTOMATIC"),
 * 			},
 * 		})
 * 		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.gcp.appengine.DomainMapping;
 * import com.pulumi.gcp.appengine.DomainMappingArgs;
 * import com.pulumi.gcp.appengine.inputs.DomainMappingSslSettingsArgs;
 * 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 domainMapping = new DomainMapping("domainMapping", DomainMappingArgs.builder()
 *             .domainName("verified-domain.com")
 *             .sslSettings(DomainMappingSslSettingsArgs.builder()
 *                 .sslManagementType("AUTOMATIC")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   domainMapping:
 *     type: gcp:appengine:DomainMapping
 *     name: domain_mapping
 *     properties:
 *       domainName: verified-domain.com
 *       sslSettings:
 *         sslManagementType: AUTOMATIC
 * ```
 * 
 * ## Import
 * DomainMapping can be imported using any of these accepted formats:
 * * `apps/{{project}}/domainMappings/{{domain_name}}`
 * * `{{project}}/{{domain_name}}`
 * * `{{domain_name}}`
 * When using the `pulumi import` command, DomainMapping can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:appengine/domainMapping:DomainMapping default apps/{{project}}/domainMappings/{{domain_name}}
 * ```
 * ```sh
 * $ pulumi import gcp:appengine/domainMapping:DomainMapping default {{project}}/{{domain_name}}
 * ```
 * ```sh
 * $ pulumi import gcp:appengine/domainMapping:DomainMapping default {{domain_name}}
 * ```
 */
public class DomainMapping internal constructor(
    override val javaResource: com.pulumi.gcp.appengine.DomainMapping,
) : KotlinCustomResource(javaResource, DomainMappingMapper) {
    /**
     * Relative name of the domain serving the application. Example: example.com.
     * - - -
     */
    public val domainName: Output
        get() = javaResource.domainName().applyValue({ args0 -> args0 })

    /**
     * Relative name of the object affected by this record. Only applicable for CNAME records. Example: 'www'.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Whether the domain creation should override any existing mappings for this domain.
     * By default, overrides are rejected.
     * Default value is `STRICT`.
     * Possible values are: `STRICT`, `OVERRIDE`.
     */
    public val overrideStrategy: Output?
        get() = javaResource.overrideStrategy().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * The resource records required to configure this domain mapping. These records must be added to the domain's DNS
     * configuration in order to serve the application via this domain mapping.
     * Structure is documented below.
     */
    public val resourceRecords: Output>
        get() = javaResource.resourceRecords().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> domainMappingResourceRecordToKotlin(args0) })
            })
        })

    /**
     * SSL configuration for this domain. If unconfigured, this domain will not serve with SSL.
     * Structure is documented below.
     */
    public val sslSettings: Output?
        get() = javaResource.sslSettings().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    domainMappingSslSettingsToKotlin(args0)
                })
            }).orElse(null)
        })
}

public object DomainMappingMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.appengine.DomainMapping::class == javaResource::class

    override fun map(javaResource: Resource): DomainMapping = DomainMapping(
        javaResource as
            com.pulumi.gcp.appengine.DomainMapping,
    )
}

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy