Skip to content

Commit

Permalink
fix: update awscdk examples align with best practice
Browse files Browse the repository at this point in the history
The *new* best practice as described in winglang/wing#6286 is to configure a `cdk.json` file to use `wing compile` as the CDK app.

This standardizes the usage through the CDK CLI and enables all CDK features like context lookups, etc.
  • Loading branch information
eladb committed Apr 21, 2024
1 parent aa8955b commit 2d4ebd7
Show file tree
Hide file tree
Showing 10 changed files with 1,340 additions and 156 deletions.
31 changes: 19 additions & 12 deletions examples/provider-specific/awscdk-docker-python-lambda/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,39 @@ This isn't leveraging the Wing SDK, but using Constructs from the AWS CDK direct

This is largely based on an example by [Marcio Cruz](https://github.com/marciocadev) who contributed the AWS CDK provider for wing.

This project is using the [AWS CDK target platform](https://www.winglang.io/docs/platforms/awscdk).

![diagram](./diagram.png)

## Prerequisite

Please make sure to use a current and working setup of the [wing cli](https://docs.winglang.io/getting-started/installation).
Please make sure to use a current and working setup of the [Wing
CLI](https://docs.winglang.io/getting-started/installation)

## Usage

### Setup

Nb: In case of a globally installed Wing CLI, the `aws-cdk-lib` package needs to be installed globally as well. See this [issue](https://github.com/winglang/wing/issues/2478) for more details.

```
```sh
npm install
```

### Wing Console
### Wing Simulator

As of May 2023 the Wing Console is not yet supported.
```sh
wing it
```

### Bootstrap

### Wing Tests
Before the first deployment to an AWS environment (account/region), you'll need to bootstrap some CDK resources:

As of May 2023 tests are not yet supported out of the box
```sh
npx cdk bootstrap
```

### Deploy

```sh
npx cdk deploy
```
export CDK_STACK_NAME="wing-docker-python-lambda"
wing compile -t awscdk main.w
npx cdk deploy --app "./target/main.awscdk"
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"app": "CDK_STACK_NAME=awscdk-docker-python-lambda-test wing compile --no-analytics --no-update-check --platform @winglang/platform-awscdk main.w",
"output": "target/main.awscdk"
}
Loading

0 comments on commit 2d4ebd7

Please sign in to comment.