Skip to content

Commit ee3c93a

Browse files
rename aws-replicator extension to aws-proxy (#103)
Co-authored-by: Nikos <nikos.michas@localstack.cloud>
1 parent b4576b4 commit ee3c93a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+139
-777
lines changed

.github/workflows/aws-replicator.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
name: LocalStack AWS Replicator Extension Tests
1+
name: LocalStack AWS Proxy Extension Tests
22

33
on:
44
push:
55
paths:
6-
- aws-replicator/**
6+
- aws-proxy/**
77
branches:
88
- main
99
pull_request:
1010
paths:
11-
- .github/workflows/aws-replicator.yml
12-
- aws-replicator/**
11+
- .github/workflows/aws-proxy.yml
12+
- aws-proxy/**
1313
workflow_dispatch:
1414

1515
jobs:
@@ -49,7 +49,7 @@ jobs:
4949
# build and install extension
5050
localstack extensions init
5151
(
52-
cd aws-replicator
52+
cd aws-proxy
5353
make install
5454
. .venv/bin/activate
5555
pip install --upgrade --pre localstack localstack-ext
@@ -68,7 +68,7 @@ jobs:
6868
6969
- name: Run linter
7070
run: |
71-
cd aws-replicator
71+
cd aws-proxy
7272
(. .venv/bin/activate; pip install --upgrade --pre localstack localstack-ext)
7373
make lint
7474
@@ -78,7 +78,7 @@ jobs:
7878
AWS_ACCESS_KEY_ID: ${{ secrets.TEST_AWS_ACCESS_KEY_ID }}
7979
AWS_SECRET_ACCESS_KEY: ${{ secrets.TEST_AWS_SECRET_ACCESS_KEY }}
8080
run: |
81-
cd aws-replicator
81+
cd aws-proxy
8282
make test
8383
8484
- name: Deploy and test sample app
@@ -88,7 +88,7 @@ jobs:
8888
AWS_SECRET_ACCESS_KEY: ${{ secrets.TEST_AWS_SECRET_ACCESS_KEY }}
8989
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
9090
run: |
91-
cd aws-replicator/example
91+
cd aws-proxy/example
9292
make test
9393
9494
- name: Print LocalStack logs

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
### Extensions ###
1313
######################
1414

15-
/aws-replicator/ @whummer
15+
/aws-proxy/ @whummer @nik-localstack
1616
/diagnosis-viewer/ @thrau @silv-io
1717
/hello-world/ @lukqw @thrau
1818
/http-bin/ @thrau @dominikschubert

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,16 @@ $ localstack extensions install "git+https://github.com/localstack/localstack-ex
6565
Here is the current list of extensions developed by the LocalStack team and their support status.
6666
You can install the respective extension by calling `localstack install <Install name>`.
6767

68-
| Extension | Install name | Version | Support status |
69-
| --------- | ------------ | ------- | -------------- |
70-
| [AWS replicator](https://github.com/localstack/localstack-extensions/tree/main/aws-replicator) | localstack-extension-aws-replicator | 0.1.7 | Experimental |
71-
| [Diagnosis Viewer](https://github.com/localstack/localstack-extensions/tree/main/diagnosis-viewer) | localstack-extension-diagnosis-viewer | 0.1.0 | Stable |
72-
| [Hello World](https://github.com/localstack/localstack-extensions/tree/main/hello-world) | localstack-extension-hello-world | 0.1.0 | Stable |
73-
| [httpbin](https://github.com/localstack/localstack-extensions/tree/main/httpbin) | localstack-extension-httpbin | 0.1.0 | Stable |
74-
| [MailHog](https://github.com/localstack/localstack-extensions/tree/main/mailhog) | localstack-extension-mailhog | 0.1.0 | Stable |
75-
| [Miniflare](https://github.com/localstack/localstack-extensions/tree/main/miniflare) | localstack-extension-miniflare | 0.1.0 | Experimental |
76-
| [Stripe](https://github.com/localstack/localstack-extensions/tree/main/stripe) | localstack-extension-stripe | 0.2.0 | Stable |
77-
| [Terraform Init](https://github.com/localstack/localstack-extensions/tree/main/terraform-init) | localstack-extension-terraform-init | 0.2.0 | Experimental |
68+
| Extension | Install name | Version | Support status |
69+
|----------------------------------------------------------------------------------------------------| ------------ |---------| -------------- |
70+
| [AWS Proxy](https://github.com/localstack/localstack-extensions/tree/main/aws-proxy) | localstack-extension-aws-proxy | 0.2.0 | Experimental |
71+
| [Diagnosis Viewer](https://github.com/localstack/localstack-extensions/tree/main/diagnosis-viewer) | localstack-extension-diagnosis-viewer | 0.1.0 | Stable |
72+
| [Hello World](https://github.com/localstack/localstack-extensions/tree/main/hello-world) | localstack-extension-hello-world | 0.1.0 | Stable |
73+
| [httpbin](https://github.com/localstack/localstack-extensions/tree/main/httpbin) | localstack-extension-httpbin | 0.1.0 | Stable |
74+
| [MailHog](https://github.com/localstack/localstack-extensions/tree/main/mailhog) | localstack-extension-mailhog | 0.1.0 | Stable |
75+
| [Miniflare](https://github.com/localstack/localstack-extensions/tree/main/miniflare) | localstack-extension-miniflare | 0.1.0 | Experimental |
76+
| [Stripe](https://github.com/localstack/localstack-extensions/tree/main/stripe) | localstack-extension-stripe | 0.2.0 | Stable |
77+
| [Terraform Init](https://github.com/localstack/localstack-extensions/tree/main/terraform-init) | localstack-extension-terraform-init | 0.2.0 | Experimental |
7878

7979

8080
## Developing Extensions

aws-proxy/MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
recursive-include aws_proxy *.html
2+
recursive-include aws_proxy *.js
3+
recursive-include aws_proxy *.png
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ dist: venv
4040

4141
build: ## Build the extension
4242
mkdir -p build
43-
cp -r setup.py setup.cfg README.md aws_replicator build/
43+
cp -r setup.py setup.cfg README.md aws_proxy build/
4444
(cd build && python setup.py sdist)
4545

46-
enable: $(wildcard ./build/dist/localstack_extension_aws_replicator-*.tar.gz) ## Enable the extension in LocalStack
46+
enable: $(wildcard ./build/dist/localstack_extension_aws_proxy-*.tar.gz) ## Enable the extension in LocalStack
4747
$(VENV_RUN); \
48-
pip uninstall --yes localstack-extension-aws-replicator; \
48+
pip uninstall --yes localstack-extension-aws-proxy; \
4949
localstack extensions -v install file://$?
5050

5151
publish: clean-dist venv dist
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
AWS Cloud Proxy Extension (experimental)
22
========================================
3-
[![Install LocalStack Extension](https://localstack.cloud/gh/extension-badge.svg)](https://app.localstack.cloud/extensions/remote?url=git+https://github.com/localstack/localstack-extensions/#egg=localstack-extension-aws-replicator&subdirectory=aws-replicator)
3+
[![Install LocalStack Extension](https://localstack.cloud/gh/extension-badge.svg)](https://app.localstack.cloud/extensions/remote?url=git+https://github.com/localstack/localstack-extensions/#egg=localstack-extension-aws-proxy&subdirectory=aws-proxy)
44

55
A LocalStack extension to proxy and integrate AWS resources into your local machine.
66
This enables one flavor of "hybrid" or "remocal" setups where you can easily bridge the gap between LocalStack (local resources) and remote AWS (resources in the real cloud).
77

88
⚠️ Please note that this extension is experimental and still under active development.
99

10-
⚠️ Note: Given that the scope of this extension has recently changed (see [below](#resource-replicator-cli-deprecated)), it may get renamed from `aws-replicator` to `cloud-proxy` in an upcoming release.
10+
⚠️ Note: Given that the scope of this extension has recently changed (see [below](#resource-replicator-cli-deprecated)) - it has been renamed from `aws-replicator` to `aws-proxy`.
1111

1212
## Prerequisites
1313

@@ -33,11 +33,11 @@ For example, in order to forward all API calls for DynamoDB/S3/Cognito to real A
3333
```
3434
$ localstack start -d
3535
```
36-
2. Enable LocalStack AWS replicator from the Web Application Extension Library
36+
2. Enable LocalStack AWS Proxy from the Web Application Extension Library
3737
3. After installation restart Localstack
38-
4. Install the AWS replicator CLI package
38+
4. Install the AWS Proxy CLI package
3939
```
40-
$ pip install localstack-extension-aws-replicator
40+
$ pip install localstack-extension-aws-proxy
4141
```
4242
5. Configure real cloud account credentials in a new terminal session to allow access
4343
```
@@ -53,12 +53,12 @@ $ localstack aws proxy -s dynamodb,s3,cognito-idp
5353

5454
1. Start Localstack with extra CORS
5555
```
56-
EXTRA_CORS_ALLOWED_ORIGINS=https://aws-replicator.localhost.localstack.cloud:4566 localstack start -d
56+
EXTRA_CORS_ALLOWED_ORIGINS=https://aws-proxy.localhost.localstack.cloud:4566 localstack start -d
5757
```
5858

59-
2. Enable Localstack AWS replicator from the Web Application Extension Library
59+
2. Enable Localstack AWS Proxy from the Web Application Extension Library
6060

61-
3. Once the extension is installed, it will expose a small configuration endpoint in your LocalStack container under the following endpoint: http://localhost:4566/_localstack/aws-replicator/index.html .
61+
3. Once the extension is installed, it will expose a small configuration endpoint in your LocalStack container under the following endpoint: http://localhost:4566/_localstack/aws-proxy/index.html .
6262

6363
4. Use this Web UI to define the proxy configuration (in YAML syntax), as well as the AWS credentials (AWS access key ID, secret access key, and optionally session token) and save configuration. The proxy should report enabled state and on the host a proxy container should spawn.
6464

@@ -111,22 +111,23 @@ A more comprehensive sample, involving local Lambda functions combined with remo
111111
### Configuration
112112

113113
In addition to the proxy services configuration shown above, the following configs can be used to customize the behavior of the extension itself (simply pass them as environment variables to the main LocalStack container):
114-
* `REPLICATOR_CLEANUP_PROXY_CONTAINERS`: whether to clean up (remove) the proxy Docker containers once they shut down (default `1`). Can be set to `0` to help debug issues, e.g., if a proxy container starts up and exits immediately.
115-
* `REPLICATOR_LOCALSTACK_HOST`: the target host to use when the proxy container connects to the LocalStack main container (automatically determined by default)
116-
* `REPLICATOR_PROXY_DOCKER_FLAGS`: additional flags that should be passed when creating the proxy Docker containers
114+
* `PROXY_CLEANUP_CONTAINERS`: whether to clean up (remove) the proxy Docker containers once they shut down (default `1`). Can be set to `0` to help debug issues, e.g., if a proxy container starts up and exits immediately.
115+
* `PROXY_LOCALSTACK_HOST`: the target host to use when the proxy container connects to the LocalStack main container (automatically determined by default)
116+
* `PROXY_DOCKER_FLAGS`: additional flags that should be passed when creating the proxy Docker containers
117117

118118
**Note:** Due to some recent changes in the core framework, make sure to start up your LocalStack container with the `GATEWAY_SERVER=hypercorn` configuration enabled, for backwards compatibility. This will be fixed in an upcoming release.
119119

120120
## Resource Replicator CLI (deprecated)
121121

122122
Note: Previous versions of this extension also offered a "replicate" mode to copy/clone (rather than proxy) resources from an AWS account into the local instance.
123-
This functionality has been removed from this extension, and is now being migrated to a new extension (more details following soon).
123+
This functionality has been removed from this extension, and is now available directly in the LocalStack Pro image (see [here](https://docs.localstack.cloud/aws/tooling/aws-replicator)).
124124

125125
If you wish to access the deprecated instructions, they can be found [here](https://github.com/localstack/localstack-extensions/blob/fe0c97e8a9d94f72c80358493e51ce6c1da535dc/aws-replicator/README.md#resource-replicator-cli).
126126

127127
## Change Log
128128

129-
* `0.1.25`: Fix dynamodb proxying for read-only mode.
129+
* `0.2.0`: Rename extension from `localstack-extension-aws-replicator` to `localstack-extension-aws-proxy`
130+
* `0.1.25`: Fix dynamodb proxying for read-only mode
130131
* `0.1.24`: Fix healthcheck probe for proxy container
131132
* `0.1.23`: Fix unpinned React.js dependencies preventing webui from loading
132133
* `0.1.22`: Fix auth-related imports that prevent the AWS proxy from starting

aws-proxy/aws_proxy/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
name = "aws-proxy"
File renamed without changes.

aws-replicator/aws_replicator/client/auth_proxy.py renamed to aws-proxy/aws_proxy/client/auth_proxy.py

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
from localstack.config import external_service_url
1818
from localstack.constants import AWS_REGION_US_EAST_1, DOCKER_IMAGE_NAME_PRO, LOCALHOST_HOSTNAME
1919
from localstack.http import Request
20+
from localstack.pro.core.bootstrap.licensingv2 import (
21+
ENV_LOCALSTACK_API_KEY,
22+
ENV_LOCALSTACK_AUTH_TOKEN,
23+
)
2024
from localstack.utils.aws.aws_responses import requests_response
2125
from localstack.utils.bootstrap import setup_logging
2226
from localstack.utils.collections import select_attributes
@@ -29,35 +33,23 @@
2933
from localstack.utils.strings import short_uid, to_bytes, to_str, truncate
3034
from requests import Response
3135

32-
from aws_replicator import config as repl_config
33-
from aws_replicator.client.utils import truncate_content
34-
from aws_replicator.config import HANDLER_PATH_PROXIES
35-
from aws_replicator.shared.constants import HEADER_HOST_ORIGINAL
36-
from aws_replicator.shared.models import AddProxyRequest, ProxyConfig
36+
from aws_proxy import config as repl_config
37+
from aws_proxy.client.utils import truncate_content
38+
from aws_proxy.config import HANDLER_PATH_PROXIES
39+
from aws_proxy.shared.constants import HEADER_HOST_ORIGINAL
40+
from aws_proxy.shared.models import AddProxyRequest, ProxyConfig
3741

3842
from .http2_server import run_server
3943

40-
try:
41-
from localstack.pro.core.bootstrap.licensingv2 import (
42-
ENV_LOCALSTACK_API_KEY,
43-
ENV_LOCALSTACK_AUTH_TOKEN,
44-
)
45-
except ImportError:
46-
# TODO remove once we don't need compatibility with <3.6 anymore
47-
from localstack_ext.bootstrap.licensingv2 import (
48-
ENV_LOCALSTACK_API_KEY,
49-
ENV_LOCALSTACK_AUTH_TOKEN,
50-
)
51-
5244
LOG = logging.getLogger(__name__)
5345
LOG.setLevel(logging.INFO)
5446
if localstack_config.DEBUG:
5547
LOG.setLevel(logging.DEBUG)
5648

5749
# TODO make configurable
58-
CLI_PIP_PACKAGE = "localstack-extension-aws-replicator"
50+
CLI_PIP_PACKAGE = "localstack-extension-aws-proxy"
5951
# note: enable the line below temporarily for testing:
60-
# CLI_PIP_PACKAGE = "git+https://github.com/localstack/localstack-extensions/@branch#egg=localstack-extension-aws-replicator&subdirectory=aws-replicator"
52+
# CLI_PIP_PACKAGE = "git+https://github.com/localstack/localstack-extensions/@branch#egg=localstack-extension-aws-proxy&subdirectory=aws-proxy"
6153

6254
CONTAINER_NAME_PREFIX = "ls-aws-proxy-"
6355
CONTAINER_CONFIG_FILE = "/tmp/ls.aws.proxy.yml"

0 commit comments

Comments
 (0)