Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DynamoDb - How to create dynamodb table with Columns(attribute name/type)?

See original GitHub issue
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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

skinny85commented, Dec 13, 2019

@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.

sacagcommented, Dec 17, 2019

@skinny85 - Thanks for the response. Working as expected. CDK will create the table(schemaless) with indexes and keys. Attributes can be added at runtime.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS::DynamoDB::Table - AWS CloudFormation
A list of attributes that describe the key schema for the table and indexes. This property is required to create a DynamoDB table....
Read more >
Step 1 - Create the DynamoDB table
Step 1 - Create the DynamoDB table. Run the following AWS CLI command to create the first DynamoDB table called logfile : aws...
Read more >
Working With DynamoDB Columns/Attributes [incl. Examples]
In order to add attributes, you need to first create a table. You can use AWS Console, AWS CLI, AWS SDK, or the...
Read more >
Step 1 - Create the replica table - Amazon DynamoDB Labs
DynamoDB stream with Lambda. Let's create a table ... aws dynamodb create-table --table-name logfile_replica ... Attribute Name (Type), Special Attribute?
Read more >
Terraform dynamodb error - all attributes must be indexed
That error message is a bit misleading. You should only define the indexed attributes when you are creating the table. Since DynamoDB is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found