UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

136 lines 5.82 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.ContainerDomain = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = 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"; * * const main = new scaleway.containers.Namespace("main", { * name: "my-ns-test", * description: "test container", * }); * const app = new scaleway.containers.Container("app", { * name: "app", * namespaceId: main.id, * registryImage: pulumi.interpolate`${main.registryEndpoint}/nginx:alpine`, * port: 80, * cpuLimit: 140, * memoryLimit: 256, * minScale: 1, * maxScale: 1, * timeout: 600, * maxConcurrency: 80, * privacy: "public", * protocol: "http1", * deploy: true, * }); * const appRecord = new scaleway.domain.Record("app", { * dnsZone: "domain.tld", * name: "subdomain", * type: "CNAME", * data: pulumi.interpolate`${app.domainName}.`, * 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: * * bash * * ```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, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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 ? state.containerId : undefined; resourceInputs["hostname"] = state ? state.hostname : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["url"] = state ? state.url : undefined; } else { const args = argsOrState; if ((!args || args.containerId === undefined) && !opts.urn) { throw new Error("Missing required property 'containerId'"); } if ((!args || args.hostname === undefined) && !opts.urn) { throw new Error("Missing required property 'hostname'"); } resourceInputs["containerId"] = args ? args.containerId : undefined; resourceInputs["hostname"] = args ? args.hostname : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["url"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ContainerDomain.__pulumiType, name, resourceInputs, opts); } } exports.ContainerDomain = ContainerDomain; /** @internal */ ContainerDomain.__pulumiType = 'scaleway:index/containerDomain:ContainerDomain'; //# sourceMappingURL=containerDomain.js.map