Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update awscdk examples align with best practice #51

Merged
merged 3 commits into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/wing-provider-specific.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node.js v18
- name: Setup Node.js v20
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
- name: Install winglang globally
run: |
npm install -g winglang@latest
Expand Down
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
Loading