You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+
## Our Standards
8
+
9
+
Examples of behavior that contributes to creating a positive environment include:
10
+
11
+
* Using welcoming and inclusive language
12
+
* Being respectful of differing viewpoints and experiences
13
+
* Gracefully accepting constructive criticism
14
+
* Focusing on what is best for the community
15
+
* Showing empathy towards other community members
16
+
17
+
Examples of unacceptable behavior by participants include:
18
+
19
+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20
+
* Trolling, insulting/derogatory comments, and personal or political attacks
21
+
* Public or private harassment
22
+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23
+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24
+
25
+
## Our Responsibilities
26
+
27
+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28
+
29
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30
+
31
+
## Scope
32
+
33
+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34
+
35
+
## Enforcement
36
+
37
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38
+
39
+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40
+
41
+
## Attribution
42
+
43
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
Copy file name to clipboardExpand all lines: README.md
+30-2Lines changed: 30 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ serverless-dynamodb-local
3
3
4
4
[](https://gitter.im/99xt/serverless-dynamodb-local?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
--sharedDb -h DynamoDB will use a single database file, instead of using separate files for each credential and region. If you specify -sharedDb, all DynamoDB clients will interact with the same set of tables regardless of their region and credential configuration.
52
52
--delayTransientStatuses -t Causes DynamoDB to introduce delays for certain operations. DynamoDB can perform some tasks almost instantaneously, such as create/update/delete operations on tables and indexes; however, the actual DynamoDB service requires more time for these tasks. Setting this parameter helps DynamoDB simulate the behavior of the Amazon DynamoDB web service more closely. (Currently, this parameter introduces delays only for global secondary indexes that are in either CREATING or DELETING status.)
53
53
--optimizeDbBeforeStartup -o Optimizes the underlying database tables before starting up DynamoDB on your computer. You must also specify -dbPath when you use this parameter.
54
+
--migration -m After starting dynamodb local, run dynamodb migrations.
55
+
--heapInitial The initial heap size
56
+
--heapMax The maximum heap size
54
57
--migrate -m After starting DynamoDB local, create DynamoDB tables from the Serverless configuration.
55
58
--seed -s After starting and migrating dynamodb local, injects seed data into your tables. The --seed option determines which data categories to onload.
59
+
--convertEmptyValues -e Set to true if you would like the document client to convert empty values (0-length strings, binary buffers, and sets) to be converted to NULL types when persisting to DynamoDB.
56
60
```
57
61
58
62
All the above options can be added to serverless.yml to set default configuration: e.g.
59
63
60
64
```yml
61
65
custom:
62
66
dynamodb:
67
+
# If you only want to use DynamoDB Local in some stages, declare them here
68
+
stages:
69
+
- dev
63
70
start:
64
71
port: 8000
65
72
inMemory: true
73
+
heapInitial: 200m
74
+
heapMax: 1g
66
75
migrate: true
67
76
seed: true
77
+
convertEmptyValues: true
78
+
# Uncomment only if you already have a DynamoDB running locally
79
+
# noStart: true
68
80
```
69
81
70
82
## Migrations: sls dynamodb migrate
@@ -95,13 +107,18 @@ resources:
95
107
WriteCapacityUnits: 1
96
108
```
97
109
110
+
**Note:**
111
+
DynamoDB local doesn't support TTL specification, therefore plugin will simply ignore ttl configuration from Cloudformation template.
112
+
98
113
## Seeding: sls dynamodb seed
99
114
### Configuration
100
115
101
116
In `serverless.yml` seeding categories are defined under `dynamodb.seed`.
102
117
103
118
If `dynamodb.start.seed` is true, then seeding is performed after table migrations.
104
119
120
+
If you wish to use raw AWS AttributeValues to specify your seed data instead of Javascript types then simply change the variable of any such json files from `sources:` to `rawsources:`.
121
+
105
122
```yml
106
123
dynamodb:
107
124
start:
@@ -117,7 +134,7 @@ dynamodb:
117
134
test:
118
135
sources:
119
136
- table: users
120
-
sources: [./fake-test-users.json]
137
+
rawsources: [./fake-test-users.json]
121
138
- table: subscriptions
122
139
sources: [./fake-test-subscriptions.json]
123
140
```
@@ -181,6 +198,17 @@ Make sure that `serverless-dynamodb-local` is above `serverless-offline` so it w
181
198
182
199
Now your local DynamoDB database will be automatically started before running `serverless offline`.
183
200
201
+
### Using with serverless-offline and serverless-webpack plugin
202
+
Run `serverless offline start`. In comparison with `serverless offline`, the `start` command will fire an `init` and a `end` lifecycle hook which is needed for serverless-offline and serverless-dynamodb-local to switch off both ressources.
203
+
204
+
Add plugins to your `serverless.yml` file:
205
+
```yaml
206
+
plugins:
207
+
- serverless-webpack
208
+
- serverless-dynamodb-local
209
+
- serverless-offline #serverless-offline needs to be last in the list
0 commit comments