UNPKG

@lbrlabs/pulumi-scaleway

Version:

A Pulumi package for creating and managing scaleway cloud resources.

141 lines 5.74 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.FlexibleIp = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Creates and manages Scaleway flexible IPs. * For more information, see [the documentation](https://developers.scaleway.com/en/products/flexible-ip/api). * * ## Examples * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * * const main = new scaleway.FlexibleIp("main", {reverse: "my-reverse.com"}); * ``` * * ### With zone * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * * const main = new scaleway.FlexibleIp("main", {zone: "fr-par-2"}); * ``` * * ### With IPv6 * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * * const main = new scaleway.FlexibleIp("main", {isIpv6: true}); * ``` * * ### With baremetal server * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * import * as scaleway from "@pulumi/scaleway"; * * const mainAccountSshKey = new scaleway.AccountSshKey("mainAccountSshKey", {publicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILHy/M5FVm5ydLGcal3e5LNcfTalbeN7QL/ZGCvDEdqJ foobar@example.com"}); * const byId = scaleway.getBaremetalOs({ * zone: "fr-par-2", * name: "Ubuntu", * version: "20.04 LTS (Focal Fossa)", * }); * const myOffer = scaleway.getBaremetalOffer({ * zone: "fr-par-2", * name: "EM-A210R-HDD", * }); * const base = new scaleway.BaremetalServer("base", { * zone: "fr-par-2", * offer: myOffer.then(myOffer => myOffer.offerId), * os: byId.then(byId => byId.osId), * sshKeyIds: mainAccountSshKey.id, * }); * const mainFlexibleIp = new scaleway.FlexibleIp("mainFlexibleIp", { * serverId: base.id, * zone: "fr-par-2", * }); * ``` * * ## Import * * Flexible IPs can be imported using the `{zone}/{id}`, e.g. bash * * ```sh * $ pulumi import scaleway:index/flexibleIp:FlexibleIp main fr-par-1/11111111-1111-1111-1111-111111111111 * ``` */ class FlexibleIp extends pulumi.CustomResource { /** * Get an existing FlexibleIp 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 FlexibleIp(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of FlexibleIp. 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'] === FlexibleIp.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["ipAddress"] = state ? state.ipAddress : undefined; resourceInputs["isIpv6"] = state ? state.isIpv6 : undefined; resourceInputs["organizationId"] = state ? state.organizationId : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["reverse"] = state ? state.reverse : undefined; resourceInputs["serverId"] = state ? state.serverId : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["updatedAt"] = state ? state.updatedAt : undefined; resourceInputs["zone"] = state ? state.zone : undefined; } else { const args = argsOrState; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["isIpv6"] = args ? args.isIpv6 : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["reverse"] = args ? args.reverse : undefined; resourceInputs["serverId"] = args ? args.serverId : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["zone"] = args ? args.zone : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["ipAddress"] = undefined /*out*/; resourceInputs["organizationId"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(FlexibleIp.__pulumiType, name, resourceInputs, opts); } } exports.FlexibleIp = FlexibleIp; /** @internal */ FlexibleIp.__pulumiType = 'scaleway:index/flexibleIp:FlexibleIp'; //# sourceMappingURL=flexibleIp.js.map