Skip to content

Commit 7d0351b

Browse files
authored
chore(docs): update readme for path style (#125)
1 parent 518aa20 commit 7d0351b

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,19 @@ The following environment variables can be configured:
4444
* `AWS_ENDPOINT_URL`: The endpoint URL to connect to (combination of `USE_SSL`/`LOCALSTACK_HOSTNAME`/`EDGE_PORT` below)
4545
* `AWS_ENDPOINT_URL_S3`: The endpoint URL to connect to (combination of `USE_SSL`/`LOCALSTACK_HOSTNAME`/`EDGE_PORT` below) for S3 requests
4646
* `AWS_ENVAR_ALLOWLIST`: Allow specific `AWS_*` environment variables to be used by the CDK
47+
* `AWS_S3_FORCE_PATH_STYLE`: Force path-style S3 URLs (CDK >= 2.177.0 only). Automatically enabled when `AWS_ENDPOINT_URL` hostname contains `.sandbox.`. See [Path-style S3 URLs](#path-style-s3-urls-for-remote-endpoints).
4748
* `EDGE_PORT` (deprecated): Port under which LocalStack edge service is accessible (default: `4566`)
4849
* `LOCALSTACK_HOSTNAME` (deprecated): Target host under which LocalStack edge service is accessible (default: `localhost`)
4950
* `USE_SSL` (deprecated): Whether to use SSL to connect to the LocalStack endpoint, i.e., connect via HTTPS.
5051
* `LAMBDA_MOUNT_CODE`: Whether to use local Lambda code mounting (via setting `__local__` S3 bucket name). Note: may require CDK version <2.14.0 to be fully functional.
5152
* `BUCKET_MARKER_LOCAL`: Magic S3 bucket name for Lambda mount and [hot reloading](https://docs.localstack.cloud/user-guide/tools/lambda-tools/hot-reloading) (default: `__local__`, will default to `hot-reload` in a future release)
5253

54+
### Path-style S3 URLs for remote endpoints
55+
56+
When deploying with CDK >= 2.177.0 against endpoints whose hostname contains `.sandbox.` (e.g. `*.sandbox.localstack.cloud`), asset uploads to S3 require path-style URLs. The wildcard TLS certificate for these endpoints only covers one subdomain level and cannot match virtual-hosted-style bucket addresses like `<bucket>.abc.sandbox.localstack.cloud`.
57+
58+
`cdklocal` automatically enables path-style S3 when it detects a `.sandbox.` hostname in `AWS_ENDPOINT_URL`. You can also opt in explicitly via `AWS_S3_FORCE_PATH_STYLE=1`.
59+
5360
## Deploying a Sample App
5461

5562
The CDK command line ships with a sample app generator to run a quick test for getting started:
@@ -59,9 +66,9 @@ $ cdklocal init sample-app --language=javascript
5966
...
6067
```
6168

62-
Make sure that LocalStack is installed and started up with the required services:
69+
Make sure that LocalStack is installed and started:
6370
```bash
64-
$ SERVICES=serverless,sqs,sns localstack start
71+
$ localstack start
6572
```
6673

6774
Then deploy the sample app against the local APIs via the `cdklocal` command line:

0 commit comments

Comments
 (0)