UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

146 lines 6.59 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! *** 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 * * ### Identity Schema * * #### Required * * - `arn` (String) Amazon Resource Name (ARN) of the Bedrock custom model. * * Using `pulumi import`, import Bedrock custom model using the `job_arn`. For example: * * console * * % pulumi import aws_bedrock_custom_model.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, { ...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?.baseModelIdentifier; resourceInputs["customModelArn"] = state?.customModelArn; resourceInputs["customModelKmsKeyId"] = state?.customModelKmsKeyId; resourceInputs["customModelName"] = state?.customModelName; resourceInputs["customizationType"] = state?.customizationType; resourceInputs["hyperparameters"] = state?.hyperparameters; resourceInputs["jobArn"] = state?.jobArn; resourceInputs["jobName"] = state?.jobName; resourceInputs["jobStatus"] = state?.jobStatus; resourceInputs["outputDataConfig"] = state?.outputDataConfig; resourceInputs["region"] = state?.region; resourceInputs["roleArn"] = state?.roleArn; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["timeouts"] = state?.timeouts; resourceInputs["trainingDataConfig"] = state?.trainingDataConfig; resourceInputs["trainingMetrics"] = state?.trainingMetrics; resourceInputs["validationDataConfig"] = state?.validationDataConfig; resourceInputs["validationMetrics"] = state?.validationMetrics; resourceInputs["vpcConfig"] = state?.vpcConfig; } else { const args = argsOrState; if (args?.baseModelIdentifier === undefined && !opts.urn) { throw new Error("Missing required property 'baseModelIdentifier'"); } if (args?.customModelName === undefined && !opts.urn) { throw new Error("Missing required property 'customModelName'"); } if (args?.hyperparameters === undefined && !opts.urn) { throw new Error("Missing required property 'hyperparameters'"); } if (args?.jobName === undefined && !opts.urn) { throw new Error("Missing required property 'jobName'"); } if (args?.roleArn === undefined && !opts.urn) { throw new Error("Missing required property 'roleArn'"); } resourceInputs["baseModelIdentifier"] = args?.baseModelIdentifier; resourceInputs["customModelKmsKeyId"] = args?.customModelKmsKeyId; resourceInputs["customModelName"] = args?.customModelName; resourceInputs["customizationType"] = args?.customizationType; resourceInputs["hyperparameters"] = args?.hyperparameters; resourceInputs["jobName"] = args?.jobName; resourceInputs["outputDataConfig"] = args?.outputDataConfig; resourceInputs["region"] = args?.region; resourceInputs["roleArn"] = args?.roleArn; resourceInputs["tags"] = args?.tags; resourceInputs["timeouts"] = args?.timeouts; resourceInputs["trainingDataConfig"] = args?.trainingDataConfig; resourceInputs["validationDataConfig"] = args?.validationDataConfig; resourceInputs["vpcConfig"] = args?.vpcConfig; 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