@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
134 lines • 4.92 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");
/**
* Provides a Timestream table resource.
*
* ## Example Usage
*
* ### Basic usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.timestreamwrite.Table("example", {
* databaseName: exampleAwsTimestreamwriteDatabase.databaseName,
* tableName: "example",
* });
* ```
*
* ### Full usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.timestreamwrite.Table("example", {
* databaseName: exampleAwsTimestreamwriteDatabase.databaseName,
* tableName: "example",
* retentionProperties: {
* magneticStoreRetentionPeriodInDays: 30,
* memoryStoreRetentionPeriodInHours: 8,
* },
* tags: {
* Name: "example-timestream-table",
* },
* });
* ```
*
* ### Customer-defined Partition Key
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.timestreamwrite.Table("example", {
* databaseName: exampleAwsTimestreamwriteDatabase.databaseName,
* tableName: "example",
* schema: {
* compositePartitionKey: {
* enforcementInRecord: "REQUIRED",
* name: "attr1",
* type: "DIMENSION",
* },
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Timestream tables using the `table_name` and `database_name` separate by a colon (`:`). For example:
*
* ```sh
* $ pulumi import aws:timestreamwrite/table:Table example ExampleTable:ExampleDatabase
* ```
*/
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["databaseName"] = state?.databaseName;
resourceInputs["magneticStoreWriteProperties"] = state?.magneticStoreWriteProperties;
resourceInputs["region"] = state?.region;
resourceInputs["retentionProperties"] = state?.retentionProperties;
resourceInputs["schema"] = state?.schema;
resourceInputs["tableName"] = state?.tableName;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
}
else {
const args = argsOrState;
if (args?.databaseName === undefined && !opts.urn) {
throw new Error("Missing required property 'databaseName'");
}
if (args?.tableName === undefined && !opts.urn) {
throw new Error("Missing required property 'tableName'");
}
resourceInputs["databaseName"] = args?.databaseName;
resourceInputs["magneticStoreWriteProperties"] = args?.magneticStoreWriteProperties;
resourceInputs["region"] = args?.region;
resourceInputs["retentionProperties"] = args?.retentionProperties;
resourceInputs["schema"] = args?.schema;
resourceInputs["tableName"] = args?.tableName;
resourceInputs["tags"] = args?.tags;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Table.__pulumiType, name, resourceInputs, opts);
}
}
exports.Table = Table;
/** @internal */
Table.__pulumiType = 'aws:timestreamwrite/table:Table';
//# sourceMappingURL=table.js.map
;