Experimental
@aws-cdk/aws-redshift-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
Table
A table in a Redshift cluster.
Example
new Table(this, 'Table', {
tableColumns: [
{ name: 'col1', dataType: 'varchar(4)', distKey: true },
{ name: 'col2', dataType: 'float' },
],
cluster: cluster,
databaseName: 'databaseName',
distStyle: TableDistStyle.KEY,
});
Table.Builder.create(this, "Table")
.tableColumns(List.of(Column.builder().name("col1").dataType("varchar(4)").distKey(true).build(), Column.builder().name("col2").dataType("float").build()))
.cluster(cluster)
.databaseName("databaseName")
.distStyle(TableDistStyle.KEY)
.build();
// Install: dotnet add package Amazon.CDK.AWS.Redshift.Alpha
new Table(this, "Table", new TableProps {
TableColumns = new [] { new Column { Name = "col1", DataType = "varchar(4)", DistKey = true }, new Column { Name = "col2", DataType = "float" } },
Cluster = cluster,
DatabaseName = "databaseName",
DistStyle = TableDistStyle.KEY
});
// Install: go get github.com/aws/aws-cdk-go/awscdkredshiftalpha/v2
awscdkredshiftalpha.NewTable(this, jsii.String("Table"), &TableProps{
TableColumns: []Column{
&Column{
Name: jsii.String("col1"),
DataType: jsii.String("varchar(4)"),
DistKey: jsii.Boolean(true),
},
&Column{
Name: jsii.String("col2"),
DataType: jsii.String("float"),
},
},
Cluster: cluster,
DatabaseName: jsii.String("databaseName"),
DistStyle: awscdkredshiftalpha.TableDistStyle_KEY,
})
Initializer
new Table(scope: Construct, id: string, props: TableProps)
Table(scope: Construct, id: str, props: TableProps)
new Table(Construct scope, String id, TableProps props)
new Table(Construct scope, string id, TableProps props)
NewTable(Scope Construct, Id *string, Props TableProps)
Construct Props
adminUserISecretadmin_userISecretadminUserISecretAdminUserISecretAdminUserISecret= the admin secret is taken from t…#Secret JSON schema: { username: string; password: string }.
default
Default: the admin secret is taken from the cluster
distStyleTableDistStyledist_styleTableDistStyledistStyleTableDistStyleDistStyleTableDistStyleDistStyleTableDistStyle= TableDistStyle.AUTO#removalPolicyRemovalPolicyremoval_policyRemovalPolicyremovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicy= cdk.RemovalPolicy.Retain#sortStyleTableSortStylesort_styleTableSortStylesortStyleTableSortStyleSortStyleTableSortStyleSortStyleTableSortStyle= TableSortStyle.AUTO if no sort k…#default
Default: TableSortStyle.AUTO if no sort key is specified, TableSortStyle.COMPOUND if a sort key is specified
tableColumnsColumn[]table_columnstyping.List[Column]tableColumnsList<Column>TableColumnsColumn[]TableColumns*[]Columnrequired#tableCommentstringtable_commentstrtableCommentStringTableCommentstringTableComment*string= no comment#Properties
Methods
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#notes
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be destroyed (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).
This resource is retained by default.
fromTableAttributes(scope: Construct, id: string, attrs: TableAttributes): ITable@staticmethod def from_table_attributes(scope: Construct, id: str, attrs: TableAttributes) -> ITablepublic static ITable fromTableAttributes(Construct scope, String id, TableAttributes attrs)public static ITable FromTableAttributes(Construct scope, string id, TableAttributes attrs)func FromTableAttributes(Scope Construct, Id *string, Attrs TableAttributes) ITablestatic#grant(user: IUser, ...actions: TableAction[]): voiddef grant(self, user: IUser, actions: TableAction) -> Nonepublic void grant(IUser user, TableAction actions)public void Grant(IUser user, TableAction actions)func Grant(User IUser, Actions TableAction)#isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#notes · 1 parameter · returns
Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.
Parameters
xxxxX— Any object.
Returns: true if x is an object created from a class which extends Construct.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.
1 parameter · returns
Parameters
mixinsmixinsmixinsmixinsMixins— The mixins to apply.
Returns: This construct for chaining