DynamoDb - How to create dynamodb table with Columns(attribute name/type)?
var table = new Table(this, "UniqueTable", new TableProps
{
TableName = "UniqueTableName",
PartitionKey = new Attribute { Name = "EventMessageID", Type = AttributeType.STRING},
});
This construct doesn't have any way to create columns (name and type). Any idea how to accomplish that, so that I do not have to write the cloudformation manually? I am referring to .NET(C#) CDK. Thanks
Hi sacag,
As I know, regarding the non-relational database concepts, you need not to create columns. It will be set as long as you start to add value there according with your json object.
Ps.: Could you edit your question fixing the code markdown?
Cheers, Brenno
You can define the attribute of a table on CloudFormation @beuleal
@pushthat - exactly, I saw that. But, is there a code sample for this in C#? Also, if that's the case then I do not see the "AttributeDefinitions" property in the AWS CDK "Table" construct. It has to be done using the CFnTable? Why is "Table" construct missing this property? or there is some other way to define columns.
@SomayaB @skinny85 - Any idea on this yet? Is this really an issue and if it is any timeline on when will it be fixed?
@sacag attributes are only needed for things that are part of either keys (like the hash and sort keys), or indexes. For everything else, there are no attributes (DynamoDB is schemaless).
You define the keys when creating the Table. You add indexes with instance methods on the created table.
@skinny85 - Thanks for the response. Working as expected. CDK will create the table(schemaless) with indexes and keys. Attributes can be added at runtime.
Glad we got this sorted out :)
can i add data into dynamodb table through cdk
please let me help
help me out to create a table