All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.transcribe.LanguageModel Maven / Gradle / Ivy

Go to download

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

There is a newer version: 6.66.3
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.aws.transcribe;

import com.pulumi.aws.Utilities;
import com.pulumi.aws.transcribe.LanguageModelArgs;
import com.pulumi.aws.transcribe.inputs.LanguageModelState;
import com.pulumi.aws.transcribe.outputs.LanguageModelInputDataConfig;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Resource for managing an AWS Transcribe LanguageModel.
 * 
 * > This resource can take a significant amount of time to provision. See Language Model [FAQ](https://aws.amazon.com/transcribe/faqs/) for more details.
 * 
 * ## Example Usage
 * 
 * ### Basic Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.iam.IamFunctions;
 * import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
 * import com.pulumi.aws.iam.Role;
 * import com.pulumi.aws.iam.RoleArgs;
 * import com.pulumi.aws.iam.RolePolicy;
 * import com.pulumi.aws.iam.RolePolicyArgs;
 * import com.pulumi.aws.s3.BucketV2;
 * import com.pulumi.aws.s3.BucketV2Args;
 * import com.pulumi.aws.s3.BucketObjectv2;
 * import com.pulumi.aws.s3.BucketObjectv2Args;
 * import com.pulumi.aws.transcribe.LanguageModel;
 * import com.pulumi.aws.transcribe.LanguageModelArgs;
 * import com.pulumi.aws.transcribe.inputs.LanguageModelInputDataConfigArgs;
 * import static com.pulumi.codegen.internal.Serialization.*;
 * import com.pulumi.asset.FileAsset;
 * 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 = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
 *             .statements(GetPolicyDocumentStatementArgs.builder()
 *                 .actions("sts:AssumeRole")
 *                 .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
 *                     .type("Service")
 *                     .identifiers("transcribe.amazonaws.com")
 *                     .build())
 *                 .build())
 *             .build());
 * 
 *         var exampleRole = new Role("exampleRole", RoleArgs.builder()
 *             .name("example")
 *             .assumeRolePolicy(example.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
 *             .build());
 * 
 *         var testPolicy = new RolePolicy("testPolicy", RolePolicyArgs.builder()
 *             .name("example")
 *             .role(exampleRole.id())
 *             .policy(serializeJson(
 *                 jsonObject(
 *                     jsonProperty("Version", "2012-10-17"),
 *                     jsonProperty("Statement", jsonArray(jsonObject(
 *                         jsonProperty("Action", jsonArray(
 *                             "s3:GetObject", 
 *                             "s3:ListBucket"
 *                         )),
 *                         jsonProperty("Effect", "Allow"),
 *                         jsonProperty("Resource", jsonArray("*"))
 *                     )))
 *                 )))
 *             .build());
 * 
 *         var exampleBucketV2 = new BucketV2("exampleBucketV2", BucketV2Args.builder()
 *             .bucket("example-transcribe")
 *             .forceDestroy(true)
 *             .build());
 * 
 *         var object = new BucketObjectv2("object", BucketObjectv2Args.builder()
 *             .bucket(exampleBucketV2.id())
 *             .key("transcribe/test1.txt")
 *             .source(new FileAsset("test1.txt"))
 *             .build());
 * 
 *         var exampleLanguageModel = new LanguageModel("exampleLanguageModel", LanguageModelArgs.builder()
 *             .modelName("example")
 *             .baseModelName("NarrowBand")
 *             .inputDataConfig(LanguageModelInputDataConfigArgs.builder()
 *                 .dataAccessRoleArn(exampleRole.arn())
 *                 .s3Uri(exampleBucketV2.id().applyValue(id -> String.format("s3://%s/transcribe/", id)))
 *                 .build())
 *             .languageCode("en-US")
 *             .tags(Map.of("ENVIRONMENT", "development"))
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * Using `pulumi import`, import Transcribe LanguageModel using the `model_name`. For example: * * ```sh * $ pulumi import aws:transcribe/languageModel:LanguageModel example example-name * ``` * */ @ResourceType(type="aws:transcribe/languageModel:LanguageModel") public class LanguageModel extends com.pulumi.resources.CustomResource { /** * ARN of the LanguageModel. * */ @Export(name="arn", refs={String.class}, tree="[0]") private Output arn; /** * @return ARN of the LanguageModel. * */ public Output arn() { return this.arn; } /** * Name of reference base model. * */ @Export(name="baseModelName", refs={String.class}, tree="[0]") private Output baseModelName; /** * @return Name of reference base model. * */ public Output baseModelName() { return this.baseModelName; } /** * The input data config for the LanguageModel. See Input Data Config for more details. * */ @Export(name="inputDataConfig", refs={LanguageModelInputDataConfig.class}, tree="[0]") private Output inputDataConfig; /** * @return The input data config for the LanguageModel. See Input Data Config for more details. * */ public Output inputDataConfig() { return this.inputDataConfig; } /** * The language code you selected for your language model. Refer to the [supported languages](https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html) page for accepted codes. * */ @Export(name="languageCode", refs={String.class}, tree="[0]") private Output languageCode; /** * @return The language code you selected for your language model. Refer to the [supported languages](https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html) page for accepted codes. * */ public Output languageCode() { return this.languageCode; } /** * The model name. * */ @Export(name="modelName", refs={String.class}, tree="[0]") private Output modelName; /** * @return The model name. * */ public Output modelName() { return this.modelName; } @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; public Output>> tags() { return Codegen.optional(this.tags); } /** * @deprecated * Please use `tags` instead. * */ @Deprecated /* Please use `tags` instead. */ @Export(name="tagsAll", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tagsAll; public Output> tagsAll() { return this.tagsAll; } /** * * @param name The _unique_ name of the resulting resource. */ public LanguageModel(java.lang.String name) { this(name, LanguageModelArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public LanguageModel(java.lang.String name, LanguageModelArgs args) { this(name, args, null); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. * @param options A bag of options that control this resource's behavior. */ public LanguageModel(java.lang.String name, LanguageModelArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:transcribe/languageModel:LanguageModel", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private LanguageModel(java.lang.String name, Output id, @Nullable LanguageModelState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:transcribe/languageModel:LanguageModel", name, state, makeResourceOptions(options, id), false); } private static LanguageModelArgs makeArgs(LanguageModelArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? LanguageModelArgs.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } /** * Get an existing Host 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 * @param options Optional settings to control the behavior of the CustomResource. */ public static LanguageModel get(java.lang.String name, Output id, @Nullable LanguageModelState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new LanguageModel(name, id, state, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy