Skip to content

Commit b688957

Browse files
docs: updated AWS Replicator tutorial to AWS Proxy, images, and localhost links (#253)
1 parent e8d22b7 commit b688957

File tree

7 files changed

+26
-28
lines changed

7 files changed

+26
-28
lines changed
478 KB
Loading
416 KB
Loading
-1.18 MB
Binary file not shown.
-2.38 MB
Binary file not shown.
Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: "Replicating cloud resources locally with LocalStack's AWS Replicator extension"
3-
description: Learn how you can replicate cloud resources in your local environment using the LocalStack's AWS Replicator extension. This tutorial provides step-by-step guidance on setting up and leveraging the AWS Replicator extension to mirror cloud services locally, enabling efficient hybrid development and testing workflows without maintaining additional configurations.
2+
title: "Replicating cloud resources locally with LocalStack's AWS Cloud Proxy extension"
3+
description: Learn how you can replicate cloud resources in your local environment using the LocalStack's AWS Cloud Proxy extension. This tutorial provides step-by-step guidance on setting up and leveraging the AWS Cloud Proxy extension to mirror cloud services locally, enabling efficient hybrid development and testing workflows without maintaining additional configurations.
44
services:
55
- sqs
66
- lmb
@@ -9,7 +9,7 @@ platform:
99
deployment:
1010
- awscli
1111
pro: true
12-
leadimage: "aws-replicator-extension-tutorial-cover.png"
12+
leadimage: "aws-proxy-extension-tutorial-cover.png"
1313
---
1414

1515
## Introduction
@@ -19,13 +19,13 @@ This allows you to work on and test your cloud-based solutions without needing t
1919
However, sometimes you might need to smoothly switch between your local setup and actual cloud resources, especially in hybrid scenarios.
2020
This could be useful, for example, if you want to share a database with your local Lambda function, or if you require access to S3 files stored remotely while running a Glue ETL job locally.
2121

22-
With the [AWS Replicator extension](https://github.com/localstack/localstack-extensions/tree/main/aws-replicator), you can:
22+
With the [AWS Cloud Proxy extension](https://github.com/localstack/localstack-extensions/tree/main/aws-proxy), you can:
2323

2424
- Enable your local environment to mirror AWS cloud resources at the API level, allowing for direct interaction with cloud services.
2525
- Facilitate the forwarding of specific requests from LocalStack to AWS without the need for complex proxy setups.
2626
- Support scenarios that require a combination of local and cloud resources, such as testing cloud services with local databases or functions.
2727

28-
In this tutorial, you will learn how to install the AWS Replicator extension and utilize its different modes to seamlessly work in a hybrid environment.
28+
In this tutorial, you will learn how to install the AWS Cloud Proxy extension and utilize its different modes to seamlessly work in a hybrid environment.
2929

3030
## Prerequisites
3131

@@ -35,17 +35,17 @@ In this tutorial, you will learn how to install the AWS Replicator extension and
3535
- [LocalStack Web Application account](https://app.localstack.cloud/sign-up)
3636
- [AWS Account](https://aws.amazon.com/) with an [`AWS_ACCESS_KEY_ID` & `AWS_SECRET_ACCESS_KEY`](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey)
3737

38-
## Install the AWS Replicator extension
38+
## Install the AWS Cloud Proxy extension
3939

40-
To install the AWS Replicator Extension, follow these steps:
40+
To install the AWS Cloud Proxy Extension, follow these steps:
4141

4242
1. Launch your LocalStack container using the `localstack` CLI, ensuring that `LOCALSTACK_AUTH_TOKEN` is available in the environment.
4343
2. Visit the [Extensions library](https://app.localstack.cloud/extensions/library) page on the LocalStack Web Application.
44-
![Extensions Library](/images/aws/extensions-library.png)
45-
3. Scroll down to find the **AWS replicator** card, then click on the **Install on Instance** button.
46-
![Installing AWS Replicator extension](/images/aws/installing-aws-replicator-extensions.png)
44+
![Extensions Library](/images/aws/aws-proxy-tutorial/extensions-library.png)
45+
3. Scroll down to find the **AWS Cloud Proxy** card, then click on the **Install on Instance** button.
46+
![Installing AWS Cloud Proxy extension](/images/aws/aws-proxy-tutorial/installing-aws-proxy-extensions.png)
4747

48-
Once the installation is complete, you will notice that your LocalStack container has restarted with the AWS Replicator extension successfully installed.
48+
Once the installation is complete, you will notice that your LocalStack container has restarted with the AWS Cloud Proxy extension successfully installed.
4949
To confirm the installation, execute the following command:
5050

5151
```bash
@@ -56,14 +56,14 @@ localstack extensions list
5656
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
5757
┃ Name ┃ Summary ┃ Version ┃ Author ┃ Plugin name ┃
5858
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
59-
│ localstack-extension-aws-re… │ LocalStack Extension: AWS │ 0.1.11 │ LocalStack Team │ aws-replicator
60-
│ │ replicator │ │ │ │
59+
│ localstack-extension-aws-re… │ LocalStack Extension: AWS │ 0.1.11 │ LocalStack Team │ aws-proxy
60+
│ │ Cloud Proxy │ │ │ │
6161
└──────────────────────────────┴──────────────────────────────┴─────────┴─────────────────┴────────────────┘
6262
```
6363

6464
After verifying the successful installation, you can shut down the LocalStack container to re-start it with additional configuration variables.
6565

66-
## Tutorial: Working with the AWS Replicator Extension
66+
## Tutorial: Working with the AWS Cloud Proxy Extension
6767

6868
In this tutorial, you will set up a basic example consisting of:
6969

@@ -74,23 +74,23 @@ In this tutorial, you will set up a basic example consisting of:
7474
The basic architecture for the scenario is outlined in the figure below.
7575
It shows the relationship between the resources deployed in the LocalStack container, the LocalStack AWS Proxy, and the remote AWS account.
7676

77-
![AWS Replicator sample use case](/images/aws/aws-proxy-sqs-lambda-sample.png)
77+
![AWS Cloud Proxy sample use case](/images/aws/aws-proxy-sqs-lambda-sample.png)
7878

79-
In the following sections, you will create the SQS queue on your local machine and the remote cloud to showcase how you can switch between the two with the AWS Replicator extension.
79+
In the following sections, you will create the SQS queue on your local machine and the remote cloud to showcase how you can switch between the two with the AWS Cloud Proxy extension.
8080

8181
### Create the Lambda function
8282

8383
Begin by running your LocalStack container with the following configuration:
8484

8585
```bash
86-
EXTRA_CORS_ALLOWED_ORIGINS=https://aws-replicator.localhost.localstack.cloud:4566 \
86+
EXTRA_CORS_ALLOWED_ORIGINS=https://aws-proxy.localhost.localstack.cloud:4566 \
8787
DEBUG=1 \
8888
localstack start
8989
```
9090

9191
In the above command:
9292

93-
- The `EXTRA_CORS_ALLOWED_ORIGINS` variable allows the AWS Replicator extension's web interface to connect with the LocalStack container.
93+
- The `EXTRA_CORS_ALLOWED_ORIGINS` variable allows the AWS Cloud Proxy extension's web interface to connect with the LocalStack container.
9494
- The `DEBUG` variable enables verbose logging allowing you to see the printed statements from the Lambda function.
9595

9696
Next, create a file named `testlambda.py` and add the following Python code to it:
@@ -138,7 +138,7 @@ awslocal sqs create-queue --queue-name test-queue
138138
}
139139
```
140140

141-
Additionally, you can create the remote SQS queue on the real AWS cloud to test invocation after starting the AWS Replicator extension.
141+
Additionally, you can create the remote SQS queue on the real AWS cloud to test invocation after starting the AWS Cloud Proxy extension.
142142

143143
Use the following command to set up the SQS queue on AWS:
144144

@@ -194,12 +194,11 @@ In the LocalStack logs, you will see confirmation of the Lambda function invocat
194194
2024-03-26T07:23:47.842 DEBUG --- [5119b27cdf1e] l.s.l.i.version_manager : [func1-381c6f7c-3ad8-4c79-aad8-5119b27cdf1e] END RequestId: 381c6f7c-3ad8-4c79-aad8-5119b27cdf1e
195195
```
196196

197-
### Run the AWS Replicator extension
197+
### Run the AWS Cloud Proxy extension
198198

199-
To run the AWS Replicator extension:
199+
To run the AWS Cloud Proxy extension:
200200

201-
- Access [`https://aws-replicator.localhost.localstack.cloud:4566`](https://aws-replicator.localhost.localstack.cloud:4566/) via your web browser.
202-
![AWS Replicator extension](/images/aws/aws-replicator-extension.png)
201+
- Access [`https://aws-proxy.localhost.localstack.cloud:4566`](https://aws-proxy.localhost.localstack.cloud:4566/) via your web browser.
203202
- Provide your AWS Credentials: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and optionally `AWS_SESSION_TOKEN`.
204203
- Add a new YAML-based Proxy configuration to proxy requests for specific resources to AWS.
205204
For this scenario, configure it to proxy requests for the SQS queue created earlier.
@@ -211,9 +210,8 @@ To run the AWS Replicator extension:
211210
- '.*:test-queue'
212211
```
213212
214-
- Save the configuration to enable the AWS Replicator extension.
213+
- Save the configuration to enable the AWS Cloud Proxy extension.
215214
Once enabled, you will see the proxy status as **enabled**.
216-
![Enabled AWS Replicator extension](/images/aws/enabled-aws-replicator-extension.png)
217215
218216
To invoke the local Lambda function with the remote SQS queue:
219217
@@ -231,14 +229,14 @@ You will observe the local Lambda function being invoked once again, with corres
231229

232230
You can even run the standard `awslocal` commands in your terminal that would query the remote cloud resources, instead of the local ones.
233231

234-
Upon completion, you can click **Disable** on the AWS Replicator extension web interface to deactivate the proxy configuration.
232+
Upon completion, you can click **Disable** on the AWS Cloud Proxy extension web interface to deactivate the proxy configuration.
235233
Additionally, you can delete the remote SQS queue to avoid AWS billing for long-running resources.
236234
To remove local resources, stop the LocalStack container to clear the local Lambda function and SQS queue.
237235

238236
## Conclusion
239237

240-
In this tutorial, you've discovered how the AWS Replicator extension bridges the gap between local and remote cloud resources by mirroring resources from real AWS accounts into your LocalStack instance.
241-
You can explore additional use-cases with the AWS Replicator extension, such as:
238+
In this tutorial, you've discovered how the AWS Cloud Proxy extension bridges the gap between local and remote cloud resources by mirroring resources from real AWS accounts into your LocalStack instance.
239+
You can explore additional use-cases with the AWS Cloud Proxy extension, such as:
242240

243241
- Developing a local Lambda function that interacts with a remote DynamoDB table
244242
- Executing a local Athena SQL query in LocalStack, accessing files in a real S3 bucket on AWS

0 commit comments

Comments
 (0)