Skip to content

Commit 35b9d57

Browse files
author
aws-amplify-bot
committed
fix: dynamoDb creds
1 parent 85f572e commit 35b9d57

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • packages/amplify-appsync-simulator/src/data-loader/dynamo-db

packages/amplify-appsync-simulator/src/data-loader/dynamo-db/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,17 @@ export class DynamoDBDataLoader implements AmplifyAppSyncSimulatorDataLoader {
2929
private tableName: string;
3030

3131
constructor(private ddbConfig: DynamoDBLoaderConfig) {
32-
const { tableName, endpoint } = ddbConfig.config;
32+
const { tableName, endpoint, credentials } = ddbConfig.config;
3333
if (!tableName || !endpoint) {
3434
throw new Error(`Invalid DynamoDBConfig ${JSON.stringify(ddbConfig, null, 4)}`);
3535
}
3636
this.tableName = tableName;
37-
this.client = new DynamoDBClient({ ...ddbConfig.config, ...ddbConfig.options });
37+
this.client = new DynamoDBClient({
38+
endpoint,
39+
region: ddbConfig.config.region,
40+
credentials,
41+
...ddbConfig.options,
42+
});
3843
}
3944

4045
async load(payload): Promise<object | null> {

0 commit comments

Comments
 (0)