Skip to content

Resource: awsTranscribeLanguageModel

Terraform resource for managing an AWS Transcribe LanguageModel.

-> This resource can take a significant amount of time to provision. See Language Model FAQ for more details.

Example Usage

Basic Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsS3BucketExample = new aws.s3Bucket.S3Bucket(this, "example", {
  bucket: "example-transcribe",
  forceDestroy: true,
});
new aws.s3Object.S3Object(this, "object", {
  bucket: awsS3BucketExample.id,
  key: "transcribe/test1.txt",
  source: "test1.txt",
});
const dataAwsIamPolicyDocumentExample =
  new aws.dataAwsIamPolicyDocument.DataAwsIamPolicyDocument(this, "example_2", {
    statement: [
      {
        actions: ["sts:AssumeRole"],
        principals: [
          {
            identifiers: ["transcribe.amazonaws.com"],
            type: "Service",
          },
        ],
      },
    ],
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
dataAwsIamPolicyDocumentExample.overrideLogicalId("example");
const awsIamRoleExample = new aws.iamRole.IamRole(this, "example_3", {
  assumeRolePolicy: dataAwsIamPolicyDocumentExample.json,
  name: "example",
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsIamRoleExample.overrideLogicalId("example");
new aws.iamRolePolicy.IamRolePolicy(this, "test_policy", {
  name: "example",
  policy:
    '${jsonencode({\n    Version = "2012-10-17"\n    Statement = [\n      {\n        Action = [\n          "s3:GetObject",\n          "s3:ListBucket",\n        ]\n        Effect   = "Allow"\n        Resource = ["*"]\n      },\n    ]\n  })}',
  role: awsIamRoleExample.id,
});
const awsTranscribeLanguageModelExample =
  new aws.transcribeLanguageModel.TranscribeLanguageModel(this, "example_5", {
    baseModelName: "NarrowBand",
    inputDataConfig: {
      dataAccessRoleArn: awsIamRoleExample.arn,
      s3Uri: `s3://\${${awsS3BucketExample.id}}/transcribe/`,
    },
    languageCode: "en-US",
    modelName: "example",
    tags: {
      ENVIRONMENT: "development",
    },
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsTranscribeLanguageModelExample.overrideLogicalId("example");

Argument Reference

The following arguments are required:

  • baseModelName - (Required) Name of reference base model.
  • inputDataConfig - (Required) The input data config for the LanguageModel. See Input Data Config for more details.
  • languageCode - (Required) The language code you selected for your language model. Refer to the supported languages page for accepted codes.
  • modelName - (Required) The model name.

Input Data Config

  • dataAccessRoleArn - (Required) IAM role with access to S3 bucket.
  • s3Uri - (Required) S3 URI where training data is located.
  • tuningDataS3Uri - (Optional) S3 URI where tuning data is located.

The following arguments are optional:

  • tags - (Optional) A map of tags to assign to the LanguageModel. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - LanguageModel name.
  • arn - ARN of the LanguageModel.

Timeouts

Configuration options:

  • create - (Default 600M)

Import

Transcribe LanguageModel can be imported using the modelName, e.g.,

$ terraform import aws_transcribe_language_model.example example-name