UNPKG

@pulumi/aws

Version:

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

171 lines 7.67 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.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, Object.assign(Object.assign({}, 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 ? state.arn : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["createdBy"] = state ? state.createdBy : undefined; resourceInputs["encryptionConfiguration"] = state ? state.encryptionConfiguration : undefined; resourceInputs["format"] = state ? state.format : undefined; resourceInputs["maintenanceConfiguration"] = state ? state.maintenanceConfiguration : undefined; resourceInputs["metadata"] = state ? state.metadata : undefined; resourceInputs["metadataLocation"] = state ? state.metadataLocation : undefined; resourceInputs["modifiedAt"] = state ? state.modifiedAt : undefined; resourceInputs["modifiedBy"] = state ? state.modifiedBy : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["namespace"] = state ? state.namespace : undefined; resourceInputs["ownerAccountId"] = state ? state.ownerAccountId : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["tableBucketArn"] = state ? state.tableBucketArn : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["versionToken"] = state ? state.versionToken : undefined; resourceInputs["warehouseLocation"] = state ? state.warehouseLocation : undefined; } else { const args = argsOrState; if ((!args || args.format === undefined) && !opts.urn) { throw new Error("Missing required property 'format'"); } if ((!args || args.namespace === undefined) && !opts.urn) { throw new Error("Missing required property 'namespace'"); } if ((!args || args.tableBucketArn === undefined) && !opts.urn) { throw new Error("Missing required property 'tableBucketArn'"); } resourceInputs["encryptionConfiguration"] = args ? args.encryptionConfiguration : undefined; resourceInputs["format"] = args ? args.format : undefined; resourceInputs["maintenanceConfiguration"] = args ? args.maintenanceConfiguration : undefined; resourceInputs["metadata"] = args ? args.metadata : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["namespace"] = args ? args.namespace : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["tableBucketArn"] = args ? args.tableBucketArn : undefined; 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["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