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
aws-proxy: remove source code, keep README with PyPI install instructions
Code has moved elsewhere; the extension directory now contains only a
README pointing users to install via `localstack extensions install`.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
A LocalStack extension to proxy and integrate AWS resources into your local machine.
6
6
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).
7
7
8
-
⚠️ Please note that this extension is experimental and still under active development.
9
-
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`.
11
-
12
8
## Prerequisites
13
9
14
10
* LocalStack Pro
15
11
* Docker
16
12
* Python
17
13
18
-
## AWS Cloud Proxy
14
+
## Installation
19
15
20
-
The AWS Cloud Proxy can be used to forward certain API calls in LocalStack to real AWS, in order to enable seamless transition between local and remote resources.
16
+
Install the extension via the LocalStack CLI:
21
17
22
-
**Warning:** Be careful when using the proxy - make sure to _never_ give access to production accounts or any critical/sensitive data!
$ curl -X POST http://localhost:4566/_localstack/aws/proxies/status \
60
-
-H 'Content-Type: application/json' \
61
-
-d '{"status": "disabled"}'
62
-
```
63
-
64
-
5. Now, when issuing an API call against LocalStack (e.g., via `awslocal`), the invocation gets forwarded to real AWS and should return data from your real cloud resources.
65
-
66
-
#### Using the LocalStack Web App
67
54
68
-
You can also configure the proxy from the LocalStack Web App at https://app.localstack.cloud. Navigate to your instance and use the AWS Proxy extension settings to enable/disable the proxy and manage credentials.
55
+
### Disable the proxy
69
56
70
-
Alternatively, the extension exposes a local configuration UI at http://localhost:4566/_localstack/aws-proxy/index.html (requires starting LocalStack with `EXTRA_CORS_ALLOWED_ORIGINS=https://aws-proxy.localhost.localstack.cloud:4566`). Use this Web UI to define the proxy configuration (in YAML syntax) and AWS credentials, then save the configuration. To clean up the running proxy container, click "disable" in the UI.
71
-
72
-

73
-
74
-
### Resource-specific proxying
75
-
76
-
As an alternative to forwarding _all_ requests for a particular service, you can also proxy only requests for _specific_ resources to AWS.
77
-
78
-
For example, assume we own an S3 bucket `my-s3-bucket` in AWS, then we can use the following configuration to forward any requests to `s3://my-s3-bucket` to real AWS, while still handling requests to all other buckets locally in LocalStack:
79
-
```
80
-
services:
81
-
s3:
82
-
resources:
83
-
# list of ARNs of S3 buckets to proxy to real AWS
84
-
- '.*:my-s3-bucket'
85
-
operations:
86
-
# list of operation name regex patterns (optional)
87
-
- 'Get.*'
88
-
- 'Put.*'
89
-
# optionally, specify that only read requests should be allowed (Get*/List*/Describe*, etc)
# execute operations have side-effects and are deliberately excluded from read_only by default.
93
-
execute: false
57
+
```bash
58
+
curl -X POST http://localhost:4566/_localstack/aws/proxies/status \
59
+
-H 'Content-Type: application/json' \
60
+
-d '{"status": "disabled"}'
94
61
```
95
62
96
-
Pass this configuration in the `config` field of the `POST /_localstack/aws/proxies` request body (as shown above).
63
+
Once enabled, API calls against LocalStack (e.g., via `awslocal`) are forwarded to real AWS and return data from your real cloud resources.
97
64
98
-
If we then perform local operations against the S3 bucket `my-s3-bucket`, the proxy will forward the request and will return the results from real AWS:
99
-
```
100
-
$ awslocal s3 ls s3://my-s3-bucket
101
-
2023-05-14 15:53:40 148 my-file-1.txt
102
-
2023-05-15 10:24:43 22 my-file-2.txt
103
-
```
65
+
## Configuration
104
66
105
-
Any other S3 requests targeting other buckets will be run against the local state in LocalStack itself, for example:
106
-
```
107
-
$ awslocal s3 mb s3://test123
108
-
make_bucket: test123
109
-
...
110
-
```
67
+
The following environment variables can be passed to the LocalStack container to customize behavior:
111
68
112
-
A more comprehensive sample, involving local Lambda functions combined with remote SQS queues and S3 buckets, can be found in the `example` folder of this repo.
113
-
114
-
### Configuration
115
-
116
-
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):
117
-
*`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.
118
-
*`PROXY_LOCALSTACK_HOST`: the target host to use when the proxy container connects to the LocalStack main container (automatically determined by default)
119
-
*`PROXY_DOCKER_FLAGS`: additional flags that should be passed when creating the proxy Docker containers
120
-
121
-
## Resource Replicator CLI (deprecated)
122
-
123
-
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.
124
-
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)).
125
-
126
-
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).
127
-
128
-
## Change Log
129
-
130
-
*`0.2.4`: Replace deprecated `localstack aws proxy` CLI command with direct Python/HTTP-based proxy startup; update README with curl-based usage instructions
131
-
*`0.2.3`: Enhance proxy support and tests for several services (API Gateway v1/v2, CloudWatch, AppSync, Kinesis, KMS, SNS, Cognito-IDP)
132
-
*`0.2.2`: Refactor UI to use WebAppExtension pattern
133
-
*`0.2.1`: Restructure project to use pyproject.toml
134
-
*`0.2.0`: Rename extension from `localstack-extension-aws-replicator` to `localstack-extension-aws-proxy`
135
-
*`0.1.25`: Fix dynamodb proxying for read-only mode
136
-
*`0.1.24`: Fix healthcheck probe for proxy container
137
-
*`0.1.23`: Fix unpinned React.js dependencies preventing webui from loading
138
-
*`0.1.22`: Fix auth-related imports that prevent the AWS proxy from starting
139
-
*`0.1.20`: Fix logic for proxying S3 requests with `*.s3.amazonaws.com` host header
140
-
*`0.1.19`: Print human-readable message for invalid regexes in resource configs; fix logic for proxying S3 requests with host-based addressing
141
-
*`0.1.18`: Update environment check to use SDK Docker client and enable starting the proxy from within Docker (e.g., from the LS main container as part of an init script)
142
-
*`0.1.17`: Add basic support for ARN-based pattern-matching for `secretsmanager` resources
143
-
*`0.1.16`: Update imports for localstack >=3.6 compatibility
144
-
*`0.1.15`: Move localstack dependency installation to extra since it's provided at runtime
145
-
*`0.1.14`: Install missing dependencies into proxy container for localstack >=3.4 compatibility
146
-
*`0.1.13`: Add compatibility with localstack >=3.4; add http2-server; migrate to localstack auth login
147
-
*`0.1.12`: Modify aws credentials text field type to password
148
-
*`0.1.11`: Fix broken imports after recent upstream CloudFormation changes
149
-
*`0.1.10`: Add `REPLICATOR_PROXY_DOCKER_FLAGS` option to pass custom flags to proxy Docker containers
150
-
*`0.1.9`: Enhance proxy networking and add `REPLICATOR_LOCALSTACK_HOST` config option
151
-
*`0.1.8`: Add `REPLICATOR_CLEANUP_PROXY_CONTAINERS` option to skip removing proxy containers for debugging
152
-
*`0.1.7`: Add rolo dependency to tests
153
-
*`0.1.6`: Adjust config to support `LOCALSTACK_AUTH_TOKEN` in addition to legacy API keys
154
-
*`0.1.5`: Minor fix to accommodate recent upstream changes
155
-
*`0.1.4`: Fix imports of `bootstrap.auth` modules for v3.0 compatibility
156
-
*`0.1.3`: Adjust code imports for recent LocalStack v3.0 module changes
157
-
*`0.1.2`: Remove deprecated ProxyListener for starting local aws-replicator proxy server
158
-
*`0.1.1`: Add simple configuration Web UI
159
-
*`0.1.0`: Initial version of extension
69
+
*`PROXY_CLEANUP_CONTAINERS`: whether to remove proxy Docker containers on shutdown (default `1`). Set to `0` to keep containers for debugging.
70
+
*`PROXY_LOCALSTACK_HOST`: the target host used by the proxy container to connect to LocalStack (auto-detected by default).
71
+
*`PROXY_DOCKER_FLAGS`: additional flags passed when creating proxy Docker containers.
0 commit comments