@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
179 lines • 7.85 kB
JavaScript
;
// *** 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.InstanceImage = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
* Creates and manages Scaleway Compute Images.
* For more information, see the [API documentation](https://www.scaleway.com/en/developers/api/instance/#path-images-list-instance-images).
*
* ## Example Usage
*
* ### From a volume
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const volume = new scaleway.instance.Volume("volume", {
* type: "b_ssd",
* sizeInGb: 20,
* });
* const volumeSnapshot = new scaleway.instance.Snapshot("volume_snapshot", {volumeId: volume.id});
* const volumeImage = new scaleway.instance.Image("volume_image", {
* name: "image_from_volume",
* rootVolumeId: volumeSnapshot.id,
* });
* ```
*
* ### From a server
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const server = new scaleway.instance.Server("server", {
* image: "ubuntu_jammy",
* type: "DEV1-S",
* });
* const serverSnapshot = new scaleway.instance.Snapshot("server_snapshot", {volumeId: main.rootVolume[0].volumeId});
* const serverImage = new scaleway.instance.Image("server_image", {
* name: "image_from_server",
* rootVolumeId: serverSnapshot.id,
* });
* ```
*
* ### With additional volumes
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const server = new scaleway.instance.Server("server", {
* image: "ubuntu_jammy",
* type: "DEV1-S",
* });
* const volume = new scaleway.instance.Volume("volume", {
* type: "b_ssd",
* sizeInGb: 20,
* });
* const volumeSnapshot = new scaleway.instance.Snapshot("volume_snapshot", {volumeId: volume.id});
* const serverSnapshot = new scaleway.instance.Snapshot("server_snapshot", {volumeId: main.rootVolume[0].volumeId});
* const image = new scaleway.instance.Image("image", {
* name: "image_with_extra_volumes",
* rootVolumeId: serverSnapshot.id,
* additionalVolumeIds: [volumeSnapshot.id],
* });
* ```
*
* ## Import
*
* Images can be imported using the `{zone}/{id}`, e.g.
*
* ```sh
* $ pulumi import scaleway:index/instanceImage:InstanceImage main fr-par-1/11111111-1111-1111-1111-111111111111
* ```
*
* @deprecated scaleway.index/instanceimage.InstanceImage has been deprecated in favor of scaleway.instance/image.Image
*/
class InstanceImage extends pulumi.CustomResource {
/**
* Get an existing InstanceImage 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("InstanceImage is deprecated: scaleway.index/instanceimage.InstanceImage has been deprecated in favor of scaleway.instance/image.Image");
return new InstanceImage(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'scaleway:index/instanceImage:InstanceImage';
/**
* Returns true if the given object is an instance of InstanceImage. 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'] === InstanceImage.__pulumiType;
}
/** @deprecated scaleway.index/instanceimage.InstanceImage has been deprecated in favor of scaleway.instance/image.Image */
constructor(name, argsOrState, opts) {
pulumi.log.warn("InstanceImage is deprecated: scaleway.index/instanceimage.InstanceImage has been deprecated in favor of scaleway.instance/image.Image");
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["additionalVolumeIds"] = state?.additionalVolumeIds;
resourceInputs["additionalVolumes"] = state?.additionalVolumes;
resourceInputs["architecture"] = state?.architecture;
resourceInputs["creationDate"] = state?.creationDate;
resourceInputs["fromServerId"] = state?.fromServerId;
resourceInputs["modificationDate"] = state?.modificationDate;
resourceInputs["name"] = state?.name;
resourceInputs["organizationId"] = state?.organizationId;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["public"] = state?.public;
resourceInputs["rootVolumeId"] = state?.rootVolumeId;
resourceInputs["rootVolumes"] = state?.rootVolumes;
resourceInputs["state"] = state?.state;
resourceInputs["tags"] = state?.tags;
resourceInputs["zone"] = state?.zone;
}
else {
const args = argsOrState;
if (args?.rootVolumeId === undefined && !opts.urn) {
throw new Error("Missing required property 'rootVolumeId'");
}
resourceInputs["additionalVolumeIds"] = args?.additionalVolumeIds;
resourceInputs["architecture"] = args?.architecture;
resourceInputs["name"] = args?.name;
resourceInputs["projectId"] = args?.projectId;
resourceInputs["public"] = args?.public;
resourceInputs["rootVolumeId"] = args?.rootVolumeId;
resourceInputs["tags"] = args?.tags;
resourceInputs["zone"] = args?.zone;
resourceInputs["additionalVolumes"] = undefined /*out*/;
resourceInputs["creationDate"] = undefined /*out*/;
resourceInputs["fromServerId"] = undefined /*out*/;
resourceInputs["modificationDate"] = undefined /*out*/;
resourceInputs["organizationId"] = undefined /*out*/;
resourceInputs["rootVolumes"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(InstanceImage.__pulumiType, name, resourceInputs, opts);
}
}
exports.InstanceImage = InstanceImage;
//# sourceMappingURL=instanceImage.js.map