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
and [moto](https://github.com/spulec/moto). While these tools are *awesome* (!), they lack functionality
65
-
for certain use cases. *LocalStack* combines the tools, makes them interoperable, and adds important
65
+
for certain use cases. LocalStack combines the tools, makes them interoperable, and adds important
66
66
missing functionality on top of them:
67
67
68
-
***Error injection:***LocalStack* allows to inject errors frequently occurring in real Cloud environments,
68
+
***Error injection:** LocalStack allows to inject errors frequently occurring in real Cloud environments,
69
69
for instance `ProvisionedThroughputExceededException` which is thrown by Kinesis or DynamoDB if the amount of
70
70
read/write throughput is exceeded.
71
-
***Isolated processes**: All services in *LocalStack* run in separate processes. The overhead of additional
71
+
***Isolated processes**: All services in LocalStack run in separate processes. The overhead of additional
72
72
processes is negligible, and the entire stack can easily be executed on any developer machine and CI server.
73
73
In moto, components are often hard-wired in RAM (e.g., when forwarding a message on an SNS topic to an SQS queue,
74
-
the queue endpoint is looked up in a local hash map). In contrast, *LocalStack* services live in isolation
74
+
the queue endpoint is looked up in a local hash map). In contrast, LocalStack services live in isolation
75
75
(separate processes available via HTTP), which fosters true decoupling and more closely resembles the real
76
76
cloud environment.
77
-
***Pluggable services**: All services in *LocalStack* are easily pluggable (and replaceable), due to the fact that
77
+
***Pluggable services**: All services in LocalStack are easily pluggable (and replaceable), due to the fact that
78
78
we are using isolated processes for each service. This allows us to keep the framework up-to-date and select
79
79
best-of-breed mocks for each individual service.
80
80
81
81
82
82
## Requirements
83
83
84
-
*`make`
85
84
*`python` (both Python 2.x and 3.x supported)
86
85
*`pip` (python package manager)
87
-
*`npm` (node.js package manager)
88
-
*`java`/`javac` (Java 8 runtime environment and compiler)
89
-
*`mvn` (Maven, the build system for Java)
86
+
*`Docker`
90
87
91
88
## Installing
92
89
93
-
The easiest way to install *LocalStack* is via `pip`:
90
+
The easiest way to install LocalStack is via `pip`:
94
91
95
92
```
96
93
pip install localstack
97
94
```
98
95
99
-
Once installed, run the infrastructure using the following command:
100
-
```
101
-
localstack start
102
-
```
103
-
104
-
**Note**: Please do **not** use `sudo` or the `root` user - *LocalStack*
105
-
should be installed and started entirely under a local non-root user.
106
-
If you have problems with permissions in MacOS X Sierra,
107
-
install with `pip install --user localstack`
96
+
**Note**: Please do **not** use `sudo` or the `root` user - LocalStack
97
+
should be installed and started entirely under a local non-root user. If you have problems
98
+
with permissions in MacOS X Sierra, install with `pip install --user localstack`
108
99
109
100
## Running in Docker
110
101
111
-
You can also spin up *LocalStack* in Docker:
102
+
By default, LocalStack gets started inside a Docker container using this command:
112
103
113
104
```
114
-
localstack start --docker
105
+
localstack start
115
106
```
116
107
117
108
(Note that on MacOS you may have to run `TMPDIR=/private$TMPDIR localstack start --docker` if
118
109
`$TMPDIR` contains a symbolic link that cannot be mounted by Docker.)
119
110
120
-
Or using docker-compose (you need to clone the repository first, currently requires docker-compose version 2.1+):
111
+
### Using `docker-compose`
112
+
113
+
You can also use the `docker-compose.yml` file from the repository and use this command (currently requires `docker-compose` version 2.1+):
121
114
122
115
```
123
116
docker-compose up
@@ -151,6 +144,22 @@ services:
151
144
152
145
To facilitate interoperability, configuration variables can be prefixed with `LOCALSTACK_` in docker. For instance, setting `LOCALSTACK_SERVICES=s3` is equivalent to `SERVICES=s3`.
153
146
147
+
## Starting locally (non-Docker mode)
148
+
149
+
Alternatively, the infrastructure can be spun up on the local host machine (without using Docker) using the following command:
150
+
151
+
```
152
+
localstack start --host
153
+
```
154
+
155
+
(Note that this will require [additional dependencies](#Developing), and currently is not supported on some operating systems, including Windows.)
156
+
157
+
LocalStack will attempt to automatically fetch the missing dependencies when you first start it up in "host" mode; alternatively, you can use the `full` profile to install all dependencies at `pip` installation time:
158
+
159
+
```
160
+
pip install localstack[full]
161
+
```
162
+
154
163
## Configurations
155
164
156
165
You can pass the following environment variables to LocalStack:
@@ -181,7 +190,7 @@ You can pass the following environment variables to LocalStack:
181
190
-`docker`: run each function invocation in a separate Docker container
182
191
-`docker-reuse`: create one Docker container per function and reuse it across invocations
183
192
184
-
For `docker` and `docker-reuse`, if *LocalStack* itself is started inside Docker, then
193
+
For `docker` and `docker-reuse`, if LocalStack itself is started inside Docker, then
185
194
the `docker` command needs to be available inside the container (usually requires to run the
186
195
container in privileged mode). Default is `docker`, fallback to `local` if Docker is not available.
187
196
*`LAMBDA_REMOTE_DOCKER` determines whether Lambda code is copied or mounted into containers.
**NEW**: Check out [awslocal](https://github.com/localstack/awscli-local), a thin CLI wrapper that runs commands directly against *LocalStack* (no need to
282
-
specify `--endpoint-url` anymore). Install it via `pip install awscli-local`, and then use it as follows:
290
+
**NEW**: Check out [awslocal](https://github.com/localstack/awscli-local), a thin CLI wrapper
291
+
that runs commands directly against LocalStack (no need to specify `--endpoint-url` anymore).
292
+
Install it via `pip install awscli-local`, and then use it as follows:
283
293
284
294
```
285
295
awslocal kinesis list-streams
@@ -299,7 +309,7 @@ inside your Lambda function. See [Configurations](#Configurations) section for m
299
309
300
310
## Integration with nosetests
301
311
302
-
If you want to use *LocalStack* in your integration tests (e.g., nosetests), simply fire up the
312
+
If you want to use LocalStack in your integration tests (e.g., nosetests), simply fire up the
303
313
infrastructure in your test setup method and then clean up everything in your teardown method:
304
314
305
315
```
@@ -337,7 +347,7 @@ In order to mount a local folder, ensure that `LAMBDA_REMOTE_DOCKER` is set to `
337
347
338
348
## Integration with Java/JUnit
339
349
340
-
In order to use *LocalStack* with Java, the project ships with a simple JUnit runner and a JUnit 5 extension. Take a look
350
+
In order to use LocalStack with Java, the project ships with a simple JUnit runner and a JUnit 5 extension. Take a look
341
351
at the example JUnit test in `ext/java`. When you run the test, all dependencies are automatically
342
352
downloaded and installed to a temporary directory in your system.
343
353
@@ -368,8 +378,8 @@ public class MyCloudAppTest {
368
378
}
369
379
```
370
380
371
-
Additionally, there is a version of the *LocalStack* Test Runner which runs in a docker container
372
-
instead of installing *LocalStack* on the current machine. The only dependency is to have docker
381
+
Additionally, there is a version of the LocalStack Test Runner which runs in a docker container
382
+
instead of installing LocalStack on the current machine. The only dependency is to have docker
373
383
installed locally. The test runner will automatically pull the image and start the container for the
374
384
duration of the test. The container can be configured by using the @LocalstackDockerProperties annotation.
375
385
@@ -396,7 +406,7 @@ public class MyDockerCloudAppTest {
396
406
}
397
407
```
398
408
399
-
The *LocalStack* JUnit test runner is published as an artifact in Maven Central.
409
+
The LocalStack JUnit test runner is published as an artifact in Maven Central.
400
410
Simply add the following dependency to your `pom.xml` file:
401
411
402
412
```
@@ -443,7 +453,7 @@ with the `--user` flag: `pip install --user localstack`
443
453
444
454
* If you are deploying within OpenShift, please be aware: the pod must run as `root`, and the user must have capabilities added to the running pod, in order to allow Elasticsearch to be run as the non-root `localstack` user.
445
455
446
-
* The environment variable `no_proxy` is rewritten by *LocalStack*.
456
+
* The environment variable `no_proxy` is rewritten by LocalStack.
447
457
(Internal requests will go straight via localhost, bypassing any proxy configuration).
448
458
449
459
* For troubleshooting LocalStack start issues, you can check debug logs by running `DEBUG=1 localstack start`
@@ -454,6 +464,17 @@ with the `--user` flag: `pip install --user localstack`
454
464
455
465
## Developing
456
466
467
+
### Requirements for developing or starting locally
468
+
469
+
To develop new features, or to start the stack locally (outside of Docker), the following additional tools are required:
470
+
471
+
*`make`
472
+
*`npm` (node.js package manager)
473
+
*`java`/`javac` (Java 8 runtime environment and compiler)
474
+
*`mvn` (Maven, the build system for Java)
475
+
476
+
### Development Environment
477
+
457
478
If you pull the repo in order to extend/modify LocalStack, run this command to install
458
479
all the dependencies:
459
480
@@ -502,7 +523,7 @@ localstack web
502
523
503
524
## Change Log
504
525
505
-
* v0.10.0: Lazy loading of libraries;
526
+
* v0.10.0: Lazy loading of libraries; fix handling of regions; add API multiserver; improve CPU profiling; fix ES xpack installation; add basic EventBridge support; refactor Lambda API and executor; add MessageAttributes on SNS payloads; tagging for SNS; ability to customize docker command
506
527
* v0.9.6: Add API Gateway SQS proxy; fix command to push Docker image; fix Docker bridge IP configuration; fix SSL issue in dashboard infra; updates to README
507
528
* v0.9.5: Reduce Docker image size by squashing; fix response body for presigned URL S3 PUT requests; fix CreateDate returned by IAM; fix account IDs for CF and SNS; fix topic checks for SMS using SNS; improve documentation around `@LocalstackDockerProperties`; add basic EC2 support; upgrade to ElasticSearch 6.7; set Last-Modified header in S3; preserve logic with uppercase event keys in Java; add support for nodejs 10.x Lambdas
508
529
* v0.9.4: Fix ARNs in CloudFormation deployments; write stderr to file in supervisord; fix Lambda invocation times; fix canonicalization of service names when running in Docker; add support for `@Nested` in Junit5; add support for batch/transaction in DynamoDB; fix output buffering for subprocesses; assign unique ports under docker-reuse; check if topic ARN exists before publish
@@ -619,11 +640,11 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
619
640
620
641
## License
621
642
622
-
Copyright (c) 2017-2019 *LocalStack* maintainers and contributors.
643
+
Copyright (c) 2017-2019 LocalStack maintainers and contributors.
623
644
624
645
Copyright (c) 2016 Atlassian and others.
625
646
626
-
This version of *LocalStack* is released under the Apache License, Version 2.0 (see LICENSE.txt).
647
+
This version of LocalStack is released under the Apache License, Version 2.0 (see LICENSE.txt).
627
648
By downloading and using this software you agree to the
0 commit comments