UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

148 lines 6.12 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.IpMacAddress = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Creates and manages Scaleway Flexible IP Mac Addresses. * For more information, see the [API documentation](https://www.scaleway.com/en/developers/api/elastic-metal-flexible-ip/). * * ## Example Usage * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const main = new scaleway.elasticmetal.Ip("main", {}); * const mainIpMacAddress = new scaleway.elasticmetal.IpMacAddress("main", { * flexibleIpId: main.id, * type: "kvm", * }); * ``` * * ### Duplicate on many other flexible IPs * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const myOffer = scaleway.elasticmetal.getOffer({ * name: "EM-B112X-SSD", * }); * const base = new scaleway.elasticmetal.Server("base", { * name: "TestAccScalewayBaremetalServer_WithoutInstallConfig", * offer: myOffer.then(myOffer => myOffer.offerId), * installConfigAfterward: true, * }); * const ip01 = new scaleway.elasticmetal.Ip("ip01", {serverId: base.id}); * const ip02 = new scaleway.elasticmetal.Ip("ip02", {serverId: base.id}); * const ip03 = new scaleway.elasticmetal.Ip("ip03", {serverId: base.id}); * const main = new scaleway.elasticmetal.IpMacAddress("main", { * flexibleIpId: ip01.id, * type: "kvm", * flexibleIpIdsToDuplicates: [ * ip02.id, * ip03.id, * ], * }); * ``` * * ## Import * * Flexible IP Mac Addresses can be imported using the `{zone}/{id}`, e.g. * * ```sh * $ pulumi import scaleway:elasticmetal/ipMacAddress:IpMacAddress main fr-par-1/11111111-1111-1111-1111-111111111111 * ``` */ class IpMacAddress extends pulumi.CustomResource { /** * Get an existing IpMacAddress 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 IpMacAddress(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'scaleway:elasticmetal/ipMacAddress:IpMacAddress'; /** * Returns true if the given object is an instance of IpMacAddress. 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'] === IpMacAddress.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["address"] = state?.address; resourceInputs["createdAt"] = state?.createdAt; resourceInputs["flexibleIpId"] = state?.flexibleIpId; resourceInputs["flexibleIpIdsToDuplicates"] = state?.flexibleIpIdsToDuplicates; resourceInputs["status"] = state?.status; resourceInputs["type"] = state?.type; resourceInputs["updatedAt"] = state?.updatedAt; resourceInputs["zone"] = state?.zone; } else { const args = argsOrState; if (args?.flexibleIpId === undefined && !opts.urn) { throw new Error("Missing required property 'flexibleIpId'"); } if (args?.type === undefined && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["flexibleIpId"] = args?.flexibleIpId; resourceInputs["flexibleIpIdsToDuplicates"] = args?.flexibleIpIdsToDuplicates; resourceInputs["type"] = args?.type; resourceInputs["zone"] = args?.zone; resourceInputs["address"] = undefined /*out*/; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const aliasOpts = { aliases: [{ type: "scaleway:index/flexibleIpMacAddress:FlexibleIpMacAddress" }] }; opts = pulumi.mergeOptions(opts, aliasOpts); super(IpMacAddress.__pulumiType, name, resourceInputs, opts); } } exports.IpMacAddress = IpMacAddress; //# sourceMappingURL=ipMacAddress.js.map