UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

200 lines • 8.56 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.HostingCustomDomain = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * ## 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}} * ``` */ 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, id, state, opts) { return new HostingCustomDomain(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === HostingCustomDomain.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["certPreference"] = state ? state.certPreference : undefined; resourceInputs["certs"] = state ? state.certs : undefined; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["customDomain"] = state ? state.customDomain : undefined; resourceInputs["deleteTime"] = state ? state.deleteTime : undefined; resourceInputs["etag"] = state ? state.etag : undefined; resourceInputs["expireTime"] = state ? state.expireTime : undefined; resourceInputs["hostState"] = state ? state.hostState : undefined; resourceInputs["issues"] = state ? state.issues : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["ownershipState"] = state ? state.ownershipState : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["reconciling"] = state ? state.reconciling : undefined; resourceInputs["redirectTarget"] = state ? state.redirectTarget : undefined; resourceInputs["requiredDnsUpdates"] = state ? state.requiredDnsUpdates : undefined; resourceInputs["siteId"] = state ? state.siteId : undefined; resourceInputs["updateTime"] = state ? state.updateTime : undefined; resourceInputs["waitDnsVerification"] = state ? state.waitDnsVerification : undefined; } else { const args = argsOrState; if ((!args || args.customDomain === undefined) && !opts.urn) { throw new Error("Missing required property 'customDomain'"); } if ((!args || args.siteId === undefined) && !opts.urn) { throw new Error("Missing required property 'siteId'"); } resourceInputs["certPreference"] = args ? args.certPreference : undefined; resourceInputs["customDomain"] = args ? args.customDomain : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["redirectTarget"] = args ? args.redirectTarget : undefined; resourceInputs["siteId"] = args ? args.siteId : undefined; resourceInputs["waitDnsVerification"] = args ? args.waitDnsVerification : undefined; resourceInputs["certs"] = undefined /*out*/; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["deleteTime"] = undefined /*out*/; resourceInputs["etag"] = undefined /*out*/; resourceInputs["expireTime"] = undefined /*out*/; resourceInputs["hostState"] = undefined /*out*/; resourceInputs["issues"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["ownershipState"] = undefined /*out*/; resourceInputs["reconciling"] = undefined /*out*/; resourceInputs["requiredDnsUpdates"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(HostingCustomDomain.__pulumiType, name, resourceInputs, opts); } } exports.HostingCustomDomain = HostingCustomDomain; /** @internal */ HostingCustomDomain.__pulumiType = 'gcp:firebase/hostingCustomDomain:HostingCustomDomain'; //# sourceMappingURL=hostingCustomDomain.js.map