DynamoDB and TableNameOverride with prefix

前端 未结 3 1605
[愿得一人]
[愿得一人] 2021-02-20 01:54

I am testing DynamoDB tables and want to set up different table names for prod and dev environment using the prefix \"dev_\" for development.

I made this test to print t

3条回答
  •  梦如初夏
    2021-02-20 02:56

    withTableNamePrefix is a static method. So this line is creating a new instance of TableNameOverride with the String "test", and then throwing that instance away by using it to call the static withTableNamePrefix method:

    TableNameOverride tbl = new TableNameOverride("test").withTableNamePrefix("dev_");
    

    To answer the deeper question of separating test from prod, I would recommend having 2 separate AWS Accounts entirely, one for dev and one for prod. This is the only way you can:

    • See billing separately
    • Ensure you never leak data between prod and test systems
    • Have high scaling on a dev table prevent you from scaling a prod table higher

提交回复
热议问题