import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages an Amazon Bedrock custom model. * Model customization is the process of providing training data to a base model in order to improve its performance for specific use-cases. * * This Terraform resource interacts with two Amazon Bedrock entities: * * 1. A Continued Pre-training or Fine-tuning job which is started when the Terraform resource is created. The customization job can take several hours to run to completion. The duration of the job depends on the size of the training data (number of records, input tokens, and output tokens), and [hyperparameters](https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models-hp.html) (number of epochs, and batch size). * 2. The custom model output on successful completion of the customization job. * * This resource's behaviors correspond to operations on these Amazon Bedrock entities: * * * _Create_ starts the customization job and immediately returns. * * _Read_ returns the status and results of the customization job. If the customization job has completed, the output model's properties are returned. * * _Update_ updates the customization job's [tags](https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html). * * _Delete_ stops the customization job if it is still active. If the customization job has completed, the custom model output by the job is deleted. * * ## 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", { * outputDataConfig: { * s3Uri: `s3://${output.id}/data/`, * }, * trainingDataConfig: { * s3Uri: `s3://${training.id}/data/train.jsonl`, * }, * 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", * }, * }); * ``` * * ## Import * * ### Identity Schema * * #### Required * * - `jobArn` (String) ARN of the Bedrock custom model job. * * Using `pulumi import`, import Bedrock custom model using the `jobArn`. 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 * ``` */ export declare 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: string, id: pulumi.Input, state?: CustomModelState, opts?: pulumi.CustomResourceOptions): CustomModel; /** * 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: any): obj is CustomModel; /** * ARN of the base model. */ readonly baseModelIdentifier: pulumi.Output; /** * ARN of the output model. */ readonly customModelArn: pulumi.Output; /** * Key ARN used to encrypt the custom model at rest. */ readonly customModelKmsKeyId: pulumi.Output; /** * Name for the custom model. */ readonly customModelName: pulumi.Output; /** * Customization type. Valid values: `FINE_TUNING`, `CONTINUED_PRE_TRAINING`. */ readonly customizationType: pulumi.Output; /** * [Parameters](https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models-hp.html) related to tuning the model. */ readonly hyperparameters: pulumi.Output<{ [key: string]: string; }>; /** * ARN of the customization job. */ readonly jobArn: pulumi.Output; /** * Name for the customization job. */ readonly jobName: pulumi.Output; /** * Status of the customization job. A successful job transitions from `InProgress` to `Completed` when the output model is ready to use. */ readonly jobStatus: pulumi.Output; /** * S3 location for the output data. See `outputDataConfig` below. */ readonly outputDataConfig: pulumi.Output; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output; /** * ARN of an IAM role that Bedrock can assume to perform tasks on your behalf. */ readonly roleArn: pulumi.Output; /** * Map of tags to assign to the customization job and custom model. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. */ readonly tagsAll: pulumi.Output<{ [key: string]: string; }>; readonly timeouts: pulumi.Output; /** * Information about the training dataset. See `trainingDataConfig` below. */ readonly trainingDataConfig: pulumi.Output; /** * Metrics associated with the customization job. */ readonly trainingMetrics: pulumi.Output; /** * Information about the validation dataset. See `validationDataConfig` below. */ readonly validationDataConfig: pulumi.Output; /** * Loss metric for each validator that you provided. */ readonly validationMetrics: pulumi.Output; /** * Configuration parameters for the private VPC that contains the resources you are using for this job. See `vpcConfig` below. */ readonly vpcConfig: pulumi.Output; /** * Create a CustomModel resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: CustomModelArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering CustomModel resources. */ export interface CustomModelState { /** * ARN of the base model. */ baseModelIdentifier?: pulumi.Input; /** * ARN of the output model. */ customModelArn?: pulumi.Input; /** * Key ARN used to encrypt the custom model at rest. */ customModelKmsKeyId?: pulumi.Input; /** * Name for the custom model. */ customModelName?: pulumi.Input; /** * Customization type. Valid values: `FINE_TUNING`, `CONTINUED_PRE_TRAINING`. */ customizationType?: pulumi.Input; /** * [Parameters](https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models-hp.html) related to tuning the model. */ hyperparameters?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * ARN of the customization job. */ jobArn?: pulumi.Input; /** * Name for the customization job. */ jobName?: pulumi.Input; /** * Status of the customization job. A successful job transitions from `InProgress` to `Completed` when the output model is ready to use. */ jobStatus?: pulumi.Input; /** * S3 location for the output data. See `outputDataConfig` below. */ outputDataConfig?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * ARN of an IAM role that Bedrock can assume to perform tasks on your behalf. */ roleArn?: pulumi.Input; /** * Map of tags to assign to the customization job and custom model. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. */ tagsAll?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; timeouts?: pulumi.Input; /** * Information about the training dataset. See `trainingDataConfig` below. */ trainingDataConfig?: pulumi.Input; /** * Metrics associated with the customization job. */ trainingMetrics?: pulumi.Input[] | undefined>; /** * Information about the validation dataset. See `validationDataConfig` below. */ validationDataConfig?: pulumi.Input; /** * Loss metric for each validator that you provided. */ validationMetrics?: pulumi.Input[] | undefined>; /** * Configuration parameters for the private VPC that contains the resources you are using for this job. See `vpcConfig` below. */ vpcConfig?: pulumi.Input; } /** * The set of arguments for constructing a CustomModel resource. */ export interface CustomModelArgs { /** * ARN of the base model. */ baseModelIdentifier: pulumi.Input; /** * Key ARN used to encrypt the custom model at rest. */ customModelKmsKeyId?: pulumi.Input; /** * Name for the custom model. */ customModelName: pulumi.Input; /** * Customization type. Valid values: `FINE_TUNING`, `CONTINUED_PRE_TRAINING`. */ customizationType?: pulumi.Input; /** * [Parameters](https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models-hp.html) related to tuning the model. */ hyperparameters: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Name for the customization job. */ jobName: pulumi.Input; /** * S3 location for the output data. See `outputDataConfig` below. */ outputDataConfig: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * ARN of an IAM role that Bedrock can assume to perform tasks on your behalf. */ roleArn: pulumi.Input; /** * Map of tags to assign to the customization job and custom model. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; timeouts?: pulumi.Input; /** * Information about the training dataset. See `trainingDataConfig` below. */ trainingDataConfig: pulumi.Input; /** * Information about the validation dataset. See `validationDataConfig` below. */ validationDataConfig?: pulumi.Input; /** * Configuration parameters for the private VPC that contains the resources you are using for this job. See `vpcConfig` below. */ vpcConfig?: pulumi.Input; } //# sourceMappingURL=customModel.d.ts.map