@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
175 lines • 7.34 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.Table = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing an Amazon S3 Tables Table.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const exampleTableBucket = new aws.s3tables.TableBucket("example", {name: "example-bucket"});
* const exampleNamespace = new aws.s3tables.Namespace("example", {
* namespace: "example_namespace",
* tableBucketArn: exampleTableBucket.arn,
* });
* const example = new aws.s3tables.Table("example", {
* name: "example_table",
* namespace: exampleNamespace.namespace,
* tableBucketArn: exampleNamespace.tableBucketArn,
* format: "ICEBERG",
* });
* ```
*
* ### With Metadata Schema
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const exampleTableBucket = new aws.s3tables.TableBucket("example", {name: "example-bucket"});
* const exampleNamespace = new aws.s3tables.Namespace("example", {
* namespace: "example_namespace",
* tableBucketArn: exampleTableBucket.arn,
* });
* const example = new aws.s3tables.Table("example", {
* name: "example_table",
* namespace: exampleNamespace.namespace,
* tableBucketArn: exampleNamespace.tableBucketArn,
* format: "ICEBERG",
* metadata: {
* iceberg: {
* schema: {
* fields: [
* {
* name: "id",
* type: "long",
* required: true,
* },
* {
* name: "name",
* type: "string",
* required: true,
* },
* {
* name: "created_at",
* type: "timestamp",
* required: false,
* },
* {
* name: "price",
* type: "decimal(10,2)",
* required: false,
* },
* ],
* },
* },
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import S3 Tables Table using the `table_bucket_arn`, the value of `namespace`, and the value of `name`, separated by a semicolon (`;`). For example:
*
* ```sh
* $ pulumi import aws:s3tables/table:Table example 'arn:aws:s3tables:us-west-2:123456789012:bucket/example-bucket;example-namespace;example-table'
* ```
*/
class Table extends pulumi.CustomResource {
/**
* Get an existing Table 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 Table(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Table. 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'] === Table.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["createdAt"] = state?.createdAt;
resourceInputs["createdBy"] = state?.createdBy;
resourceInputs["encryptionConfiguration"] = state?.encryptionConfiguration;
resourceInputs["format"] = state?.format;
resourceInputs["maintenanceConfiguration"] = state?.maintenanceConfiguration;
resourceInputs["metadata"] = state?.metadata;
resourceInputs["metadataLocation"] = state?.metadataLocation;
resourceInputs["modifiedAt"] = state?.modifiedAt;
resourceInputs["modifiedBy"] = state?.modifiedBy;
resourceInputs["name"] = state?.name;
resourceInputs["namespace"] = state?.namespace;
resourceInputs["ownerAccountId"] = state?.ownerAccountId;
resourceInputs["region"] = state?.region;
resourceInputs["tableBucketArn"] = state?.tableBucketArn;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["type"] = state?.type;
resourceInputs["versionToken"] = state?.versionToken;
resourceInputs["warehouseLocation"] = state?.warehouseLocation;
}
else {
const args = argsOrState;
if (args?.format === undefined && !opts.urn) {
throw new Error("Missing required property 'format'");
}
if (args?.namespace === undefined && !opts.urn) {
throw new Error("Missing required property 'namespace'");
}
if (args?.tableBucketArn === undefined && !opts.urn) {
throw new Error("Missing required property 'tableBucketArn'");
}
resourceInputs["encryptionConfiguration"] = args?.encryptionConfiguration;
resourceInputs["format"] = args?.format;
resourceInputs["maintenanceConfiguration"] = args?.maintenanceConfiguration;
resourceInputs["metadata"] = args?.metadata;
resourceInputs["name"] = args?.name;
resourceInputs["namespace"] = args?.namespace;
resourceInputs["region"] = args?.region;
resourceInputs["tableBucketArn"] = args?.tableBucketArn;
resourceInputs["tags"] = args?.tags;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["createdBy"] = undefined /*out*/;
resourceInputs["metadataLocation"] = undefined /*out*/;
resourceInputs["modifiedAt"] = undefined /*out*/;
resourceInputs["modifiedBy"] = undefined /*out*/;
resourceInputs["ownerAccountId"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["type"] = undefined /*out*/;
resourceInputs["versionToken"] = undefined /*out*/;
resourceInputs["warehouseLocation"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Table.__pulumiType, name, resourceInputs, opts);
}
}
exports.Table = Table;
/** @internal */
Table.__pulumiType = 'aws:s3tables/table:Table';
//# sourceMappingURL=table.js.map