@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
128 lines • 5.41 kB
JavaScript
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.EntityRecognizer = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing an AWS Comprehend Entity Recognizer.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const documents = new aws.s3.BucketObjectv2("documents", {});
* const entities = new aws.s3.BucketObjectv2("entities", {});
* const example = new aws.comprehend.EntityRecognizer("example", {
* name: "example",
* dataAccessRoleArn: exampleAwsIamRole.arn,
* languageCode: "en",
* inputDataConfig: {
* entityTypes: [
* {
* type: "ENTITY_1",
* },
* {
* type: "ENTITY_2",
* },
* ],
* documents: {
* s3Uri: pulumi.interpolate`s3://${documentsAwsS3Bucket.bucket}/${documents.key}`,
* },
* entityList: {
* s3Uri: pulumi.interpolate`s3://${entitiesAwsS3Bucket.bucket}/${entities.key}`,
* },
* },
* }, {
* dependsOn: [exampleAwsIamRolePolicy],
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Comprehend Entity Recognizer using the ARN. For example:
*
* ```sh
* $ pulumi import aws:comprehend/entityRecognizer:EntityRecognizer example arn:aws:comprehend:us-west-2:123456789012:entity-recognizer/example
* ```
*/
class EntityRecognizer extends pulumi.CustomResource {
/**
* Get an existing EntityRecognizer 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, id, state, opts) {
return new EntityRecognizer(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of EntityRecognizer. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === EntityRecognizer.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["dataAccessRoleArn"] = state?.dataAccessRoleArn;
resourceInputs["inputDataConfig"] = state?.inputDataConfig;
resourceInputs["languageCode"] = state?.languageCode;
resourceInputs["modelKmsKeyId"] = state?.modelKmsKeyId;
resourceInputs["name"] = state?.name;
resourceInputs["region"] = state?.region;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["versionName"] = state?.versionName;
resourceInputs["versionNamePrefix"] = state?.versionNamePrefix;
resourceInputs["volumeKmsKeyId"] = state?.volumeKmsKeyId;
resourceInputs["vpcConfig"] = state?.vpcConfig;
}
else {
const args = argsOrState;
if (args?.dataAccessRoleArn === undefined && !opts.urn) {
throw new Error("Missing required property 'dataAccessRoleArn'");
}
if (args?.inputDataConfig === undefined && !opts.urn) {
throw new Error("Missing required property 'inputDataConfig'");
}
if (args?.languageCode === undefined && !opts.urn) {
throw new Error("Missing required property 'languageCode'");
}
resourceInputs["dataAccessRoleArn"] = args?.dataAccessRoleArn;
resourceInputs["inputDataConfig"] = args?.inputDataConfig;
resourceInputs["languageCode"] = args?.languageCode;
resourceInputs["modelKmsKeyId"] = args?.modelKmsKeyId;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
resourceInputs["versionName"] = args?.versionName;
resourceInputs["versionNamePrefix"] = args?.versionNamePrefix;
resourceInputs["volumeKmsKeyId"] = args?.volumeKmsKeyId;
resourceInputs["vpcConfig"] = args?.vpcConfig;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(EntityRecognizer.__pulumiType, name, resourceInputs, opts);
}
}
exports.EntityRecognizer = EntityRecognizer;
/** @internal */
EntityRecognizer.__pulumiType = 'aws:comprehend/entityRecognizer:EntityRecognizer';
//# sourceMappingURL=entityRecognizer.js.map
;