Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit 0a943b9

Browse files
committed
doc improve
1 parent 5c7069c commit 0a943b9

File tree

1 file changed

+14
-7
lines changed
  • content/en/user-guide/integrations/aws-cdk

1 file changed

+14
-7
lines changed

content/en/user-guide/integrations/aws-cdk/index.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,24 @@ By default, stacks with validated certificates may not be deployed using the `lo
9696
This originates from the way how CDK ensures the certificate is ready - it creates a single-file lambda function with a single dependency on `aws-sdk` which is usually preinstalled and available globally in lambda runtime.
9797
When this lambda is executed locally from the `/tmp` folder, the package can not be discovered by Node due to the way how Node package resolution works.
9898

99-
### Version support
99+
`cdklocal` works with all installed versions of the Node.js `aws-cdk` package.
100+
However, issues exist for `aws-cdk >= 2.177.0`.
100101

101-
`cdklocal` supports all installed versions of the node `aws-cdk` package, however some complications are present for `aws-cdk >= 2.177.0`.
102+
For these versions:
102103

103-
For these CDK versions, we remove AWS configuration environment variables like `AWS_PROFILE` from the shell environment before invoking the `cdk` command, and explicitly set `AWS_ENDPOINT_URL` and `AWS_ENDPOINT_URL_S3` to target LocalStack.
104+
* We unset AWS-related environment variables like `AWS_PROFILE` before calling `cdk`.
105+
* We explicitly set `AWS_ENDPOINT_URL` and `AWS_ENDPOINT_URL_S3` to point to LocalStack.
104106

105-
1. We do this because other environment variables may lead to a conflicting set of configuration options, where the wrong region is used to target LocalStack, or `cdklocal` tries to deploy into upstream AWS by mistake.
106-
If individual configuration variables are needed for the deploy process (e.g. `AWS_REGION`) these configuration variables can be propagated to the `cdk` command by configuring `AWS_ENVAR_ALLOWLIST`, for example: `AWS_ENVAR_ALLOWLIST=AWS_REGION,AWS_DEFAULT_REGION AWS_DEFAULT_REGION=eu-central-1 AWS_REGION=eu-central-1 cdklocal ...`.
107-
2. If you are manually setting `AWS_ENDPOINT_URL`, the new value will continue to be read from the environment, however `AWS_ENDPOINT_URL_S3` _must_ also be set and should include a `.s3.` component to ensure we correctly detect S3 requests.
107+
Some environment variables may cause conflicting config, such as wrong region or accidental deploys to real AWS.
108+
To allow specific variables (e.g., `AWS_REGION`), use `AWS_ENVAR_ALLOWLIST`:
108109

109-
For reference on which configuration you can use on CDK in LocalStack in this scenario please refer to the following [documentation](https://github.com/localstack/aws-cdk-local?tab=readme-ov-file#configurations).
110+
```bash
111+
AWS_ENVAR_ALLOWLIST=AWS_REGION,AWS_DEFAULT_REGION AWS_DEFAULT_REGION=eu-central-1 AWS_REGION=eu-central-1 cdklocal ...
112+
```
113+
114+
If you manually set `AWS_ENDPOINT_URL`, it will be used.
115+
You must also set `AWS_ENDPOINT_URL_S3`, and it must include `.s3.` to correctly identify S3 API calls.
116+
See full configuration details [on our configuration docs](https://github.com/localstack/aws-cdk-local?tab=readme-ov-file#configurations).
110117

111118
## Other resources
112119

0 commit comments

Comments
 (0)