import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages Custom Domains for Firebase Hosting. Custom Domains link your * domain names with Firebase Hosting sites, allowing Hosting to serve content * on those domain names. * * To get more information about CustomDomain, see: * * * [API documentation](https://firebase.google.com/docs/reference/hosting/rest/v1beta1/projects.sites.customDomains) * * How-to Guides * * [Official Documentation](https://firebase.google.com/docs/hosting) * * ## 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", * }); * ``` * ### 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, * }); * ``` * ### 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", * }], * }, * deletionProtection: true, * }); * 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, * }); * ``` * * ## 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}} * ``` */ export declare class HostingCustomDomain extends pulumi.CustomResource { /** * Get an existing HostingCustomDomain resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: HostingCustomDomainState, opts?: pulumi.CustomResourceOptions): HostingCustomDomain; /** * Returns true if the given object is an instance of HostingCustomDomain. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is HostingCustomDomain; /** * 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`. */ readonly certPreference: pulumi.Output; /** * 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. */ readonly certs: pulumi.Output; /** * The `CustomDomain`'s create time. */ readonly createTime: pulumi.Output; /** * The ID of the `CustomDomain`, which is the domain name you'd like to use with Firebase Hosting. */ readonly customDomain: pulumi.Output; /** * 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. */ readonly deleteTime: pulumi.Output; /** * A string that represents the current state of the `CustomDomain` and * allows you to confirm its initial state in requests that would modify it. */ readonly etag: pulumi.Output; /** * The minimum time before a soft-deleted `CustomDomain` is completely removed * from Hosting; null for `CustomDomains` that haven't been deleted. */ readonly expireTime: pulumi.Output; /** * 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. */ readonly hostState: pulumi.Output; /** * 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. */ readonly issues: pulumi.Output; /** * The fully-qualified name of the `CustomDomain`. */ readonly name: pulumi.Output; /** * 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. */ readonly ownershipState: pulumi.Output; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output; /** * if true, indicates that Hosting's systems are attempting 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 `certPreference` */ readonly reconciling: pulumi.Output; /** * 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 `redirectTarget` * instead. */ readonly redirectTarget: pulumi.Output; /** * 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. */ readonly requiredDnsUpdates: pulumi.Output; /** * The ID of the site in which to create this custom domain association. */ readonly siteId: pulumi.Output; /** * The last time the `CustomDomain` was updated. */ readonly updateTime: pulumi.Output; readonly waitDnsVerification: pulumi.Output; /** * Create a HostingCustomDomain resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: HostingCustomDomainArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering HostingCustomDomain resources. */ export interface HostingCustomDomainState { /** * 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`. */ certPreference?: pulumi.Input; /** * 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. */ certs?: pulumi.Input[]>; /** * The `CustomDomain`'s create time. */ createTime?: pulumi.Input; /** * The ID of the `CustomDomain`, which is the domain name you'd like to use with Firebase Hosting. */ customDomain?: pulumi.Input; /** * 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. */ deleteTime?: pulumi.Input; /** * A string that represents the current state of the `CustomDomain` and * allows you to confirm its initial state in requests that would modify it. */ etag?: pulumi.Input; /** * The minimum time before a soft-deleted `CustomDomain` is completely removed * from Hosting; null for `CustomDomains` that haven't been deleted. */ expireTime?: pulumi.Input; /** * 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. */ hostState?: pulumi.Input; /** * 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. */ issues?: pulumi.Input[]>; /** * The fully-qualified name of the `CustomDomain`. */ name?: pulumi.Input; /** * 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. */ ownershipState?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * if true, indicates that Hosting's systems are attempting 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 `certPreference` */ reconciling?: pulumi.Input; /** * 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 `redirectTarget` * instead. */ redirectTarget?: pulumi.Input; /** * 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. */ requiredDnsUpdates?: pulumi.Input[]>; /** * The ID of the site in which to create this custom domain association. */ siteId?: pulumi.Input; /** * The last time the `CustomDomain` was updated. */ updateTime?: pulumi.Input; waitDnsVerification?: pulumi.Input; } /** * The set of arguments for constructing a HostingCustomDomain resource. */ export interface HostingCustomDomainArgs { /** * 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`. */ certPreference?: pulumi.Input; /** * The ID of the `CustomDomain`, which is the domain name you'd like to use with Firebase Hosting. */ customDomain: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * 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 `redirectTarget` * instead. */ redirectTarget?: pulumi.Input; /** * The ID of the site in which to create this custom domain association. */ siteId: pulumi.Input; waitDnsVerification?: pulumi.Input; }