Skip to content

Commit 0dfd778

Browse files
authored
Merge pull request #78 from Scale93/master
2 parents a524bbc + 6129732 commit 0dfd778

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ Put options under `custom.appsync-simulator` in your `serverless.yml` file
6767
| dynamoDb.region | localhost | Dynamodb region. Specify it if you're connecting to a remote Dynamodb intance. |
6868
| dynamoDb.accessKeyId | DEFAULT_ACCESS_KEY | AWS Access Key ID to access DynamoDB |
6969
| dynamoDb.secretAccessKey | DEFAULT_SECRET | AWS Secret Key to access DynamoDB |
70+
| dynamoDb.sessionToken | DEFAULT_ACCESS_TOKEEN | AWS Session Token to access DynamoDB, only if you have temporary security credentials configured on AWS |
71+
| dynamoDb.* | | You can add every configuration accepted by [DynamoDB SDK](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html#constructor-property) |
7072
| watch | - \*.graphql<br/> - \*.vtl | Array of glob patterns to watch for hot-reloading. |
7173

7274
Example:

src/__tests__/__snapshots__/getAppSyncConfig.js.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ Array [
128128
"endpoint": "http://localhost:8000",
129129
"region": "localhost",
130130
"secretAccessKey": "DEFAULT_SECRET",
131+
"sessionToken": "DEFAULT_SESSION_TOKEN",
131132
"tableName": "myTable",
132133
},
133134
"name": "dynamodb",

src/__tests__/getAppSyncConfig.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ describe('getAppSyncConfig', () => {
104104
region: 'localhost',
105105
accessKeyId: 'DEFAULT_ACCESS_KEY',
106106
secretAccessKey: 'DEFAULT_SECRET',
107+
sessionToken: 'DEFAULT_SESSION_TOKEN',
107108
},
108109
},
109110
serverless: {

src/getAppSyncConfig.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,10 @@ export default function getAppSyncConfig(context, appSyncConfig) {
5454

5555
switch (source.type) {
5656
case 'AMAZON_DYNAMODB': {
57-
const {
58-
endpoint,
59-
region,
60-
accessKeyId,
61-
secretAccessKey,
62-
} = context.options.dynamoDb;
63-
6457
return {
6558
...dataSource,
6659
config: {
67-
endpoint,
68-
region,
69-
accessKeyId,
70-
secretAccessKey,
60+
...context.options.dynamoDb,
7161
tableName: source.config.tableName,
7262
},
7363
};

0 commit comments

Comments
 (0)