@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
133 lines • 6.34 kB
JavaScript
;
// *** 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.InstanceImage = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = 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,
* });
* ```
*
* ## Import
*
* Images can be imported using the `{zone}/{id}`, e.g.
*
* bash
*
* ```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, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* 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 ? state.additionalVolumeIds : undefined;
resourceInputs["additionalVolumes"] = state ? state.additionalVolumes : undefined;
resourceInputs["architecture"] = state ? state.architecture : undefined;
resourceInputs["creationDate"] = state ? state.creationDate : undefined;
resourceInputs["fromServerId"] = state ? state.fromServerId : undefined;
resourceInputs["modificationDate"] = state ? state.modificationDate : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["organizationId"] = state ? state.organizationId : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["public"] = state ? state.public : undefined;
resourceInputs["rootVolumeId"] = state ? state.rootVolumeId : undefined;
resourceInputs["state"] = state ? state.state : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["zone"] = state ? state.zone : undefined;
}
else {
const args = argsOrState;
if ((!args || args.rootVolumeId === undefined) && !opts.urn) {
throw new Error("Missing required property 'rootVolumeId'");
}
resourceInputs["additionalVolumeIds"] = args ? args.additionalVolumeIds : undefined;
resourceInputs["architecture"] = args ? args.architecture : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["public"] = args ? args.public : undefined;
resourceInputs["rootVolumeId"] = args ? args.rootVolumeId : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["zone"] = args ? args.zone : undefined;
resourceInputs["additionalVolumes"] = undefined /*out*/;
resourceInputs["creationDate"] = undefined /*out*/;
resourceInputs["fromServerId"] = undefined /*out*/;
resourceInputs["modificationDate"] = undefined /*out*/;
resourceInputs["organizationId"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(InstanceImage.__pulumiType, name, resourceInputs, opts);
}
}
exports.InstanceImage = InstanceImage;
/** @internal */
InstanceImage.__pulumiType = 'scaleway:index/instanceImage:InstanceImage';
//# sourceMappingURL=instanceImage.js.map