For testing with dynamodb-local I'm able to override the host and region using global settings, but not aws_secret_key_id and aws_secret_access_key.
As I understand it, the workarounds are either
- Specify them on every
Meta class (hardcoded in this example, would come from shared config file in a real application)
class WidgetModel(Model):
class Meta:
table_name = "widgets"
aws_access_key_id = "bogus"
aws_secret_access_key = "bogus"
- Set them as environment variables before running the process
export AWS_SECRET_KEY_ID=bogus
export AWS_SECRET_ACCESS_KEY=bogus
(this is what pynamodb itself does for unit tests)