@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
453 lines • 14.5 kB
JavaScript
"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.DataSource = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing an AWS Kendra Data Source.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.kendra.DataSource("example", {
* indexId: exampleAwsKendraIndex.id,
* name: "example",
* description: "example",
* languageCode: "en",
* type: "CUSTOM",
* tags: {
* hello: "world",
* },
* });
* ```
*
* ### S3 Connector
*
* ### With Schedule
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.kendra.DataSource("example", {
* indexId: exampleAwsKendraIndex.id,
* name: "example",
* type: "S3",
* roleArn: exampleAwsIamRole.arn,
* schedule: "cron(9 10 1 * ? *)",
* configuration: {
* s3Configuration: {
* bucketName: exampleAwsS3Bucket.id,
* },
* },
* });
* ```
*
* ### With Access Control List
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.kendra.DataSource("example", {
* indexId: exampleAwsKendraIndex.id,
* name: "example",
* type: "S3",
* roleArn: exampleAwsIamRole.arn,
* configuration: {
* s3Configuration: {
* bucketName: exampleAwsS3Bucket.id,
* accessControlListConfiguration: {
* keyPath: `s3://${exampleAwsS3Bucket.id}/path-1`,
* },
* },
* },
* });
* ```
*
* ### With Documents Metadata Configuration
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.kendra.DataSource("example", {
* indexId: exampleAwsKendraIndex.id,
* name: "example",
* type: "S3",
* roleArn: exampleAwsIamRole.arn,
* configuration: {
* s3Configuration: {
* bucketName: exampleAwsS3Bucket.id,
* exclusionPatterns: ["example"],
* inclusionPatterns: ["hello"],
* inclusionPrefixes: ["world"],
* documentsMetadataConfiguration: {
* s3Prefix: "example",
* },
* },
* },
* });
* ```
*
* ### Web Crawler Connector
*
* ### With Seed URLs
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.kendra.DataSource("example", {
* indexId: exampleAwsKendraIndex.id,
* name: "example",
* type: "WEBCRAWLER",
* roleArn: exampleAwsIamRole.arn,
* configuration: {
* webCrawlerConfiguration: {
* urls: {
* seedUrlConfiguration: {
* seedUrls: ["REPLACE_WITH_YOUR_URL"],
* },
* },
* },
* },
* });
* ```
*
* ### With Site Maps
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.kendra.DataSource("example", {
* indexId: exampleAwsKendraIndex.id,
* name: "example",
* type: "WEBCRAWLER",
* roleArn: exampleAwsIamRole.arn,
* configuration: {
* webCrawlerConfiguration: {
* urls: {
* siteMapsConfiguration: {
* siteMaps: ["REPLACE_WITH_YOUR_URL"],
* },
* },
* },
* },
* });
* ```
*
* ### With Web Crawler Mode
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.kendra.DataSource("example", {
* indexId: exampleAwsKendraIndex.id,
* name: "example",
* type: "WEBCRAWLER",
* roleArn: exampleAwsIamRole.arn,
* configuration: {
* webCrawlerConfiguration: {
* urls: {
* seedUrlConfiguration: {
* webCrawlerMode: "SUBDOMAINS",
* seedUrls: ["REPLACE_WITH_YOUR_URL"],
* },
* },
* },
* },
* });
* ```
*
* ### With Authentication Configuration
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.kendra.DataSource("example", {
* indexId: exampleAwsKendraIndex.id,
* name: "example",
* type: "WEBCRAWLER",
* roleArn: exampleAwsIamRole.arn,
* configuration: {
* webCrawlerConfiguration: {
* authenticationConfiguration: {
* basicAuthentications: [{
* credentials: exampleAwsSecretsmanagerSecret.arn,
* host: "a.example.com",
* port: 443,
* }],
* },
* urls: {
* seedUrlConfiguration: {
* seedUrls: ["REPLACE_WITH_YOUR_URL"],
* },
* },
* },
* },
* }, {
* dependsOn: [exampleAwsSecretsmanagerSecretVersion],
* });
* ```
*
* ### With Crawl Depth
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.kendra.DataSource("example", {
* indexId: exampleAwsKendraIndex.id,
* name: "example",
* type: "WEBCRAWLER",
* roleArn: exampleAwsIamRole.arn,
* configuration: {
* webCrawlerConfiguration: {
* crawlDepth: 3,
* urls: {
* seedUrlConfiguration: {
* seedUrls: ["REPLACE_WITH_YOUR_URL"],
* },
* },
* },
* },
* });
* ```
*
* ### With Max Links Per Page
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.kendra.DataSource("example", {
* indexId: exampleAwsKendraIndex.id,
* name: "example",
* type: "WEBCRAWLER",
* roleArn: exampleAwsIamRole.arn,
* configuration: {
* webCrawlerConfiguration: {
* maxLinksPerPage: 100,
* urls: {
* seedUrlConfiguration: {
* seedUrls: ["REPLACE_WITH_YOUR_URL"],
* },
* },
* },
* },
* });
* ```
*
* ### With Max Urls Per Minute Crawl Rate
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.kendra.DataSource("example", {
* indexId: exampleAwsKendraIndex.id,
* name: "example",
* type: "WEBCRAWLER",
* roleArn: exampleAwsIamRole.arn,
* configuration: {
* webCrawlerConfiguration: {
* maxUrlsPerMinuteCrawlRate: 300,
* urls: {
* seedUrlConfiguration: {
* seedUrls: ["REPLACE_WITH_YOUR_URL"],
* },
* },
* },
* },
* });
* ```
*
* ### With Proxy Configuration
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.kendra.DataSource("example", {
* indexId: exampleAwsKendraIndex.id,
* name: "example",
* type: "WEBCRAWLER",
* roleArn: exampleAwsIamRole.arn,
* configuration: {
* webCrawlerConfiguration: {
* proxyConfiguration: {
* credentials: exampleAwsSecretsmanagerSecret.arn,
* host: "a.example.com",
* port: 443,
* },
* urls: {
* seedUrlConfiguration: {
* seedUrls: ["REPLACE_WITH_YOUR_URL"],
* },
* },
* },
* },
* }, {
* dependsOn: [exampleAwsSecretsmanagerSecretVersion],
* });
* ```
*
* ### With URL Exclusion and Inclusion Patterns
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.kendra.DataSource("example", {
* indexId: exampleAwsKendraIndex.id,
* name: "example",
* type: "WEBCRAWLER",
* roleArn: exampleAwsIamRole.arn,
* configuration: {
* webCrawlerConfiguration: {
* urlExclusionPatterns: ["example"],
* urlInclusionPatterns: ["hello"],
* urls: {
* seedUrlConfiguration: {
* seedUrls: ["REPLACE_WITH_YOUR_URL"],
* },
* },
* },
* },
* });
* ```
*
* ### With `WEBCRAWLERV2` Template
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.kendra.DataSource("example", {
* indexId: exampleAwsKendraIndex.id,
* name: "example",
* type: "TEMPLATE",
* roleArn: exampleAwsIamRole.arn,
* configuration: {
* templateConfiguration: {
* template: JSON.stringify({
* connectionConfiguration: {
* repositoryEndpointMetadata: {
* seedUrlConnections: [{
* seedUrl: "https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kendra_index",
* }],
* },
* },
* additionalProperties: {
* inclusionURLIndexPatterns: ["https:\\/\\/registry[.]terraform[.]io\\/providers\\/hashicorp\\/aws\\/latest\\/docs\\/resources\\/kendra_index"],
* },
* version: "1.0.0",
* syncMode: "FULL_CRAWL",
* type: "WEBCRAWLERV2",
* }),
* },
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Kendra Data Source using the unique identifiers of the data_source and index separated by a slash (`/`). For example:
*
* ```sh
* $ pulumi import aws:kendra/dataSource:DataSource example 1045d08d-66ef-4882-b3ed-dfb7df183e90/b34dfdf7-1f2b-4704-9581-79e00296845f
* ```
*/
class DataSource extends pulumi.CustomResource {
/**
* Get an existing DataSource 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 DataSource(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of DataSource. 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'] === DataSource.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["configuration"] = state?.configuration;
resourceInputs["createdAt"] = state?.createdAt;
resourceInputs["customDocumentEnrichmentConfiguration"] = state?.customDocumentEnrichmentConfiguration;
resourceInputs["dataSourceId"] = state?.dataSourceId;
resourceInputs["description"] = state?.description;
resourceInputs["errorMessage"] = state?.errorMessage;
resourceInputs["indexId"] = state?.indexId;
resourceInputs["languageCode"] = state?.languageCode;
resourceInputs["name"] = state?.name;
resourceInputs["region"] = state?.region;
resourceInputs["roleArn"] = state?.roleArn;
resourceInputs["schedule"] = state?.schedule;
resourceInputs["status"] = state?.status;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["type"] = state?.type;
resourceInputs["updatedAt"] = state?.updatedAt;
}
else {
const args = argsOrState;
if (args?.indexId === undefined && !opts.urn) {
throw new Error("Missing required property 'indexId'");
}
if (args?.type === undefined && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["configuration"] = args?.configuration;
resourceInputs["customDocumentEnrichmentConfiguration"] = args?.customDocumentEnrichmentConfiguration;
resourceInputs["description"] = args?.description;
resourceInputs["indexId"] = args?.indexId;
resourceInputs["languageCode"] = args?.languageCode;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["roleArn"] = args?.roleArn;
resourceInputs["schedule"] = args?.schedule;
resourceInputs["tags"] = args?.tags;
resourceInputs["type"] = args?.type;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["dataSourceId"] = undefined /*out*/;
resourceInputs["errorMessage"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DataSource.__pulumiType, name, resourceInputs, opts);
}
}
exports.DataSource = DataSource;
/** @internal */
DataSource.__pulumiType = 'aws:kendra/dataSource:DataSource';
//# sourceMappingURL=dataSource.js.map