UNPKG

@pulumi/aws

Version:

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

128 lines 5.91 kB
"use strict"; // *** 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, Object.assign(Object.assign({}, 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 ? state.arn : undefined; resourceInputs["dataAccessRoleArn"] = state ? state.dataAccessRoleArn : undefined; resourceInputs["inputDataConfig"] = state ? state.inputDataConfig : undefined; resourceInputs["languageCode"] = state ? state.languageCode : undefined; resourceInputs["modelKmsKeyId"] = state ? state.modelKmsKeyId : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["versionName"] = state ? state.versionName : undefined; resourceInputs["versionNamePrefix"] = state ? state.versionNamePrefix : undefined; resourceInputs["volumeKmsKeyId"] = state ? state.volumeKmsKeyId : undefined; resourceInputs["vpcConfig"] = state ? state.vpcConfig : undefined; } else { const args = argsOrState; if ((!args || args.dataAccessRoleArn === undefined) && !opts.urn) { throw new Error("Missing required property 'dataAccessRoleArn'"); } if ((!args || args.inputDataConfig === undefined) && !opts.urn) { throw new Error("Missing required property 'inputDataConfig'"); } if ((!args || args.languageCode === undefined) && !opts.urn) { throw new Error("Missing required property 'languageCode'"); } resourceInputs["dataAccessRoleArn"] = args ? args.dataAccessRoleArn : undefined; resourceInputs["inputDataConfig"] = args ? args.inputDataConfig : undefined; resourceInputs["languageCode"] = args ? args.languageCode : undefined; resourceInputs["modelKmsKeyId"] = args ? args.modelKmsKeyId : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["versionName"] = args ? args.versionName : undefined; resourceInputs["versionNamePrefix"] = args ? args.versionNamePrefix : undefined; resourceInputs["volumeKmsKeyId"] = args ? args.volumeKmsKeyId : undefined; resourceInputs["vpcConfig"] = args ? args.vpcConfig : undefined; 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