com.pulumi.aws.bedrock.kotlin.CustomModelArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.bedrock.kotlin
import com.pulumi.aws.bedrock.CustomModelArgs.builder
import com.pulumi.aws.bedrock.kotlin.inputs.CustomModelOutputDataConfigArgs
import com.pulumi.aws.bedrock.kotlin.inputs.CustomModelOutputDataConfigArgsBuilder
import com.pulumi.aws.bedrock.kotlin.inputs.CustomModelTimeoutsArgs
import com.pulumi.aws.bedrock.kotlin.inputs.CustomModelTimeoutsArgsBuilder
import com.pulumi.aws.bedrock.kotlin.inputs.CustomModelTrainingDataConfigArgs
import com.pulumi.aws.bedrock.kotlin.inputs.CustomModelTrainingDataConfigArgsBuilder
import com.pulumi.aws.bedrock.kotlin.inputs.CustomModelValidationDataConfigArgs
import com.pulumi.aws.bedrock.kotlin.inputs.CustomModelValidationDataConfigArgsBuilder
import com.pulumi.aws.bedrock.kotlin.inputs.CustomModelVpcConfigArgs
import com.pulumi.aws.bedrock.kotlin.inputs.CustomModelVpcConfigArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* ## 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`,
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.bedrockfoundation.get_model(model_id="amazon.titan-text-express-v1")
* example_custom_model = aws.bedrock.CustomModel("example",
* custom_model_name="example-model",
* job_name="example-job-1",
* base_model_identifier=example.model_arn,
* role_arn=example_aws_iam_role["arn"],
* hyperparameters={
* "epochCount": "1",
* "batchSize": "1",
* "learningRate": "0.005",
* "learningRateWarmupSteps": "0",
* },
* output_data_config={
* "s3_uri": f"s3://{output['id']}/data/",
* },
* training_data_config={
* "s3_uri": f"s3://{training['id']}/data/train.jsonl",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = Aws.BedrockFoundation.GetModel.Invoke(new()
* {
* ModelId = "amazon.titan-text-express-v1",
* });
* var exampleCustomModel = new Aws.Bedrock.CustomModel("example", new()
* {
* CustomModelName = "example-model",
* JobName = "example-job-1",
* BaseModelIdentifier = example.Apply(getModelResult => getModelResult.ModelArn),
* RoleArn = exampleAwsIamRole.Arn,
* Hyperparameters =
* {
* { "epochCount", "1" },
* { "batchSize", "1" },
* { "learningRate", "0.005" },
* { "learningRateWarmupSteps", "0" },
* },
* OutputDataConfig = new Aws.Bedrock.Inputs.CustomModelOutputDataConfigArgs
* {
* S3Uri = $"s3://{output.Id}/data/",
* },
* TrainingDataConfig = new Aws.Bedrock.Inputs.CustomModelTrainingDataConfigArgs
* {
* S3Uri = $"s3://{training.Id}/data/train.jsonl",
* },
* });
* });
* ```
* ```go
* package main
* import (
* "fmt"
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/bedrock"
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/bedrockfoundation"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := bedrockfoundation.GetModel(ctx, &bedrockfoundation.GetModelArgs{
* ModelId: "amazon.titan-text-express-v1",
* }, nil)
* if err != nil {
* return err
* }
* _, err = bedrock.NewCustomModel(ctx, "example", &bedrock.CustomModelArgs{
* CustomModelName: pulumi.String("example-model"),
* JobName: pulumi.String("example-job-1"),
* BaseModelIdentifier: pulumi.String(example.ModelArn),
* RoleArn: pulumi.Any(exampleAwsIamRole.Arn),
* Hyperparameters: pulumi.StringMap{
* "epochCount": pulumi.String("1"),
* "batchSize": pulumi.String("1"),
* "learningRate": pulumi.String("0.005"),
* "learningRateWarmupSteps": pulumi.String("0"),
* },
* OutputDataConfig: &bedrock.CustomModelOutputDataConfigArgs{
* S3Uri: pulumi.Sprintf("s3://%v/data/", output.Id),
* },
* TrainingDataConfig: &bedrock.CustomModelTrainingDataConfigArgs{
* S3Uri: pulumi.Sprintf("s3://%v/data/train.jsonl", training.Id),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.bedrockfoundation.BedrockfoundationFunctions;
* import com.pulumi.aws.bedrockfoundation.inputs.GetModelArgs;
* import com.pulumi.aws.bedrock.CustomModel;
* import com.pulumi.aws.bedrock.CustomModelArgs;
* import com.pulumi.aws.bedrock.inputs.CustomModelOutputDataConfigArgs;
* import com.pulumi.aws.bedrock.inputs.CustomModelTrainingDataConfigArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var example = BedrockfoundationFunctions.getModel(GetModelArgs.builder()
* .modelId("amazon.titan-text-express-v1")
* .build());
* var exampleCustomModel = new CustomModel("exampleCustomModel", CustomModelArgs.builder()
* .customModelName("example-model")
* .jobName("example-job-1")
* .baseModelIdentifier(example.applyValue(getModelResult -> getModelResult.modelArn()))
* .roleArn(exampleAwsIamRole.arn())
* .hyperparameters(Map.ofEntries(
* Map.entry("epochCount", "1"),
* Map.entry("batchSize", "1"),
* Map.entry("learningRate", "0.005"),
* Map.entry("learningRateWarmupSteps", "0")
* ))
* .outputDataConfig(CustomModelOutputDataConfigArgs.builder()
* .s3Uri(String.format("s3://%s/data/", output.id()))
* .build())
* .trainingDataConfig(CustomModelTrainingDataConfigArgs.builder()
* .s3Uri(String.format("s3://%s/data/train.jsonl", training.id()))
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* exampleCustomModel:
* type: aws:bedrock:CustomModel
* name: example
* properties:
* customModelName: example-model
* jobName: example-job-1
* baseModelIdentifier: ${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
* variables:
* example:
* fn::invoke:
* Function: aws:bedrockfoundation:getModel
* Arguments:
* modelId: amazon.titan-text-express-v1
* ```
*
* ## 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
* ```
* @property baseModelIdentifier The Amazon Resource Name (ARN) of the base model.
* @property customModelKmsKeyId The custom model is encrypted at rest using this key. Specify the key ARN.
* @property customModelName Name for the custom model.
* @property customizationType The customization type. Valid values: `FINE_TUNING`, `CONTINUED_PRE_TRAINING`.
* @property hyperparameters [Parameters](https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models-hp.html) related to tuning the model.
* @property jobName A name for the customization job.
* @property outputDataConfig S3 location for the output data.
* @property roleArn The Amazon Resource Name (ARN) of an IAM role that Bedrock can assume to perform tasks on your behalf.
* @property tags A map of tags to assign to the customization job and custom model. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
* @property timeouts
* @property trainingDataConfig Information about the training dataset.
* @property validationDataConfig Information about the validation dataset.
* @property vpcConfig Configuration parameters for the private Virtual Private Cloud (VPC) that contains the resources you are using for this job.
*/
public data class CustomModelArgs(
public val baseModelIdentifier: Output? = null,
public val customModelKmsKeyId: Output? = null,
public val customModelName: Output? = null,
public val customizationType: Output? = null,
public val hyperparameters: Output