def _create_dynamodb_table()

in ec2-provider/ec2_provider/todo_app_stack.py [0:0]


    def _create_dynamodb_table(self) -> dynamodb.Table:
        """Create a DynamoDB table for use with the Todo application.

        Note, there is a tight coupling between the table_name and partition_key and the applicaiton
        code which lives in the `user-data.sh` file. Do not change the table_name or partition_key
        without also updating the application code. As this is merely an example, it's best to
        leave this configuration as-is.

        """
        table = dynamodb.Table(
            self,
            "todo-table",
            partition_key=dynamodb.Attribute(name="id", type=dynamodb.AttributeType.STRING),
            billing_mode=dynamodb.BillingMode.PAY_PER_REQUEST,
            table_name='TodoTable',
            removal_policy=core.RemovalPolicy.DESTROY,
        )
        return table