@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
140 lines • 7.19 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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomModel = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = aws.bedrockfoundation.getModel({
* modelId: "amazon.titan-text-express-v1",
* });
* const exampleCustomModel = new aws.bedrock.CustomModel("example", {
* customModelName: "example-model",
* jobName: "example-job-1",
* baseModelIdentifier: example.then(example => example.modelArn),
* roleArn: exampleAwsIamRole.arn,
* hyperparameters: {
* epochCount: "1",
* batchSize: "1",
* learningRate: "0.005",
* learningRateWarmupSteps: "0",
* },
* outputDataConfig: {
* s3Uri: `s3://${output.id}/data/`,
* },
* trainingDataConfig: {
* s3Uri: `s3://${training.id}/data/train.jsonl`,
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Bedrock custom model using the `job_arn`. For example:
*
* ```sh
* $ pulumi import aws:bedrock/customModel:CustomModel example arn:aws:bedrock:us-west-2:123456789012:model-customization-job/amazon.titan-text-express-v1:0:8k/1y5n57gh5y2e
* ```
*/
class CustomModel extends pulumi.CustomResource {
/**
* Get an existing CustomModel 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 CustomModel(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of CustomModel. 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'] === CustomModel.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["baseModelIdentifier"] = state ? state.baseModelIdentifier : undefined;
resourceInputs["customModelArn"] = state ? state.customModelArn : undefined;
resourceInputs["customModelKmsKeyId"] = state ? state.customModelKmsKeyId : undefined;
resourceInputs["customModelName"] = state ? state.customModelName : undefined;
resourceInputs["customizationType"] = state ? state.customizationType : undefined;
resourceInputs["hyperparameters"] = state ? state.hyperparameters : undefined;
resourceInputs["jobArn"] = state ? state.jobArn : undefined;
resourceInputs["jobName"] = state ? state.jobName : undefined;
resourceInputs["jobStatus"] = state ? state.jobStatus : undefined;
resourceInputs["outputDataConfig"] = state ? state.outputDataConfig : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["roleArn"] = state ? state.roleArn : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["timeouts"] = state ? state.timeouts : undefined;
resourceInputs["trainingDataConfig"] = state ? state.trainingDataConfig : undefined;
resourceInputs["trainingMetrics"] = state ? state.trainingMetrics : undefined;
resourceInputs["validationDataConfig"] = state ? state.validationDataConfig : undefined;
resourceInputs["validationMetrics"] = state ? state.validationMetrics : undefined;
resourceInputs["vpcConfig"] = state ? state.vpcConfig : undefined;
}
else {
const args = argsOrState;
if ((!args || args.baseModelIdentifier === undefined) && !opts.urn) {
throw new Error("Missing required property 'baseModelIdentifier'");
}
if ((!args || args.customModelName === undefined) && !opts.urn) {
throw new Error("Missing required property 'customModelName'");
}
if ((!args || args.hyperparameters === undefined) && !opts.urn) {
throw new Error("Missing required property 'hyperparameters'");
}
if ((!args || args.jobName === undefined) && !opts.urn) {
throw new Error("Missing required property 'jobName'");
}
if ((!args || args.roleArn === undefined) && !opts.urn) {
throw new Error("Missing required property 'roleArn'");
}
resourceInputs["baseModelIdentifier"] = args ? args.baseModelIdentifier : undefined;
resourceInputs["customModelKmsKeyId"] = args ? args.customModelKmsKeyId : undefined;
resourceInputs["customModelName"] = args ? args.customModelName : undefined;
resourceInputs["customizationType"] = args ? args.customizationType : undefined;
resourceInputs["hyperparameters"] = args ? args.hyperparameters : undefined;
resourceInputs["jobName"] = args ? args.jobName : undefined;
resourceInputs["outputDataConfig"] = args ? args.outputDataConfig : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["roleArn"] = args ? args.roleArn : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["timeouts"] = args ? args.timeouts : undefined;
resourceInputs["trainingDataConfig"] = args ? args.trainingDataConfig : undefined;
resourceInputs["validationDataConfig"] = args ? args.validationDataConfig : undefined;
resourceInputs["vpcConfig"] = args ? args.vpcConfig : undefined;
resourceInputs["customModelArn"] = undefined /*out*/;
resourceInputs["jobArn"] = undefined /*out*/;
resourceInputs["jobStatus"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["trainingMetrics"] = undefined /*out*/;
resourceInputs["validationMetrics"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CustomModel.__pulumiType, name, resourceInputs, opts);
}
}
exports.CustomModel = CustomModel;
/** @internal */
CustomModel.__pulumiType = 'aws:bedrock/customModel:CustomModel';
//# sourceMappingURL=customModel.js.map