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

com.pulumi.gcp.firebase.kotlin.HostingCustomDomain.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.firebase.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.firebase.kotlin.outputs.HostingCustomDomainCert
import com.pulumi.gcp.firebase.kotlin.outputs.HostingCustomDomainIssue
import com.pulumi.gcp.firebase.kotlin.outputs.HostingCustomDomainRequiredDnsUpdate
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.firebase.kotlin.outputs.HostingCustomDomainCert.Companion.toKotlin as hostingCustomDomainCertToKotlin
import com.pulumi.gcp.firebase.kotlin.outputs.HostingCustomDomainIssue.Companion.toKotlin as hostingCustomDomainIssueToKotlin
import com.pulumi.gcp.firebase.kotlin.outputs.HostingCustomDomainRequiredDnsUpdate.Companion.toKotlin as hostingCustomDomainRequiredDnsUpdateToKotlin

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

    public var args: HostingCustomDomainArgs = HostingCustomDomainArgs()

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

/**
 * ## Example Usage
 * ### Firebasehosting Customdomain Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.firebase.HostingCustomDomain("default", {
 *     project: "my-project-name",
 *     siteId: "site-id",
 *     customDomain: "custom.domain.com",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.firebase.HostingCustomDomain("default",
 *     project="my-project-name",
 *     site_id="site-id",
 *     custom_domain="custom.domain.com")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.Firebase.HostingCustomDomain("default", new()
 *     {
 *         Project = "my-project-name",
 *         SiteId = "site-id",
 *         CustomDomain = "custom.domain.com",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/firebase"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := firebase.NewHostingCustomDomain(ctx, "default", &firebase.HostingCustomDomainArgs{
 * 			Project:      pulumi.String("my-project-name"),
 * 			SiteId:       pulumi.String("site-id"),
 * 			CustomDomain: pulumi.String("custom.domain.com"),
 * 		})
 * 		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.firebase.HostingCustomDomain;
 * import com.pulumi.gcp.firebase.HostingCustomDomainArgs;
 * 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 default_ = new HostingCustomDomain("default", HostingCustomDomainArgs.builder()
 *             .project("my-project-name")
 *             .siteId("site-id")
 *             .customDomain("custom.domain.com")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:firebase:HostingCustomDomain
 *     properties:
 *       project: my-project-name
 *       siteId: site-id
 *       customDomain: custom.domain.com
 * ```
 * 
 * ### Firebasehosting Customdomain Full
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.firebase.HostingSite("default", {
 *     project: "my-project-name",
 *     siteId: "site-id-full",
 * });
 * const defaultHostingCustomDomain = new gcp.firebase.HostingCustomDomain("default", {
 *     project: "my-project-name",
 *     siteId: _default.siteId,
 *     customDomain: "source.domain.com",
 *     certPreference: "GROUPED",
 *     redirectTarget: "destination.domain.com",
 *     waitDnsVerification: false,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.firebase.HostingSite("default",
 *     project="my-project-name",
 *     site_id="site-id-full")
 * default_hosting_custom_domain = gcp.firebase.HostingCustomDomain("default",
 *     project="my-project-name",
 *     site_id=default.site_id,
 *     custom_domain="source.domain.com",
 *     cert_preference="GROUPED",
 *     redirect_target="destination.domain.com",
 *     wait_dns_verification=False)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.Firebase.HostingSite("default", new()
 *     {
 *         Project = "my-project-name",
 *         SiteId = "site-id-full",
 *     });
 *     var defaultHostingCustomDomain = new Gcp.Firebase.HostingCustomDomain("default", new()
 *     {
 *         Project = "my-project-name",
 *         SiteId = @default.SiteId,
 *         CustomDomain = "source.domain.com",
 *         CertPreference = "GROUPED",
 *         RedirectTarget = "destination.domain.com",
 *         WaitDnsVerification = false,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/firebase"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := firebase.NewHostingSite(ctx, "default", &firebase.HostingSiteArgs{
 * 			Project: pulumi.String("my-project-name"),
 * 			SiteId:  pulumi.String("site-id-full"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = firebase.NewHostingCustomDomain(ctx, "default", &firebase.HostingCustomDomainArgs{
 * 			Project:             pulumi.String("my-project-name"),
 * 			SiteId:              _default.SiteId,
 * 			CustomDomain:        pulumi.String("source.domain.com"),
 * 			CertPreference:      pulumi.String("GROUPED"),
 * 			RedirectTarget:      pulumi.String("destination.domain.com"),
 * 			WaitDnsVerification: pulumi.Bool(false),
 * 		})
 * 		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.firebase.HostingSite;
 * import com.pulumi.gcp.firebase.HostingSiteArgs;
 * import com.pulumi.gcp.firebase.HostingCustomDomain;
 * import com.pulumi.gcp.firebase.HostingCustomDomainArgs;
 * 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 default_ = new HostingSite("default", HostingSiteArgs.builder()
 *             .project("my-project-name")
 *             .siteId("site-id-full")
 *             .build());
 *         var defaultHostingCustomDomain = new HostingCustomDomain("defaultHostingCustomDomain", HostingCustomDomainArgs.builder()
 *             .project("my-project-name")
 *             .siteId(default_.siteId())
 *             .customDomain("source.domain.com")
 *             .certPreference("GROUPED")
 *             .redirectTarget("destination.domain.com")
 *             .waitDnsVerification(false)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:firebase:HostingSite
 *     properties:
 *       project: my-project-name
 *       siteId: site-id-full
 *   defaultHostingCustomDomain:
 *     type: gcp:firebase:HostingCustomDomain
 *     name: default
 *     properties:
 *       project: my-project-name
 *       siteId: ${default.siteId}
 *       customDomain: source.domain.com
 *       certPreference: GROUPED
 *       redirectTarget: destination.domain.com
 *       waitDnsVerification: false
 * ```
 * 
 * ### Firebasehosting Customdomain Cloud Run
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.firebase.HostingSite("default", {
 *     project: "my-project-name",
 *     siteId: "site-id",
 * });
 * const defaultService = new gcp.cloudrunv2.Service("default", {
 *     project: "my-project-name",
 *     name: "cloud-run-service-via-hosting",
 *     location: "us-central1",
 *     ingress: "INGRESS_TRAFFIC_ALL",
 *     template: {
 *         containers: [{
 *             image: "us-docker.pkg.dev/cloudrun/container/hello",
 *         }],
 *     },
 * });
 * const defaultHostingVersion = new gcp.firebase.HostingVersion("default", {
 *     siteId: _default.siteId,
 *     config: {
 *         rewrites: [{
 *             glob: "/hello/**",
 *             run: {
 *                 serviceId: defaultService.name,
 *                 region: defaultService.location,
 *             },
 *         }],
 *     },
 * });
 * const defaultHostingRelease = new gcp.firebase.HostingRelease("default", {
 *     siteId: _default.siteId,
 *     versionName: defaultHostingVersion.name,
 *     message: "Cloud Run Integration",
 * });
 * const defaultHostingCustomDomain = new gcp.firebase.HostingCustomDomain("default", {
 *     project: "my-project-name",
 *     siteId: _default.siteId,
 *     customDomain: "run.custom.domain.com",
 *     waitDnsVerification: false,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.firebase.HostingSite("default",
 *     project="my-project-name",
 *     site_id="site-id")
 * default_service = gcp.cloudrunv2.Service("default",
 *     project="my-project-name",
 *     name="cloud-run-service-via-hosting",
 *     location="us-central1",
 *     ingress="INGRESS_TRAFFIC_ALL",
 *     template=gcp.cloudrunv2.ServiceTemplateArgs(
 *         containers=[gcp.cloudrunv2.ServiceTemplateContainerArgs(
 *             image="us-docker.pkg.dev/cloudrun/container/hello",
 *         )],
 *     ))
 * default_hosting_version = gcp.firebase.HostingVersion("default",
 *     site_id=default.site_id,
 *     config=gcp.firebase.HostingVersionConfigArgs(
 *         rewrites=[gcp.firebase.HostingVersionConfigRewriteArgs(
 *             glob="/hello/**",
 *             run=gcp.firebase.HostingVersionConfigRewriteRunArgs(
 *                 service_id=default_service.name,
 *                 region=default_service.location,
 *             ),
 *         )],
 *     ))
 * default_hosting_release = gcp.firebase.HostingRelease("default",
 *     site_id=default.site_id,
 *     version_name=default_hosting_version.name,
 *     message="Cloud Run Integration")
 * default_hosting_custom_domain = gcp.firebase.HostingCustomDomain("default",
 *     project="my-project-name",
 *     site_id=default.site_id,
 *     custom_domain="run.custom.domain.com",
 *     wait_dns_verification=False)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.Firebase.HostingSite("default", new()
 *     {
 *         Project = "my-project-name",
 *         SiteId = "site-id",
 *     });
 *     var defaultService = new Gcp.CloudRunV2.Service("default", new()
 *     {
 *         Project = "my-project-name",
 *         Name = "cloud-run-service-via-hosting",
 *         Location = "us-central1",
 *         Ingress = "INGRESS_TRAFFIC_ALL",
 *         Template = new Gcp.CloudRunV2.Inputs.ServiceTemplateArgs
 *         {
 *             Containers = new[]
 *             {
 *                 new Gcp.CloudRunV2.Inputs.ServiceTemplateContainerArgs
 *                 {
 *                     Image = "us-docker.pkg.dev/cloudrun/container/hello",
 *                 },
 *             },
 *         },
 *     });
 *     var defaultHostingVersion = new Gcp.Firebase.HostingVersion("default", new()
 *     {
 *         SiteId = @default.SiteId,
 *         Config = new Gcp.Firebase.Inputs.HostingVersionConfigArgs
 *         {
 *             Rewrites = new[]
 *             {
 *                 new Gcp.Firebase.Inputs.HostingVersionConfigRewriteArgs
 *                 {
 *                     Glob = "/hello/**",
 *                     Run = new Gcp.Firebase.Inputs.HostingVersionConfigRewriteRunArgs
 *                     {
 *                         ServiceId = defaultService.Name,
 *                         Region = defaultService.Location,
 *                     },
 *                 },
 *             },
 *         },
 *     });
 *     var defaultHostingRelease = new Gcp.Firebase.HostingRelease("default", new()
 *     {
 *         SiteId = @default.SiteId,
 *         VersionName = defaultHostingVersion.Name,
 *         Message = "Cloud Run Integration",
 *     });
 *     var defaultHostingCustomDomain = new Gcp.Firebase.HostingCustomDomain("default", new()
 *     {
 *         Project = "my-project-name",
 *         SiteId = @default.SiteId,
 *         CustomDomain = "run.custom.domain.com",
 *         WaitDnsVerification = false,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudrunv2"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/firebase"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := firebase.NewHostingSite(ctx, "default", &firebase.HostingSiteArgs{
 * 			Project: pulumi.String("my-project-name"),
 * 			SiteId:  pulumi.String("site-id"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultService, err := cloudrunv2.NewService(ctx, "default", &cloudrunv2.ServiceArgs{
 * 			Project:  pulumi.String("my-project-name"),
 * 			Name:     pulumi.String("cloud-run-service-via-hosting"),
 * 			Location: pulumi.String("us-central1"),
 * 			Ingress:  pulumi.String("INGRESS_TRAFFIC_ALL"),
 * 			Template: &cloudrunv2.ServiceTemplateArgs{
 * 				Containers: cloudrunv2.ServiceTemplateContainerArray{
 * 					&cloudrunv2.ServiceTemplateContainerArgs{
 * 						Image: pulumi.String("us-docker.pkg.dev/cloudrun/container/hello"),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultHostingVersion, err := firebase.NewHostingVersion(ctx, "default", &firebase.HostingVersionArgs{
 * 			SiteId: _default.SiteId,
 * 			Config: &firebase.HostingVersionConfigArgs{
 * 				Rewrites: firebase.HostingVersionConfigRewriteArray{
 * 					&firebase.HostingVersionConfigRewriteArgs{
 * 						Glob: pulumi.String("/hello/**"),
 * 						Run: &firebase.HostingVersionConfigRewriteRunArgs{
 * 							ServiceId: defaultService.Name,
 * 							Region:    defaultService.Location,
 * 						},
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = firebase.NewHostingRelease(ctx, "default", &firebase.HostingReleaseArgs{
 * 			SiteId:      _default.SiteId,
 * 			VersionName: defaultHostingVersion.Name,
 * 			Message:     pulumi.String("Cloud Run Integration"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = firebase.NewHostingCustomDomain(ctx, "default", &firebase.HostingCustomDomainArgs{
 * 			Project:             pulumi.String("my-project-name"),
 * 			SiteId:              _default.SiteId,
 * 			CustomDomain:        pulumi.String("run.custom.domain.com"),
 * 			WaitDnsVerification: pulumi.Bool(false),
 * 		})
 * 		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.firebase.HostingSite;
 * import com.pulumi.gcp.firebase.HostingSiteArgs;
 * import com.pulumi.gcp.cloudrunv2.Service;
 * import com.pulumi.gcp.cloudrunv2.ServiceArgs;
 * import com.pulumi.gcp.cloudrunv2.inputs.ServiceTemplateArgs;
 * import com.pulumi.gcp.firebase.HostingVersion;
 * import com.pulumi.gcp.firebase.HostingVersionArgs;
 * import com.pulumi.gcp.firebase.inputs.HostingVersionConfigArgs;
 * import com.pulumi.gcp.firebase.HostingRelease;
 * import com.pulumi.gcp.firebase.HostingReleaseArgs;
 * import com.pulumi.gcp.firebase.HostingCustomDomain;
 * import com.pulumi.gcp.firebase.HostingCustomDomainArgs;
 * 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 default_ = new HostingSite("default", HostingSiteArgs.builder()
 *             .project("my-project-name")
 *             .siteId("site-id")
 *             .build());
 *         var defaultService = new Service("defaultService", ServiceArgs.builder()
 *             .project("my-project-name")
 *             .name("cloud-run-service-via-hosting")
 *             .location("us-central1")
 *             .ingress("INGRESS_TRAFFIC_ALL")
 *             .template(ServiceTemplateArgs.builder()
 *                 .containers(ServiceTemplateContainerArgs.builder()
 *                     .image("us-docker.pkg.dev/cloudrun/container/hello")
 *                     .build())
 *                 .build())
 *             .build());
 *         var defaultHostingVersion = new HostingVersion("defaultHostingVersion", HostingVersionArgs.builder()
 *             .siteId(default_.siteId())
 *             .config(HostingVersionConfigArgs.builder()
 *                 .rewrites(HostingVersionConfigRewriteArgs.builder()
 *                     .glob("/hello/**")
 *                     .run(HostingVersionConfigRewriteRunArgs.builder()
 *                         .serviceId(defaultService.name())
 *                         .region(defaultService.location())
 *                         .build())
 *                     .build())
 *                 .build())
 *             .build());
 *         var defaultHostingRelease = new HostingRelease("defaultHostingRelease", HostingReleaseArgs.builder()
 *             .siteId(default_.siteId())
 *             .versionName(defaultHostingVersion.name())
 *             .message("Cloud Run Integration")
 *             .build());
 *         var defaultHostingCustomDomain = new HostingCustomDomain("defaultHostingCustomDomain", HostingCustomDomainArgs.builder()
 *             .project("my-project-name")
 *             .siteId(default_.siteId())
 *             .customDomain("run.custom.domain.com")
 *             .waitDnsVerification(false)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:firebase:HostingSite
 *     properties:
 *       project: my-project-name
 *       siteId: site-id
 *   defaultService:
 *     type: gcp:cloudrunv2:Service
 *     name: default
 *     properties:
 *       project: my-project-name
 *       name: cloud-run-service-via-hosting
 *       location: us-central1
 *       ingress: INGRESS_TRAFFIC_ALL
 *       template:
 *         containers:
 *           - image: us-docker.pkg.dev/cloudrun/container/hello
 *   defaultHostingVersion:
 *     type: gcp:firebase:HostingVersion
 *     name: default
 *     properties:
 *       siteId: ${default.siteId}
 *       config:
 *         rewrites:
 *           - glob: /hello/**
 *             run:
 *               serviceId: ${defaultService.name}
 *               region: ${defaultService.location}
 *   defaultHostingRelease:
 *     type: gcp:firebase:HostingRelease
 *     name: default
 *     properties:
 *       siteId: ${default.siteId}
 *       versionName: ${defaultHostingVersion.name}
 *       message: Cloud Run Integration
 *   defaultHostingCustomDomain:
 *     type: gcp:firebase:HostingCustomDomain
 *     name: default
 *     properties:
 *       project: my-project-name
 *       siteId: ${default.siteId}
 *       customDomain: run.custom.domain.com
 *       waitDnsVerification: false
 * ```
 * 
 * ## Import
 * CustomDomain can be imported using any of these accepted formats:
 * * `projects/{{project}}/sites/{{site_id}}/customDomains/{{custom_domain}}`
 * * `sites/{{site_id}}/customDomains/{{custom_domain}}`
 * * `{{project}}/{{site_id}}/{{custom_domain}}`
 * * `{{site_id}}/{{custom_domain}}`
 * When using the `pulumi import` command, CustomDomain can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:firebase/hostingCustomDomain:HostingCustomDomain default projects/{{project}}/sites/{{site_id}}/customDomains/{{custom_domain}}
 * ```
 * ```sh
 * $ pulumi import gcp:firebase/hostingCustomDomain:HostingCustomDomain default sites/{{site_id}}/customDomains/{{custom_domain}}
 * ```
 * ```sh
 * $ pulumi import gcp:firebase/hostingCustomDomain:HostingCustomDomain default {{project}}/{{site_id}}/{{custom_domain}}
 * ```
 * ```sh
 * $ pulumi import gcp:firebase/hostingCustomDomain:HostingCustomDomain default {{site_id}}/{{custom_domain}}
 * ```
 * */*/*/*/*/*/
 */
public class HostingCustomDomain internal constructor(
    override val javaResource: com.pulumi.gcp.firebase.HostingCustomDomain,
) : KotlinCustomResource(javaResource, HostingCustomDomainMapper) {
    /**
     * A field that lets you specify which SSL certificate type Hosting creates
     * for your domain name. Spark plan `CustomDomain`s only have access to the
     * `GROUPED` cert type, while Blaze plan can select any option.
     * Possible values are: `GROUPED`, `PROJECT_GROUPED`, `DEDICATED`.
     */
    public val certPreference: Output
        get() = javaResource.certPreference().applyValue({ args0 -> args0 })

    /**
     * The SSL certificate Hosting has for this `CustomDomain`'s domain name.
     * For new `CustomDomain`s, this often represents Hosting's intent to create
     * a certificate, rather than an actual cert. Check the `state` field for
     * more.
     * Structure is documented below.
     */
    public val certs: Output>
        get() = javaResource.certs().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    hostingCustomDomainCertToKotlin(args0)
                })
            })
        })

    /**
     * The `CustomDomain`'s create time.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * The ID of the `CustomDomain`, which is the domain name you'd like to use with Firebase Hosting.
     * - - -
     */
    public val customDomain: Output
        get() = javaResource.customDomain().applyValue({ args0 -> args0 })

    /**
     * The time the `CustomDomain` was deleted; null for `CustomDomains` that
     * haven't been deleted. Deleted `CustomDomains` persist for approximately 30
     * days, after which time Hosting removes them completely.
     */
    public val deleteTime: Output
        get() = javaResource.deleteTime().applyValue({ args0 -> args0 })

    /**
     * A string that represents the current state of the `CustomDomain` and
     * allows you to confirm its initial state in requests that would modify it.
     */
    public val etag: Output
        get() = javaResource.etag().applyValue({ args0 -> args0 })

    /**
     * The minimum time before a soft-deleted `CustomDomain` is completely removed
     * from Hosting; null for `CustomDomains` that haven't been deleted.
     */
    public val expireTime: Output
        get() = javaResource.expireTime().applyValue({ args0 -> args0 })

    /**
     * The host state of your domain name. Host state is determined by checking each
     * IP address associated with your domain name to see if it's serving
     * Hosting content.
     * HOST_UNHOSTED:
     * Your `CustomDomain`'s domain name isn't associated with any IP addresses.
     * HOST_UNREACHABLE:
     * Your `CustomDomain`'s domain name can't be reached. Hosting services' DNS
     * queries to find your domain name's IP addresses resulted in errors. See
     * your `CustomDomain`'s `issues` field for more details.
     * HOST_MISMATCH:
     * Your `CustomDomain`'s domain name has IP addresses that don't ultimately
     * resolve to Hosting.
     * HOST_CONFLICT:
     * Your `CustomDomain`'s domain name has IP addresses that resolve to both
     * Hosting and other services. To ensure consistent results, remove `A` and
     * `AAAA` records related to non-Hosting services.
     * HOST_ACTIVE:
     * All requests against your `CustomDomain`'s domain name are served by
     * Hosting. If the `CustomDomain`'s `OwnershipState` is also `ACTIVE`, Hosting
     * serves your Hosting Site's content on the domain name.
     */
    public val hostState: Output
        get() = javaResource.hostState().applyValue({ args0 -> args0 })

    /**
     * A set of errors Hosting systems encountered when trying to establish
     * Hosting's ability to serve secure content for your domain name. Resolve
     * these issues to ensure your `CustomDomain` behaves properly.
     * Structure is documented below.
     */
    public val issues: Output>
        get() = javaResource.issues().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    hostingCustomDomainIssueToKotlin(args0)
                })
            })
        })

    /**
     * The fully-qualified name of the `CustomDomain`.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The ownership state of your domain name. Ownership is determined at a
     * Firebase project level, and established by adding `TXT` records to your
     * domain name's DNS records.
     * Ownership cascades to subdomains. Granting a project ownership of `foo.com`
     * also grants that project ownership over `bar.foo.com`, unless you add
     * specific `TXT` records to `bar.foo.com` that grant a different project
     * ownership.
     * If your `CustomDomain` is in an `OwnershipState` other than
     * `OWNERSHIP_ACTIVE` for more than 30 days and it hasn't been updated in at
     * least 30 days, Hosting's ownership systems delete the `CustomDomain`.
     * OWNERSHIP_MISSING:
     * Your `CustomDomain`'s domain name has no Hosting-related ownership records;
     * no Firebase project has permission to act on the domain name's behalf.
     * OWNERSHIP_UNREACHABLE:
     * Your `CustomDomain`'s domain name can't be reached. Hosting services' DNS
     * queries to find your domain name's ownership records resulted in errors.
     * See your `CustomDomain`'s `issues` field for more details.
     * OWNERSHIP_MISMATCH:
     * Your `CustomDomain`'s domain name is owned by another Firebase project.
     * Remove the conflicting `TXT` records and replace them with project-specific
     * records for your current Firebase project.
     * OWNERSHIP_CONFLICT:
     * Your `CustomDomain`'s domain name has conflicting `TXT` records that
     * indicate ownership by both your current Firebase project and another
     * project. Remove the other project's ownership records to grant the current
     * project ownership.
     * OWNERSHIP_PENDING:
     * Your `CustomDomain`'s DNS records are configured correctly. Hosting will
     * transfer ownership of your domain to this `CustomDomain` within 24 hours.
     * OWNERSHIP_ACTIVE:
     * Your `CustomDomain`'s domain name has `TXT` records that grant its project
     * permission to act on its behalf.
     */
    public val ownershipState: Output
        get() = javaResource.ownershipState().applyValue({ args0 -> args0 })

    /**
     * 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 })

    /**
     * if true, indicates that Hosting's systems are attmepting to
     * make the `CustomDomain`'s state match your preferred state. This is most
     * frequently `true` when initially provisioning a `CustomDomain` or when creating
     * a new SSL certificate to match an updated `cert_preference`
     */
    public val reconciling: Output
        get() = javaResource.reconciling().applyValue({ args0 -> args0 })

    /**
     * A domain name that this CustomDomain should direct traffic towards. If
     * specified, Hosting will respond to requests against this CustomDomain
     * with an HTTP 301 code, and route traffic to the specified `redirect_target`
     * instead.
     */
    public val redirectTarget: Output?
        get() = javaResource.redirectTarget().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A set of updates you should make to the domain name's DNS records to
     * let Hosting serve secure content on its behalf.
     * Structure is documented below.
     */
    public val requiredDnsUpdates: Output>
        get() = javaResource.requiredDnsUpdates().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> hostingCustomDomainRequiredDnsUpdateToKotlin(args0) })
            })
        })

    /**
     * The ID of the site in which to create this custom domain association.
     */
    public val siteId: Output
        get() = javaResource.siteId().applyValue({ args0 -> args0 })

    /**
     * The last time the `CustomDomain` was updated.
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })

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

public object HostingCustomDomainMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.firebase.HostingCustomDomain::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy