@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
114 lines • 4.97 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.VectorsIndex = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing an Amazon S3 Vectors Index.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.s3.VectorsIndex("example", {
* indexName: "example-index",
* vectorBucketName: exampleAwsS3vectorsVectorBucket.vectorBucketName,
* dataType: "float32",
* dimension: 2,
* distanceMetric: "euclidean",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import S3 Vectors Index using the `index_arn`. For example:
*
* ```sh
* $ pulumi import aws:s3/vectorsIndex:VectorsIndex example arn:aws:s3vectors:us-west-2:123456789012:bucket/example-bucket/index/example-index
* ```
*/
class VectorsIndex extends pulumi.CustomResource {
/**
* Get an existing VectorsIndex 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 VectorsIndex(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of VectorsIndex. 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'] === VectorsIndex.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["creationTime"] = state?.creationTime;
resourceInputs["dataType"] = state?.dataType;
resourceInputs["dimension"] = state?.dimension;
resourceInputs["distanceMetric"] = state?.distanceMetric;
resourceInputs["encryptionConfigurations"] = state?.encryptionConfigurations;
resourceInputs["indexArn"] = state?.indexArn;
resourceInputs["indexName"] = state?.indexName;
resourceInputs["metadataConfiguration"] = state?.metadataConfiguration;
resourceInputs["region"] = state?.region;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["vectorBucketName"] = state?.vectorBucketName;
}
else {
const args = argsOrState;
if (args?.dataType === undefined && !opts.urn) {
throw new Error("Missing required property 'dataType'");
}
if (args?.dimension === undefined && !opts.urn) {
throw new Error("Missing required property 'dimension'");
}
if (args?.distanceMetric === undefined && !opts.urn) {
throw new Error("Missing required property 'distanceMetric'");
}
if (args?.indexName === undefined && !opts.urn) {
throw new Error("Missing required property 'indexName'");
}
if (args?.vectorBucketName === undefined && !opts.urn) {
throw new Error("Missing required property 'vectorBucketName'");
}
resourceInputs["dataType"] = args?.dataType;
resourceInputs["dimension"] = args?.dimension;
resourceInputs["distanceMetric"] = args?.distanceMetric;
resourceInputs["encryptionConfigurations"] = args?.encryptionConfigurations;
resourceInputs["indexName"] = args?.indexName;
resourceInputs["metadataConfiguration"] = args?.metadataConfiguration;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
resourceInputs["vectorBucketName"] = args?.vectorBucketName;
resourceInputs["creationTime"] = undefined /*out*/;
resourceInputs["indexArn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(VectorsIndex.__pulumiType, name, resourceInputs, opts);
}
}
exports.VectorsIndex = VectorsIndex;
/** @internal */
VectorsIndex.__pulumiType = 'aws:s3/vectorsIndex:VectorsIndex';
//# sourceMappingURL=vectorsIndex.js.map