UNPKG

@lbrlabs/pulumi-scaleway

Version:

A Pulumi package for creating and managing scaleway cloud resources.

119 lines 4.86 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"); /** * Creates and manages Scaleway Container domain name bindings. * You can check our [containers guide](https://www.scaleway.com/en/docs/compute/containers/how-to/add-a-custom-domain-to-a-container/) for further information. * * ## Example Usage * ### Simple * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * * const appContainer = new scaleway.Container("appContainer", {}); * const appContainerDomain = new scaleway.ContainerDomain("appContainerDomain", { * containerId: appContainer.id, * hostname: "container.domain.tld", * }); * ``` * ### Complete example with domain * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * * const main = new scaleway.ContainerNamespace("main", {description: "test container"}); * const appContainer = new scaleway.Container("appContainer", { * 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 appDomainRecord = new scaleway.DomainRecord("appDomainRecord", { * dnsZone: "domain.tld", * type: "CNAME", * data: pulumi.interpolate`${appContainer.domainName}.`, * ttl: 3600, * }); * const appContainerDomain = new scaleway.ContainerDomain("appContainerDomain", { * containerId: appContainer.id, * hostname: pulumi.interpolate`${appDomainRecord.name}.${appDomainRecord.dnsZone}`, * }); * ``` * * ## Import * * Container domain binding can be imported using the `{region}/{id}`, e.g. bash * * ```sh * $ pulumi import scaleway:index/containerDomain:ContainerDomain main fr-par/11111111-1111-1111-1111-111111111111 * ``` */ 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) { 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; } constructor(name, argsOrState, opts) { 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