aws.transcribe.Vocabulary
Explore with Pulumi AI
Resource for managing an AWS Transcribe Vocabulary.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.s3.BucketV2("example", {
bucket: "example-vocab-123",
forceDestroy: true,
});
const object = new aws.s3.BucketObjectv2("object", {
bucket: example.id,
key: "transcribe/test1.txt",
source: new pulumi.asset.FileAsset("test.txt"),
});
const exampleVocabulary = new aws.transcribe.Vocabulary("example", {
vocabularyName: "example",
languageCode: "en-US",
vocabularyFileUri: pulumi.interpolate`s3://${example.id}/${object.key}`,
tags: {
tag1: "value1",
tag2: "value3",
},
}, {
dependsOn: [object],
});
import pulumi
import pulumi_aws as aws
example = aws.s3.BucketV2("example",
bucket="example-vocab-123",
force_destroy=True)
object = aws.s3.BucketObjectv2("object",
bucket=example.id,
key="transcribe/test1.txt",
source=pulumi.FileAsset("test.txt"))
example_vocabulary = aws.transcribe.Vocabulary("example",
vocabulary_name="example",
language_code="en-US",
vocabulary_file_uri=pulumi.Output.all(
id=example.id,
key=object.key
).apply(lambda resolved_outputs: f"s3://{resolved_outputs['id']}/{resolved_outputs['key']}")
,
tags={
"tag1": "value1",
"tag2": "value3",
},
opts = pulumi.ResourceOptions(depends_on=[object]))
package main
import (
"fmt"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/transcribe"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := s3.NewBucketV2(ctx, "example", &s3.BucketV2Args{
Bucket: pulumi.String("example-vocab-123"),
ForceDestroy: pulumi.Bool(true),
})
if err != nil {
return err
}
object, err := s3.NewBucketObjectv2(ctx, "object", &s3.BucketObjectv2Args{
Bucket: example.ID(),
Key: pulumi.String("transcribe/test1.txt"),
Source: pulumi.NewFileAsset("test.txt"),
})
if err != nil {
return err
}
_, err = transcribe.NewVocabulary(ctx, "example", &transcribe.VocabularyArgs{
VocabularyName: pulumi.String("example"),
LanguageCode: pulumi.String("en-US"),
VocabularyFileUri: pulumi.All(example.ID(), object.Key).ApplyT(func(_args []interface{}) (string, error) {
id := _args[0].(string)
key := _args[1].(string)
return fmt.Sprintf("s3://%v/%v", id, key), nil
}).(pulumi.StringOutput),
Tags: pulumi.StringMap{
"tag1": pulumi.String("value1"),
"tag2": pulumi.String("value3"),
},
}, pulumi.DependsOn([]pulumi.Resource{
object,
}))
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.S3.BucketV2("example", new()
{
Bucket = "example-vocab-123",
ForceDestroy = true,
});
var @object = new Aws.S3.BucketObjectv2("object", new()
{
Bucket = example.Id,
Key = "transcribe/test1.txt",
Source = new FileAsset("test.txt"),
});
var exampleVocabulary = new Aws.Transcribe.Vocabulary("example", new()
{
VocabularyName = "example",
LanguageCode = "en-US",
VocabularyFileUri = Output.Tuple(example.Id, @object.Key).Apply(values =>
{
var id = values.Item1;
var key = values.Item2;
return $"s3://{id}/{key}";
}),
Tags =
{
{ "tag1", "value1" },
{ "tag2", "value3" },
},
}, new CustomResourceOptions
{
DependsOn =
{
@object,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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.Vocabulary;
import com.pulumi.aws.transcribe.VocabularyArgs;
import com.pulumi.resources.CustomResourceOptions;
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) {
var example = new BucketV2("example", BucketV2Args.builder()
.bucket("example-vocab-123")
.forceDestroy(true)
.build());
var object = new BucketObjectv2("object", BucketObjectv2Args.builder()
.bucket(example.id())
.key("transcribe/test1.txt")
.source(new FileAsset("test.txt"))
.build());
var exampleVocabulary = new Vocabulary("exampleVocabulary", VocabularyArgs.builder()
.vocabularyName("example")
.languageCode("en-US")
.vocabularyFileUri(Output.tuple(example.id(), object.key()).applyValue(values -> {
var id = values.t1;
var key = values.t2;
return String.format("s3://%s/%s", id,key);
}))
.tags(Map.ofEntries(
Map.entry("tag1", "value1"),
Map.entry("tag2", "value3")
))
.build(), CustomResourceOptions.builder()
.dependsOn(object)
.build());
}
}
resources:
example:
type: aws:s3:BucketV2
properties:
bucket: example-vocab-123
forceDestroy: true
object:
type: aws:s3:BucketObjectv2
properties:
bucket: ${example.id}
key: transcribe/test1.txt
source:
fn::FileAsset: test.txt
exampleVocabulary:
type: aws:transcribe:Vocabulary
name: example
properties:
vocabularyName: example
languageCode: en-US
vocabularyFileUri: s3://${example.id}/${object.key}
tags:
tag1: value1
tag2: value3
options:
dependson:
- ${object}
Create Vocabulary Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Vocabulary(name: string, args: VocabularyArgs, opts?: CustomResourceOptions);
@overload
def Vocabulary(resource_name: str,
args: VocabularyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Vocabulary(resource_name: str,
opts: Optional[ResourceOptions] = None,
language_code: Optional[str] = None,
vocabulary_name: Optional[str] = None,
phrases: Optional[Sequence[str]] = None,
tags: Optional[Mapping[str, str]] = None,
vocabulary_file_uri: Optional[str] = None)
func NewVocabulary(ctx *Context, name string, args VocabularyArgs, opts ...ResourceOption) (*Vocabulary, error)
public Vocabulary(string name, VocabularyArgs args, CustomResourceOptions? opts = null)
public Vocabulary(String name, VocabularyArgs args)
public Vocabulary(String name, VocabularyArgs args, CustomResourceOptions options)
type: aws:transcribe:Vocabulary
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args VocabularyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args VocabularyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args VocabularyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VocabularyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VocabularyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var awsVocabularyResource = new Aws.Transcribe.Vocabulary("awsVocabularyResource", new()
{
LanguageCode = "string",
VocabularyName = "string",
Phrases = new[]
{
"string",
},
Tags =
{
{ "string", "string" },
},
VocabularyFileUri = "string",
});
example, err := transcribe.NewVocabulary(ctx, "awsVocabularyResource", &transcribe.VocabularyArgs{
LanguageCode: pulumi.String("string"),
VocabularyName: pulumi.String("string"),
Phrases: pulumi.StringArray{
pulumi.String("string"),
},
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
VocabularyFileUri: pulumi.String("string"),
})
var awsVocabularyResource = new Vocabulary("awsVocabularyResource", VocabularyArgs.builder()
.languageCode("string")
.vocabularyName("string")
.phrases("string")
.tags(Map.of("string", "string"))
.vocabularyFileUri("string")
.build());
aws_vocabulary_resource = aws.transcribe.Vocabulary("awsVocabularyResource",
language_code="string",
vocabulary_name="string",
phrases=["string"],
tags={
"string": "string",
},
vocabulary_file_uri="string")
const awsVocabularyResource = new aws.transcribe.Vocabulary("awsVocabularyResource", {
languageCode: "string",
vocabularyName: "string",
phrases: ["string"],
tags: {
string: "string",
},
vocabularyFileUri: "string",
});
type: aws:transcribe:Vocabulary
properties:
languageCode: string
phrases:
- string
tags:
string: string
vocabularyFileUri: string
vocabularyName: string
Vocabulary Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Vocabulary resource accepts the following input properties:
- Language
Code string - The language code you selected for your vocabulary.
- Vocabulary
Name string The name of the Vocabulary.
The following arguments are optional:
- Phrases List<string>
- A list of terms to include in the vocabulary. Conflicts with
vocabulary_file_uri
- Dictionary<string, string>
- A map of tags to assign to the Vocabulary. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Vocabulary
File stringUri - The Amazon S3 location (URI) of the text file that contains your custom vocabulary. Conflicts wth
phrases
.
- Language
Code string - The language code you selected for your vocabulary.
- Vocabulary
Name string The name of the Vocabulary.
The following arguments are optional:
- Phrases []string
- A list of terms to include in the vocabulary. Conflicts with
vocabulary_file_uri
- map[string]string
- A map of tags to assign to the Vocabulary. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Vocabulary
File stringUri - The Amazon S3 location (URI) of the text file that contains your custom vocabulary. Conflicts wth
phrases
.
- language
Code String - The language code you selected for your vocabulary.
- vocabulary
Name String The name of the Vocabulary.
The following arguments are optional:
- phrases List<String>
- A list of terms to include in the vocabulary. Conflicts with
vocabulary_file_uri
- Map<String,String>
- A map of tags to assign to the Vocabulary. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - vocabulary
File StringUri - The Amazon S3 location (URI) of the text file that contains your custom vocabulary. Conflicts wth
phrases
.
- language
Code string - The language code you selected for your vocabulary.
- vocabulary
Name string The name of the Vocabulary.
The following arguments are optional:
- phrases string[]
- A list of terms to include in the vocabulary. Conflicts with
vocabulary_file_uri
- {[key: string]: string}
- A map of tags to assign to the Vocabulary. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - vocabulary
File stringUri - The Amazon S3 location (URI) of the text file that contains your custom vocabulary. Conflicts wth
phrases
.
- language_
code str - The language code you selected for your vocabulary.
- vocabulary_
name str The name of the Vocabulary.
The following arguments are optional:
- phrases Sequence[str]
- A list of terms to include in the vocabulary. Conflicts with
vocabulary_file_uri
- Mapping[str, str]
- A map of tags to assign to the Vocabulary. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - vocabulary_
file_ struri - The Amazon S3 location (URI) of the text file that contains your custom vocabulary. Conflicts wth
phrases
.
- language
Code String - The language code you selected for your vocabulary.
- vocabulary
Name String The name of the Vocabulary.
The following arguments are optional:
- phrases List<String>
- A list of terms to include in the vocabulary. Conflicts with
vocabulary_file_uri
- Map<String>
- A map of tags to assign to the Vocabulary. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - vocabulary
File StringUri - The Amazon S3 location (URI) of the text file that contains your custom vocabulary. Conflicts wth
phrases
.
Outputs
All input properties are implicitly available as output properties. Additionally, the Vocabulary resource produces the following output properties:
- Arn string
- ARN of the Vocabulary.
- Download
Uri string - Generated download URI.
- Id string
- The provider-assigned unique ID for this managed resource.
- Dictionary<string, string>
- Arn string
- ARN of the Vocabulary.
- Download
Uri string - Generated download URI.
- Id string
- The provider-assigned unique ID for this managed resource.
- map[string]string
- arn String
- ARN of the Vocabulary.
- download
Uri String - Generated download URI.
- id String
- The provider-assigned unique ID for this managed resource.
- Map<String,String>
- arn string
- ARN of the Vocabulary.
- download
Uri string - Generated download URI.
- id string
- The provider-assigned unique ID for this managed resource.
- {[key: string]: string}
- arn str
- ARN of the Vocabulary.
- download_
uri str - Generated download URI.
- id str
- The provider-assigned unique ID for this managed resource.
- Mapping[str, str]
- arn String
- ARN of the Vocabulary.
- download
Uri String - Generated download URI.
- id String
- The provider-assigned unique ID for this managed resource.
- Map<String>
Look up Existing Vocabulary Resource
Get an existing Vocabulary resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: VocabularyState, opts?: CustomResourceOptions): Vocabulary
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
download_uri: Optional[str] = None,
language_code: Optional[str] = None,
phrases: Optional[Sequence[str]] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None,
vocabulary_file_uri: Optional[str] = None,
vocabulary_name: Optional[str] = None) -> Vocabulary
func GetVocabulary(ctx *Context, name string, id IDInput, state *VocabularyState, opts ...ResourceOption) (*Vocabulary, error)
public static Vocabulary Get(string name, Input<string> id, VocabularyState? state, CustomResourceOptions? opts = null)
public static Vocabulary get(String name, Output<String> id, VocabularyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Arn string
- ARN of the Vocabulary.
- Download
Uri string - Generated download URI.
- Language
Code string - The language code you selected for your vocabulary.
- Phrases List<string>
- A list of terms to include in the vocabulary. Conflicts with
vocabulary_file_uri
- Dictionary<string, string>
- A map of tags to assign to the Vocabulary. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- Vocabulary
File stringUri - The Amazon S3 location (URI) of the text file that contains your custom vocabulary. Conflicts wth
phrases
. - Vocabulary
Name string The name of the Vocabulary.
The following arguments are optional:
- Arn string
- ARN of the Vocabulary.
- Download
Uri string - Generated download URI.
- Language
Code string - The language code you selected for your vocabulary.
- Phrases []string
- A list of terms to include in the vocabulary. Conflicts with
vocabulary_file_uri
- map[string]string
- A map of tags to assign to the Vocabulary. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- Vocabulary
File stringUri - The Amazon S3 location (URI) of the text file that contains your custom vocabulary. Conflicts wth
phrases
. - Vocabulary
Name string The name of the Vocabulary.
The following arguments are optional:
- arn String
- ARN of the Vocabulary.
- download
Uri String - Generated download URI.
- language
Code String - The language code you selected for your vocabulary.
- phrases List<String>
- A list of terms to include in the vocabulary. Conflicts with
vocabulary_file_uri
- Map<String,String>
- A map of tags to assign to the Vocabulary. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- vocabulary
File StringUri - The Amazon S3 location (URI) of the text file that contains your custom vocabulary. Conflicts wth
phrases
. - vocabulary
Name String The name of the Vocabulary.
The following arguments are optional:
- arn string
- ARN of the Vocabulary.
- download
Uri string - Generated download URI.
- language
Code string - The language code you selected for your vocabulary.
- phrases string[]
- A list of terms to include in the vocabulary. Conflicts with
vocabulary_file_uri
- {[key: string]: string}
- A map of tags to assign to the Vocabulary. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- vocabulary
File stringUri - The Amazon S3 location (URI) of the text file that contains your custom vocabulary. Conflicts wth
phrases
. - vocabulary
Name string The name of the Vocabulary.
The following arguments are optional:
- arn str
- ARN of the Vocabulary.
- download_
uri str - Generated download URI.
- language_
code str - The language code you selected for your vocabulary.
- phrases Sequence[str]
- A list of terms to include in the vocabulary. Conflicts with
vocabulary_file_uri
- Mapping[str, str]
- A map of tags to assign to the Vocabulary. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- vocabulary_
file_ struri - The Amazon S3 location (URI) of the text file that contains your custom vocabulary. Conflicts wth
phrases
. - vocabulary_
name str The name of the Vocabulary.
The following arguments are optional:
- arn String
- ARN of the Vocabulary.
- download
Uri String - Generated download URI.
- language
Code String - The language code you selected for your vocabulary.
- phrases List<String>
- A list of terms to include in the vocabulary. Conflicts with
vocabulary_file_uri
- Map<String>
- A map of tags to assign to the Vocabulary. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- vocabulary
File StringUri - The Amazon S3 location (URI) of the text file that contains your custom vocabulary. Conflicts wth
phrases
. - vocabulary
Name String The name of the Vocabulary.
The following arguments are optional:
Import
Using pulumi import
, import Transcribe Vocabulary using the vocabulary_name
. For example:
$ pulumi import aws:transcribe/vocabulary:Vocabulary example example-name
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.