Class Table
Provides a DynamoDB table.
Inherited Members
Namespace: Amazon.CDK.AWS.DynamoDB
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Table : TableBase, ITable, IResource
Syntax (vb)
Public Class Table
Inherits TableBase
Implements ITable, IResource
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK;
using Amazon.CDK.AWS.S3;
IBucket bucket;
var app = new App();
var stack = new Stack(app, "Stack");
new Table(stack, "Table", new TableProps {
PartitionKey = new Attribute {
Name = "id",
Type = AttributeType.STRING
},
ImportSource = new ImportSourceSpecification {
CompressionType = InputCompressionType.GZIP,
InputFormat = InputFormat.Csv(new CsvOptions {
Delimiter = ",",
HeaderList = new [] { "id", "name" }
}),
Bucket = bucket,
KeyPrefix = "prefix"
}
});
Synopsis
Constructors
Table(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Table(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Table(Construct, String, ITableProps) |
Properties
EncryptionKey | KMS encryption key, if this table uses a customer-managed encryption key. |
HasIndex | Whether this table has indexes. |
TableArn | Arn of the dynamodb table. |
TableName | Table name of the dynamodb table. |
TableStreamArn | ARN of the table's stream, if there is one. |
Methods
AddGlobalSecondaryIndex(IGlobalSecondaryIndexProps) | Add a global secondary index of table. |
AddLocalSecondaryIndex(ILocalSecondaryIndexProps) | Add a local secondary index of table. |
AutoScaleGlobalSecondaryIndexReadCapacity(String, IEnableScalingProps) | Enable read capacity scaling for the given GSI. |
AutoScaleGlobalSecondaryIndexWriteCapacity(String, IEnableScalingProps) | Enable write capacity scaling for the given GSI. |
AutoScaleReadCapacity(IEnableScalingProps) | Enable read capacity scaling for this table. |
AutoScaleWriteCapacity(IEnableScalingProps) | Enable write capacity scaling for this table. |
FromTableArn(Construct, String, String) | Creates a Table construct that represents an external table via table arn. |
FromTableAttributes(Construct, String, ITableAttributes) | Creates a Table construct that represents an external table. |
FromTableName(Construct, String, String) | Creates a Table construct that represents an external table via table name. |
Schema(String) | Get schema attributes of table or index. |
Constructors
Table(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Table(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Table(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Table(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Table(Construct, String, ITableProps)
public Table(Construct scope, string id, ITableProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props ITableProps
Properties
EncryptionKey
KMS encryption key, if this table uses a customer-managed encryption key.
public override IKey EncryptionKey { get; }
Property Value
Overrides
HasIndex
Whether this table has indexes.
protected override bool HasIndex { get; }
Property Value
System.Boolean
Overrides
TableArn
Arn of the dynamodb table.
public override string TableArn { get; }
Property Value
System.String
Overrides
Remarks
Attribute: true
TableName
Table name of the dynamodb table.
public override string TableName { get; }
Property Value
System.String
Overrides
Remarks
Attribute: true
TableStreamArn
ARN of the table's stream, if there is one.
public override string TableStreamArn { get; }
Property Value
System.String
Overrides
Remarks
Attribute: true
Methods
AddGlobalSecondaryIndex(IGlobalSecondaryIndexProps)
Add a global secondary index of table.
public virtual void AddGlobalSecondaryIndex(IGlobalSecondaryIndexProps props)
Parameters
- props IGlobalSecondaryIndexProps
the property of global secondary index.
AddLocalSecondaryIndex(ILocalSecondaryIndexProps)
Add a local secondary index of table.
public virtual void AddLocalSecondaryIndex(ILocalSecondaryIndexProps props)
Parameters
- props ILocalSecondaryIndexProps
the property of local secondary index.
AutoScaleGlobalSecondaryIndexReadCapacity(String, IEnableScalingProps)
Enable read capacity scaling for the given GSI.
public virtual IScalableTableAttribute AutoScaleGlobalSecondaryIndexReadCapacity(string indexName, IEnableScalingProps props)
Parameters
- indexName System.String
- props IEnableScalingProps
Returns
An object to configure additional AutoScaling settings for this attribute
AutoScaleGlobalSecondaryIndexWriteCapacity(String, IEnableScalingProps)
Enable write capacity scaling for the given GSI.
public virtual IScalableTableAttribute AutoScaleGlobalSecondaryIndexWriteCapacity(string indexName, IEnableScalingProps props)
Parameters
- indexName System.String
- props IEnableScalingProps
Returns
An object to configure additional AutoScaling settings for this attribute
AutoScaleReadCapacity(IEnableScalingProps)
Enable read capacity scaling for this table.
public virtual IScalableTableAttribute AutoScaleReadCapacity(IEnableScalingProps props)
Parameters
- props IEnableScalingProps
Returns
An object to configure additional AutoScaling settings
AutoScaleWriteCapacity(IEnableScalingProps)
Enable write capacity scaling for this table.
public virtual IScalableTableAttribute AutoScaleWriteCapacity(IEnableScalingProps props)
Parameters
- props IEnableScalingProps
Returns
An object to configure additional AutoScaling settings for this attribute
FromTableArn(Construct, String, String)
Creates a Table construct that represents an external table via table arn.
public static ITable FromTableArn(Construct scope, string id, string tableArn)
Parameters
- scope Constructs.Construct
The parent creating construct (usually
this
).- id System.String
The construct's name.
- tableArn System.String
The table's ARN.
Returns
FromTableAttributes(Construct, String, ITableAttributes)
Creates a Table construct that represents an external table.
public static ITable FromTableAttributes(Construct scope, string id, ITableAttributes attrs)
Parameters
- scope Constructs.Construct
The parent creating construct (usually
this
).- id System.String
The construct's name.
- attrs ITableAttributes
A
TableAttributes
object.
Returns
FromTableName(Construct, String, String)
Creates a Table construct that represents an external table via table name.
public static ITable FromTableName(Construct scope, string id, string tableName)
Parameters
- scope Constructs.Construct
The parent creating construct (usually
this
).- id System.String
The construct's name.
- tableName System.String
The table's name.
Returns
Schema(String)
Get schema attributes of table or index.
public virtual ISchemaOptions Schema(string indexName = null)
Parameters
- indexName System.String
Returns
Schema of table or index.