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: content/en/docs/Integrations/aws-cdk/index.md
+85-1
Original file line number
Diff line number
Diff line change
@@ -8,5 +8,89 @@ description: >
8
8
---
9
9
10
10

11
+
## Overview
12
+
13
+
The AWS Cloud Development Kit (CDK) is an IaC (Infrastructure-as-Code) tool using general-purpose programming languages such as TypeScript/JavaScript, Python, Java and .NET to programmatically define your cloud architecture on AWS.
14
+
15
+
## AWS CDK CLI for LocalStack
16
+
17
+
`cdklocal` is a thin wrapper script for using the [AWS CDK](https://github.com/aws/aws-cdk) library against local APIs provided by [LocalStack](https://github.com/localstack/localstack).
18
+
19
+
### Installation
20
+
21
+
The `cdklocal` command line is published as an [npm library](https://www.npmjs.com/package/aws-cdk-local):
Using `cdklocal` locally (e.g. within the `node_modules` of your repo instead of globally installed) does not work at the moment for some setups, so make sure you install both `aws-cdk` and `aws-cdk-local` with the `-G` flag.
34
+
{{% /alert %}}
35
+
36
+
### Usage
37
+
38
+
`cdklocal` can be used as a drop-in replacement of where you would otherwise use `cdk` when targeting the AWS Cloud.
39
+
40
+
```bash
41
+
cdklocal --help
42
+
```
43
+
### Configuration
44
+
45
+
46
+
The following environment variables can be configured:
47
+
48
+
*`EDGE_PORT`: Port under which LocalStack edge service is accessible (default: `4566`)
49
+
*`LOCALSTACK_HOSTNAME`: Target host under which LocalStack edge service is accessible (default: `localhost`)
50
+
*`LAMBDA_MOUNT_CODE`: Whether to use local Lambda code mounting (via setting `__local__` S3 bucket name)
51
+
52
+
53
+
### Example
54
+
55
+
Make sure that LocalStack is installed and successfully started with the required services before running the example
56
+
57
+
```bash
58
+
curl http://localhost:4566/health
59
+
```
60
+
61
+
The CDK command line ships with a sample app generator to run a quick test for getting started.
62
+
63
+
```bash
64
+
# create sample app
65
+
mkdir /tmp/test;cd /tmp/test
66
+
cdklocal init sample-app --language=javascript
67
+
68
+
# deploy the sample app
69
+
cdklocal deploy
70
+
> Do you wish to deploy these changes (y/n)? y
71
+
```
72
+
73
+
Once the deployment is done, you can inspect the created resources via the [`awslocal`](https://github.com/localstack/awscli-local) command line
0 commit comments