UNPKG

@pulumi/aws

Version:

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

119 lines 5.31 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.DocumentClassifier = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for managing an AWS Comprehend Document Classifier. * * ## 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 example = new aws.comprehend.DocumentClassifier("example", { * name: "example", * dataAccessRoleArn: exampleAwsIamRole.arn, * languageCode: "en", * inputDataConfig: { * s3Uri: pulumi.interpolate`s3://${test.bucket}/${documents.key}`, * }, * }, { * dependsOn: [exampleAwsIamRolePolicy], * }); * const entities = new aws.s3.BucketObjectv2("entities", {}); * ``` * * ## Import * * Using `pulumi import`, import Comprehend Document Classifier using the ARN. For example: * * ```sh * $ pulumi import aws:comprehend/documentClassifier:DocumentClassifier example arn:aws:comprehend:us-west-2:123456789012:document_classifier/example * ``` */ class DocumentClassifier extends pulumi.CustomResource { /** * Get an existing DocumentClassifier 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 DocumentClassifier(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of DocumentClassifier. 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'] === DocumentClassifier.__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["mode"] = state?.mode; resourceInputs["modelKmsKeyId"] = state?.modelKmsKeyId; resourceInputs["name"] = state?.name; resourceInputs["outputDataConfig"] = state?.outputDataConfig; 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["mode"] = args?.mode; resourceInputs["modelKmsKeyId"] = args?.modelKmsKeyId; resourceInputs["name"] = args?.name; resourceInputs["outputDataConfig"] = args?.outputDataConfig; 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(DocumentClassifier.__pulumiType, name, resourceInputs, opts); } } exports.DocumentClassifier = DocumentClassifier; /** @internal */ DocumentClassifier.__pulumiType = 'aws:comprehend/documentClassifier:DocumentClassifier'; //# sourceMappingURL=documentClassifier.js.map