UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

154 lines 6.59 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.ContainerDomain = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("./utilities")); /** * The `scaleway.containers.Domain` resource allows you to create and manage domain name bindings for Scaleway [Serverless Containers](https://www.scaleway.com/en/docs/serverless/containers/). * * Refer to the Containers domain [documentation](https://www.scaleway.com/en/docs/serverless-containers/how-to/add-a-custom-domain-to-a-container/) and the [API documentation](https://www.scaleway.com/en/developers/api/serverless-containers/#path-domains-list-all-domain-name-bindings) for more information. * * ## Example Usage * * The commands below shows how to bind a custom domain name to a container. * * ### Simple * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const app = new scaleway.containers.Container("app", {}); * const appDomain = new scaleway.containers.Domain("app", { * containerId: app.id, * hostname: "container.domain.tld", * }); * ``` * * ### Complete example with domain * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * import * as std from "@pulumi/std"; * * const main = new scaleway.containers.Namespace("main", {}); * const app = new scaleway.containers.Container("app", { * name: "app", * namespaceId: main.id, * image: "nginx:latest", * port: 80, * privacy: "public", * protocol: "http1", * }); * const appRecord = new scaleway.domain.Record("app", { * dnsZone: "scaleway-terraform.com", * name: "subdomain", * type: "CNAME", * data: std.format({ * input: "%s.", * args: [std.trimprefix({ * input: app.publicEndpoint, * prefix: "https://", * }).result], * }).result, * ttl: 3600, * }); * const appDomain = new scaleway.containers.Domain("app", { * containerId: app.id, * hostname: pulumi.interpolate`${appRecord.name}.${appRecord.dnsZone}`, * }); * ``` * * ## Import * * Container domain binding can be imported using `{region}/{id}`, as shown below: * * ```sh * $ pulumi import scaleway:index/containerDomain:ContainerDomain main fr-par/11111111-1111-1111-1111-111111111111 * ``` * * @deprecated scaleway.index/containerdomain.ContainerDomain has been deprecated in favor of scaleway.containers/domain.Domain */ class ContainerDomain extends pulumi.CustomResource { /** * Get an existing ContainerDomain 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) { pulumi.log.warn("ContainerDomain is deprecated: scaleway.index/containerdomain.ContainerDomain has been deprecated in favor of scaleway.containers/domain.Domain"); return new ContainerDomain(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'scaleway:index/containerDomain:ContainerDomain'; /** * Returns true if the given object is an instance of ContainerDomain. 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'] === ContainerDomain.__pulumiType; } /** @deprecated scaleway.index/containerdomain.ContainerDomain has been deprecated in favor of scaleway.containers/domain.Domain */ constructor(name, argsOrState, opts) { pulumi.log.warn("ContainerDomain is deprecated: scaleway.index/containerdomain.ContainerDomain has been deprecated in favor of scaleway.containers/domain.Domain"); let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["containerId"] = state?.containerId; resourceInputs["hostname"] = state?.hostname; resourceInputs["region"] = state?.region; resourceInputs["url"] = state?.url; } else { const args = argsOrState; if (args?.containerId === undefined && !opts.urn) { throw new Error("Missing required property 'containerId'"); } if (args?.hostname === undefined && !opts.urn) { throw new Error("Missing required property 'hostname'"); } resourceInputs["containerId"] = args?.containerId; resourceInputs["hostname"] = args?.hostname; resourceInputs["region"] = args?.region; resourceInputs["url"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ContainerDomain.__pulumiType, name, resourceInputs, opts); } } exports.ContainerDomain = ContainerDomain; //# sourceMappingURL=containerDomain.js.map