We\'re starting to use DynamoDB, and want separate environments for dev/staging/production. We can\'t figure out a natural way to do this---do we just create separate AWS ac
I can't understand why there is'nt a AWS solution for handling DB-versions like production and test in DynamoDB!? Having multiple AWS accounts is a hassle.
It also becomes a big problem to prefix the table names if you get the items by using the c# class attribute [DynamoDBTable("Users")] and fetching the data with DynamoDBContext.Load
As attributes values can't change during runtime I ended up with this soluting using conditonal compilation symbols and setting constants that can be used as the class attribute value.
public static class DynamoDbTablesConfiguration
{
#if Debug
public const string UserTable = "Users_Dev";
#endif
#if Release
public const string UserTable = "Users_Production";
#endif
}
[DynamoDBTable(DynamoDbTablesConfiguration.UserTable)]
public class User
{
}
Make sure you set the "conditonal compilation symbols" value by right click on project > Properties > Build > "conditonal compilation symbols".
Not a perfect solution but I don't see any other options here if I don't want to create another AWS account.