@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
119 lines • 5.89 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.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, Object.assign(Object.assign({}, 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 ? state.arn : undefined;
resourceInputs["dataAccessRoleArn"] = state ? state.dataAccessRoleArn : undefined;
resourceInputs["inputDataConfig"] = state ? state.inputDataConfig : undefined;
resourceInputs["languageCode"] = state ? state.languageCode : undefined;
resourceInputs["mode"] = state ? state.mode : undefined;
resourceInputs["modelKmsKeyId"] = state ? state.modelKmsKeyId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["outputDataConfig"] = state ? state.outputDataConfig : 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["mode"] = args ? args.mode : undefined;
resourceInputs["modelKmsKeyId"] = args ? args.modelKmsKeyId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["outputDataConfig"] = args ? args.outputDataConfig : 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(DocumentClassifier.__pulumiType, name, resourceInputs, opts);
}
}
exports.DocumentClassifier = DocumentClassifier;
/** @internal */
DocumentClassifier.__pulumiType = 'aws:comprehend/documentClassifier:DocumentClassifier';
//# sourceMappingURL=documentClassifier.js.map