@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
130 lines • 5.67 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.Model = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* The scaleway.inference.Model resource allows you to upload and manage inference models in the Scaleway Inference ecosystem. Once registered, a model can be used in any scaleway.inference.Deployment resource.
*
* ## Example Usage
*
* ### Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const test = new scaleway.inference.Model("test", {
* name: "my-awesome-model",
* url: "https://huggingface.co/agentica-org/DeepCoder-14B-Preview",
* secret: "my-secret-token",
* });
* ```
*
* ### Deploy your own model on your managed inference
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const myModel = new scaleway.inference.Model("my_model", {
* name: "my-awesome-model",
* url: "https://huggingface.co/agentica-org/DeepCoder-14B-Preview",
* secret: "my-secret-token",
* });
* const myDeployment = new scaleway.inference.Deployment("my_deployment", {
* name: "test-inference-deployment-basic",
* nodeType: "H100",
* modelId: myModel.id,
* publicEndpoint: {
* isEnabled: true,
* },
* acceptEula: true,
* });
* ```
*
* ## Import
*
* Models can be imported using, `{region}/{id}`, as shown below:
*
* bash
*
* ```sh
* $ pulumi import scaleway:inference/model:Model my_model fr-par/11111111-1111-1111-1111-111111111111
* ```
*/
class Model extends pulumi.CustomResource {
/**
* Get an existing Model 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 Model(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Model. 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'] === Model.__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["hasEula"] = state ? state.hasEula : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["nodesSupports"] = state ? state.nodesSupports : undefined;
resourceInputs["parameterSizeBits"] = state ? state.parameterSizeBits : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["secret"] = state ? state.secret : undefined;
resourceInputs["sizeBytes"] = state ? state.sizeBytes : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
resourceInputs["url"] = state ? state.url : undefined;
}
else {
const args = argsOrState;
if ((!args || args.url === undefined) && !opts.urn) {
throw new Error("Missing required property 'url'");
}
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["secret"] = (args === null || args === void 0 ? void 0 : args.secret) ? pulumi.secret(args.secret) : undefined;
resourceInputs["url"] = args ? args.url : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["description"] = undefined /*out*/;
resourceInputs["hasEula"] = undefined /*out*/;
resourceInputs["nodesSupports"] = undefined /*out*/;
resourceInputs["parameterSizeBits"] = undefined /*out*/;
resourceInputs["sizeBytes"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["tags"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["secret"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Model.__pulumiType, name, resourceInputs, opts);
}
}
exports.Model = Model;
/** @internal */
Model.__pulumiType = 'scaleway:inference/model:Model';
//# sourceMappingURL=model.js.map