UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

193 lines 8.19 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.Registration = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * The `scaleway.domain.Registration` resource allows you to purchase and manage domain registrations with Scaleway. Using this resource you can register one or more domains for a specified duration, configure auto-renewal and DNSSEC options, and set contact information. You can supply an owner contact either by providing an existing contact ID or by specifying the complete contact details. The resource automatically returns additional contact information (administrative and technical) as provided by the Scaleway API. * * Refer to the [Domains and DNS documentation](https://www.scaleway.com/en/docs/network/domains-and-dns/) and the [API documentation](https://developers.scaleway.com/) for more details. * * ## Example Usage * * ### Purchase a Single Domain * * The following example purchases a domain with a one-year registration period and specifies the owner contact details. Administrative and technical contacts are returned by the API. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const test = new scaleway.domain.Registration("test", { * domainNames: ["example.com"], * durationInYears: 1, * ownerContact: { * legalForm: "individual", * firstname: "John", * lastname: "DOE", * email: "john.doe@example.com", * phoneNumber: "+1.23456789", * addressLine1: "123 Main Street", * city: "Paris", * zip: "75001", * country: "FR", * vatIdentificationCode: "FR12345678901", * companyIdentificationCode: "123456789", * }, * }); * ``` * * ### Update Domain Settings * * You can update the resource to enable auto-renewal and DNSSEC: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const test = new scaleway.domain.Registration("test", { * domainNames: ["example.com"], * durationInYears: 1, * ownerContact: { * legalForm: "individual", * firstname: "John", * lastname: "DOE", * email: "john.doe@example.com", * phoneNumber: "+1.23456789", * addressLine1: "123 Main Street", * city: "Paris", * zip: "75001", * country: "FR", * vatIdentificationCode: "FR12345678901", * companyIdentificationCode: "123456789", * }, * autoRenew: true, * dnssec: true, * }); * ``` * * ### Purchase Multiple Domains * * The following example registers several domains in one go: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const multi = new scaleway.domain.Registration("multi", { * domainNames: [ * "domain1.com", * "domain2.com", * "domain3.com", * ], * durationInYears: 1, * ownerContact: { * legalForm: "individual", * firstname: "John", * lastname: "DOE", * email: "john.doe@example.com", * phoneNumber: "+1.23456789", * addressLine1: "123 Main Street", * city: "Paris", * zip: "75001", * country: "FR", * vatIdentificationCode: "FR12345678901", * companyIdentificationCode: "123456789", * }, * }); * ``` * * ## Contact Blocks * * Each contact block supports the following attributes: * * - `legalForm` (Required, String): Legal form of the contact. * - `firstname` (Required, String): First name. * - `lastname` (Required, String): Last name. * - `companyName` (Optional, String): Company name. * - `email` (Required, String): Primary email. * - `phoneNumber` (Required, String): Primary phone number. * - `addressLine1` (Required, String): Primary address. * - `zip` (Required, String): Postal code. * - `city` (Required, String): City. * - `country` (Required, String): Country code (ISO format). * - `vatIdentificationCode` (Required, String): VAT identification code. * - `companyIdentificationCode` (Required, String): Company identification code. * * ## Import * * To import an existing domain registration, use: * * bash * * ```sh * $ pulumi import scaleway:domain/registration:Registration test <project_id>/<task_id> * ``` */ 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, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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["administrativeContacts"] = state ? state.administrativeContacts : undefined; resourceInputs["autoRenew"] = state ? state.autoRenew : undefined; resourceInputs["dnssec"] = state ? state.dnssec : undefined; resourceInputs["domainNames"] = state ? state.domainNames : undefined; resourceInputs["dsRecords"] = state ? state.dsRecords : undefined; resourceInputs["durationInYears"] = state ? state.durationInYears : undefined; resourceInputs["ownerContact"] = state ? state.ownerContact : undefined; resourceInputs["ownerContactId"] = state ? state.ownerContactId : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["taskId"] = state ? state.taskId : undefined; resourceInputs["technicalContacts"] = state ? state.technicalContacts : undefined; } else { const args = argsOrState; if ((!args || args.domainNames === undefined) && !opts.urn) { throw new Error("Missing required property 'domainNames'"); } resourceInputs["autoRenew"] = args ? args.autoRenew : undefined; resourceInputs["dnssec"] = args ? args.dnssec : undefined; resourceInputs["domainNames"] = args ? args.domainNames : undefined; resourceInputs["durationInYears"] = args ? args.durationInYears : undefined; resourceInputs["ownerContact"] = args ? args.ownerContact : undefined; resourceInputs["ownerContactId"] = args ? args.ownerContactId : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["administrativeContacts"] = undefined /*out*/; resourceInputs["dsRecords"] = undefined /*out*/; resourceInputs["taskId"] = undefined /*out*/; resourceInputs["technicalContacts"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Registration.__pulumiType, name, resourceInputs, opts); } } exports.Registration = Registration; /** @internal */ Registration.__pulumiType = 'scaleway:domain/registration:Registration'; //# sourceMappingURL=registration.js.map