UNPKG

@pulumi/gcp

Version:

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

221 lines • 9.88 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Registration = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Registers a new domain name and creates a corresponding Registration resource. * * To get more information about Registration, see: * * * [API documentation](https://cloud.google.com/domains/docs/reference/rest/v1/projects.locations.registrations) * * How-to Guides * * [Register a domain with Cloud Domains](https://cloud.google.com/domains/docs/buy-register-domain) * * > **Warning:** The Terraform implementation of this resource will not actually delete a Registration during * `terraform destroy`. Instead it will "abandon" the resource and remove it from state. * For information on deleting a registered domain, see https://cloud.google.com/domains/docs/delete-domain * * ## Example Usage * * ### Clouddomains Registration Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const myRegistration = new gcp.clouddomains.Registration("my_registration", { * domainName: "example-domain.com", * location: "global", * labels: { * labelkey: "labelvalue", * }, * yearlyPrice: { * currencyCode: "USD", * units: "12", * }, * dnsSettings: { * customDns: { * nameServers: [ * "ns-cloud-a1.googledomains.com.", * "ns-cloud-a2.googledomains.com.", * "ns-cloud-a3.googledomains.com.", * "ns-cloud-a4.googledomains.com.", * ], * }, * }, * contactSettings: { * privacy: "REDACTED_CONTACT_DATA", * registrantContact: { * phoneNumber: "+12345000000", * email: "user@example.com", * postalAddress: { * regionCode: "US", * postalCode: "95050", * administrativeArea: "CA", * locality: "Example City", * addressLines: ["1234 Example street"], * recipients: ["example recipient"], * }, * }, * adminContact: { * phoneNumber: "+12345000000", * email: "user@example.com", * postalAddress: { * regionCode: "US", * postalCode: "95050", * administrativeArea: "CA", * locality: "Example City", * addressLines: ["1234 Example street"], * recipients: ["example recipient"], * }, * }, * technicalContact: { * phoneNumber: "+12345000000", * email: "user@example.com", * postalAddress: { * regionCode: "US", * postalCode: "95050", * administrativeArea: "CA", * locality: "Example City", * addressLines: ["1234 Example street"], * recipients: ["example recipient"], * }, * }, * }, * }); * ``` * * ## Import * * Registration can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/registrations/{{domain_name}}` * * `{{project}}/{{location}}/{{domain_name}}` * * `{{location}}/{{domain_name}}` * * When using the `pulumi import` command, Registration can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:clouddomains/registration:Registration default projects/{{project}}/locations/{{location}}/registrations/{{domain_name}} * $ pulumi import gcp:clouddomains/registration:Registration default {{project}}/{{location}}/{{domain_name}} * $ pulumi import gcp:clouddomains/registration:Registration default {{location}}/{{domain_name}} * ``` */ class Registration extends pulumi.CustomResource { /** * Get an existing Registration 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 Registration(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:clouddomains/registration:Registration'; /** * Returns true if the given object is an instance of Registration. 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'] === Registration.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["contactNotices"] = state?.contactNotices; resourceInputs["contactSettings"] = state?.contactSettings; resourceInputs["createTime"] = state?.createTime; resourceInputs["dnsSettings"] = state?.dnsSettings; resourceInputs["domainName"] = state?.domainName; resourceInputs["domainNotices"] = state?.domainNotices; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["expireTime"] = state?.expireTime; resourceInputs["issues"] = state?.issues; resourceInputs["labels"] = state?.labels; resourceInputs["location"] = state?.location; resourceInputs["managementSettings"] = state?.managementSettings; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; resourceInputs["pulumiLabels"] = state?.pulumiLabels; resourceInputs["registerFailureReason"] = state?.registerFailureReason; resourceInputs["state"] = state?.state; resourceInputs["supportedPrivacies"] = state?.supportedPrivacies; resourceInputs["yearlyPrice"] = state?.yearlyPrice; } else { const args = argsOrState; if (args?.contactSettings === undefined && !opts.urn) { throw new Error("Missing required property 'contactSettings'"); } if (args?.domainName === undefined && !opts.urn) { throw new Error("Missing required property 'domainName'"); } if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } if (args?.yearlyPrice === undefined && !opts.urn) { throw new Error("Missing required property 'yearlyPrice'"); } resourceInputs["contactNotices"] = args?.contactNotices; resourceInputs["contactSettings"] = args?.contactSettings; resourceInputs["dnsSettings"] = args?.dnsSettings; resourceInputs["domainName"] = args?.domainName; resourceInputs["domainNotices"] = args?.domainNotices; resourceInputs["labels"] = args?.labels; resourceInputs["location"] = args?.location; resourceInputs["managementSettings"] = args?.managementSettings; resourceInputs["project"] = args?.project; resourceInputs["yearlyPrice"] = args?.yearlyPrice; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["expireTime"] = undefined /*out*/; resourceInputs["issues"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["registerFailureReason"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; resourceInputs["supportedPrivacies"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Registration.__pulumiType, name, resourceInputs, opts); } } exports.Registration = Registration; //# sourceMappingURL=registration.js.map