Skip to content

Commit

Permalink
Merge branch 'localstack:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Blind-Striker authored Sep 10, 2023
2 parents acf76c7 + 345a942 commit 03aff12
Show file tree
Hide file tree
Showing 161 changed files with 83,669 additions and 81,978 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: "weekly"
reviewers:
- "alexrashed"
labels:
- "dependencies"
4 changes: 2 additions & 2 deletions .github/workflows/docs-parity-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout docs
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
path: docs
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
path: docs/.github/bot_templates/PARITY_COVERAGE_DOCS_PR.md

- name: Create PR
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v5
if: ${{ success() && steps.check-for-changes.outputs.diff-count != '0' && steps.check-for-changes.outputs.diff-count != '' }}
with:
path: docs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
Expand All @@ -23,7 +23,7 @@ jobs:
extended: true

- name: Setup Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '16'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Broken link checker
uses: gaurav-nelson/github-action-markdown-link-check@v1
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/preview-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive
Expand All @@ -22,7 +22,7 @@ jobs:
extended: true

- name: Setup Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '16'

Expand All @@ -32,7 +32,7 @@ jobs:
hugo --gc --minify
- name: Upload dist artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: dist
path: ./public
Expand All @@ -44,7 +44,7 @@ jobs:

- name: Upload PR number
if: ${{ always() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: pr
path: ./pr-id.txt
6 changes: 3 additions & 3 deletions .github/workflows/preview-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
npx surge --project ./ --domain $DEPLOY_DOMAIN --token ${{ secrets.SURGE_TOKEN }}
- name: Update status Comment
uses: actions-cool/maintain-one-comment@v1.1.0
uses: actions-cool/maintain-one-comment@v3.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
Expand All @@ -46,7 +46,7 @@ jobs:

- name: Job failure
if: ${{ failure() }}
uses: actions-cool/maintain-one-comment@v1.1.0
uses: actions-cool/maintain-one-comment@v3.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
Expand All @@ -70,7 +70,7 @@ jobs:
run: echo "::set-output name=id::$(<pr-id.txt)"

- name: Job failure
uses: actions-cool/maintain-one-comment@v1.1.0
uses: actions-cool/maintain-one-comment@v3.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview-start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: create
uses: actions-cool/maintain-one-comment@v1.1.0
uses: actions-cool/maintain-one-comment@v3.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
Expand Down
10 changes: 9 additions & 1 deletion assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,6 @@ table tfoot {
}
.td-content, body{
.code-container {
position: relative;
.code-copy-button {
position: absolute;
top: 0;
Expand Down Expand Up @@ -559,5 +558,14 @@ table tfoot {
}
}
}
.disable-copy-btn {
.code-copy-button{
display: none !important;
}
}

.disable-copy{
display: inline;
}

@import "modules/academy-styles.scss";
2 changes: 2 additions & 0 deletions content/en/references/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ This section covers configuration options that are specific to certain AWS servi
| - | - | - |
| `EC2_DOCKER_FLAGS` | `--privileged` | Additional flags passed to Docker when launching containerized instances. Same restrictions as `LAMBDA_DOCKER_FLAGS`. |
| `EC2_DOWNLOAD_DEFAULT_IMAGES` | `0`\|`1` (default) | At startup, LocalStack Pro downloads latest Ubuntu images from Docker Hub for use as AMIs. This can be disabled for security reasons. |
| `EC2_MOUNT_BLOCK_DEVICES` | `1`\|`0` (default) | Whether to create and mount user-specified EBS block devices into EC2 container instances. |
| `EC2_EBS_MAX_VOLUME_SIZE` | `1000` (default) | Maximum size (in MBs) of user-specified EBS block devices mounted into EC2 container instances. |

### EKS

Expand Down
49 changes: 39 additions & 10 deletions content/en/references/external-ports.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,47 @@ title: "External Service Port Range"
weight: 50
description: >
The range of ports used by services not directly provided by LocalStack
aliases:
- /localstack/external-ports/
---

Services like [OpenSearch]({{< ref "opensearch" >}}) or [Elasticsearch]({{< ref "elasticsearch" >}}) use external software which binds to separate ports.
## Introduction

Depending on the configuration of the individual LocalStack service, these services can either be accessed by using the proxy functionality of LocalStack which assigns local domains to these external services.
For example, if OpenSearch is configured to use the [`OPENSEARCH_ENDPOINT_STRATEGY=domain`]({{< ref "opensearch#endpoints" >}}), a cluster can be reached by using the domain name `<domain-name>.<region>.<engine-type>.localhost.localstack.cloud`.
Messages coming to those domains are then relayed to the servers running on ports which do not have to be accessible from outside the Docker container.
LocalStack provides local cloud services, such as [OpenSearch]({{< ref "opensearch" >}}) or [Elasticsearch]({{< ref "elasticsearch" >}}), which might utilize external software bound to specific ports.
This documentation discusses two approaches to access these external services within LocalStack and explores the concept of an _external service port range_.

Another option is using the *external service port range*, which - e.g. in OpenSearch - is enabled by using the [`OPENSEARCH_ENDPOINT_STRATEGY=port`]({{< ref "opensearch#endpoints" >}})).
The external service port range is a set of pre-defined ports (by default `4510-4559`). LocalStack will chose a free port within this range when starting an external service.
These ports need to be accessible from outside the Docker container and in turn allows to directly access an external service (as opposed to using LocalStack as a proxy).
## Proxy Functionality for External Services

The port range is configurable by using the environment variables `EXTERNAL_SERVICE_PORTS_START` and `EXTERNAL_SERVICE_PORTS_END`. This results in the external service port range `(EXTERNAL_SERVICE_PORTS_START, EXTERNAL_SERVICE_PORTS_END]` (i.e. the `EXTERNAL_SERVICE_PORTS_END` is _not_ included in the range).
LocalStack offers a proxy functionality to access external services indirectly.
In this approach, LocalStack assigns local domains to the external services based on the individual service's configuration.

For instance, if OpenSearch is configured to use the [`OPENSEARCH_ENDPOINT_STRATEGY=domain`]({{< ref "opensearch#endpoints" >}}) setting, a cluster can be reached using the domain name `<domain-name>.<region>.<engine-type>.localhost.localstack.cloud`.
Incoming messages to these domains are relayed to servers running on ports that do not require external accessibility.

## Direct Access with External Service Port Range

An alternative approach to accessing external services is by utilizing the _external service port range_.
This method, applicable to services like OpenSearch, is activated using the [`OPENSEARCH_ENDPOINT_STRATEGY=port`]({{< ref "opensearch#endpoints" >}}) configuration.
The external service port range is pre-defined and set to `4510-4559` by default.

When a LocalStack service starts an external service, it automatically selects an available port from within the specified range.
The primary advantage of this approach is that these ports are accessible from outside the Docker container, allowing direct access to the external service without the need for LocalStack to act as a proxy.

## Configuring the External Service Port Range

To configure the external service port range, you can make use of the environment variables `EXTERNAL_SERVICE_PORTS_START` and `EXTERNAL_SERVICE_PORTS_END`.
The range is defined as `(EXTERNAL_SERVICE_PORTS_START, EXTERNAL_SERVICE_PORTS_END]`, wherein the `EXTERNAL_SERVICE_PORTS_END` value is not included in the range.

By adjusting these environment variables, you can customize the port range according to your requirements, granting you greater flexibility in managing external service access.

## Running multiple LocalStack containers with Custom Port Mapping

If you wish to run multiple instances of LocalStack simultaneously, it is essential to ensure that the edge port (default: `4566`) and external service ports are mapped to non-overlapping ranges.
Here's how you can achieve this using the LocalStack CLI:

{{< command >}}
$ GATEWAY_LISTEN=0.0.0.0:4566 EXTERNAL_SERVICE_PORTS_START=4510 EXTERNAL_SERVICE_PORTS_END=4559 MAIN_CONTAINER_NAME=localstack_main_1 localstack start
$ GATEWAY_LISTEN=0.0.0.0:4666 EXTERNAL_SERVICE_PORTS_START=4610 EXTERNAL_SERVICE_PORTS_END=4659 MAIN_CONTAINER_NAME=localstack_main_2 localstack start
$ GATEWAY_LISTEN=0.0.0.0:4766 EXTERNAL_SERVICE_PORTS_START=4710 EXTERNAL_SERVICE_PORTS_END=4759 MAIN_CONTAINER_NAME=localstack_main_3 localstack start
{{< /command >}}

By customizing the `GATEWAY_LISTEN` and `EXTERNAL_SERVICE_PORTS_START`/`EXTERNAL_SERVICE_PORTS_END` values for each instance, you can ensure that they operate on distinct port ranges, preventing any conflicts and enabling smooth execution of multiple LocalStack instances.
Please make sure to set `MAIN_CONTAINER_NAME` for following usages of the LocalStack CLI to specify which instance of LocalStack you want to address with the specific CLI command.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ networks:

### Wildcard DNS access

{{<alert title="Pro only" color="alert">}}
{{<alert title="Note">}}
The Wildcard DNS access feature is part of [LocalStack's Pro/Team offering](https://localstack.cloud/pricing) and requires an API key to be configured.
{{</alert>}}

Expand Down
Loading

0 comments on commit 03aff12

Please sign in to comment.