Skip to content

Commit

Permalink
Added a small fix to be compatible with localstack (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
yildizadem authored Nov 1, 2024
1 parent 155c5dc commit 6be543f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,23 @@ custom:
# noStart: true
```

Localstack setup:
```yaml
custom:
serverless-dynamodb:
# If you only want to use DynamoDB Local in some stages, declare them here
stages:
- dev
start:
# The port that your localstack is running on
port: 4566
migrate: true
seed: true
noStart: true
# Beware, region is important for localstack
region: 'eu-west-1'
```

### Migrations: serverless dynamodb migrate

#### Configuration
Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface Config {
host?: string;
port?: number;
seed?: boolean | string;
region?: string;
},
stages?: string[],
seed?: SeedConfig;
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class ServerlessDynamoDBPlugin implements Plugin {
} else {
dynamoOptions = {
endpoint: `http://${this.host}:${this.port}`,
region: 'localhost',
region: this.config?.start?.region ?? 'localhost',
credentials: {
accessKeyId: 'MockAccessKeyId',
secretAccessKey: 'MockSecretAccessKey',
Expand Down

0 comments on commit 6be543f

Please sign in to comment.