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
Copy file name to clipboardExpand all lines: aws-proxy/README.md
+36-37Lines changed: 36 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,52 +21,55 @@ The AWS Cloud Proxy can be used to forward certain API calls in LocalStack to re
21
21
22
22
**Warning:** Be careful when using the proxy - make sure to _never_ give access to production accounts or any critical/sensitive data!
23
23
24
-
**Note:** The Cloud Proxy CLI currently works only when installing the `localstack` CLI via `pip`.
25
-
If you're downloading the `localstack` CLI as a [binary release](https://docs.localstack.cloud/getting-started/installation/#localstack-cli), then please use the proxy configuration UI described below.
26
-
27
24
### Usage
28
25
29
-
#### CLI
30
-
For example, in order to forward all API calls for DynamoDB/S3/Cognito to real AWS, the proxy can be started via the CLI as follows:
26
+
#### Using curl (API)
31
27
32
-
1. Start LocalStack via CLI
33
-
```
34
-
$ localstack start -d
35
-
```
36
-
2. Enable LocalStack AWS Proxy from the Web Application Extension Library
37
-
3. After installation restart Localstack
38
-
4. Install the AWS Proxy CLI package
39
-
```
40
-
$ pip install localstack-extension-aws-proxy
41
-
```
42
-
5. Configure real cloud account credentials in a new terminal session to allow access
28
+
The proxy can be enabled and disabled via the LocalStack internal API. This is the recommended approach.
29
+
30
+
1. Start LocalStack and install the AWS Proxy extension (restart LocalStack after installation).
31
+
32
+
2. Enable the proxy for specific services (e.g., DynamoDB, S3, Cognito) by posting a configuration along with your AWS credentials:
7. 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.
$ curl -X POST http://localhost:4566/_localstack/aws/proxies/status \
60
+
-H 'Content-Type: application/json' \
61
+
-d '{"status": "disabled"}'
57
62
```
58
63
59
-
2. Enable Localstack AWS Proxy from the Web Application Extension Library
60
-
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 .
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.
62
65
63
-
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.
66
+
#### Using the LocalStack Web App
64
67
65
-

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.
66
69
67
-
5. Now we can communicate with the real AWS cloud resources, directly via LocalStack.
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.
68
71
69
-
To clean up the running proxy container simply click "disable" on the Cloud Proxy UI.
72
+

70
73
71
74
### Resource-specific proxying
72
75
@@ -90,10 +93,7 @@ services:
90
93
execute: false
91
94
```
92
95
93
-
Store the configuration above to a file named `proxy_config.yml`, then we can start up the proxy via:
94
-
```
95
-
localstack aws proxy -c proxy_config.yml
96
-
```
96
+
Pass this configuration in the `config` field of the `POST /_localstack/aws/proxies` request body (as shown above).
97
97
98
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
99
```
@@ -118,8 +118,6 @@ In addition to the proxy services configuration shown above, the following confi
118
118
*`PROXY_LOCALSTACK_HOST`: the target host to use when the proxy container connects to the LocalStack main container (automatically determined by default)
119
119
*`PROXY_DOCKER_FLAGS`: additional flags that should be passed when creating the proxy Docker containers
120
120
121
-
**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.
122
-
123
121
## Resource Replicator CLI (deprecated)
124
122
125
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.
@@ -129,6 +127,7 @@ If you wish to access the deprecated instructions, they can be found [here](http
129
127
130
128
## Change Log
131
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
132
131
*`0.2.3`: Enhance proxy support and tests for several services (API Gateway v1/v2, CloudWatch, AppSync, Kinesis, KMS, SNS, Cognito-IDP)
133
132
*`0.2.2`: Refactor UI to use WebAppExtension pattern
134
133
*`0.2.1`: Restructure project to use pyproject.toml
0 commit comments