-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into removing-question-mark-schedule
- Loading branch information
Showing
35 changed files
with
485 additions
and
316 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
label: Platforms | ||
collapsible: true | ||
collapsed: true | ||
link: | ||
type: generated-index | ||
title: Platforms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
--- | ||
title: AWS CDK | ||
id: awscdk | ||
sidebar_label: awscdk | ||
description: AWS CDK platform | ||
keywords: [Wing reference, Wing language, language, Wing language spec, Wing programming language, aws, awscdk, amazon web services, cloudformation] | ||
--- | ||
|
||
The `@winglang/platform-awscdk` [platform](../02-concepts/03-platforms.md) compiles your program for the AWS CDK (CloudFormation). | ||
|
||
## Usage | ||
|
||
You will need to install the `@winglang/platform-awscdk` library in order to use this platform. | ||
|
||
```sh | ||
$ npm i @winglang/platform-awscdk | ||
``` | ||
|
||
This platform requires the environment variable `CDK_STACK_NAME` to be set to the name of the CDK | ||
stack to synthesize. | ||
|
||
```sh | ||
$ export CDK_STACK_NAME="my-project" | ||
$ wing compile --platform @winglang/platform-awscdk [entrypoint] | ||
``` | ||
|
||
## Parameters | ||
|
||
The `CDK_STACK_NAME` environment variable specifies the name of the CDK stack to synthesize. | ||
|
||
## Output | ||
|
||
The output includes both a AWS-CDK configuration file (under `target/<entrypoint>.awscdk`) and | ||
JavaScript bundles that include inflight code that executes on compute platforms such as AWS Lambda. | ||
|
||
## Deployment | ||
|
||
To deploy your app, you will first need to install the [AWS CDK | ||
CLI](https://docs.aws.amazon.com/cdk/v2/guide/cli.html). | ||
|
||
If not previously done, you will need to bootstrap your environment (account/region): | ||
|
||
```sh | ||
$ cd bootstrap --app target/app.awscdk | ||
``` | ||
|
||
And then you can deploy: | ||
|
||
```sh | ||
$ cdk deploy --app target/app.awscdk | ||
``` | ||
|
||
## Customizations | ||
|
||
### Custom CDK Stack | ||
|
||
The `App` class has a `stackFactory` property that can be used to customize how the root CDK stack | ||
is created. | ||
|
||
To use this, create a custom platform like this: | ||
|
||
```js | ||
import { App } from "@winglang/platform-awscdk"; | ||
import { platform } from "@winglang/sdk"; | ||
|
||
export class Platform implements platform.IPlatform { | ||
public readonly target = "awscdk"; | ||
public newApp?(appProps: any): any { | ||
return new App({ | ||
...appProps, | ||
stackFactory: (app: cdk.App, stackName: string) => { | ||
// customize here! | ||
return new cdk.Stack(app, stackName); | ||
} | ||
}); | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
title: Wing Cloud Simulator | ||
id: sim | ||
sidebar_label: sim | ||
description: Simulator Platform | ||
keywords: [Wing reference, Wing language, language, Wing language spec, Wing programming language, simulator, sim, wing simulator] | ||
--- | ||
|
||
The Wing Cloud Simulator is a tool for running Wing applications on a single host. It offers a | ||
simple localhost implementation of all the resources of the Wing Cloud Library to allow developers | ||
to develop and functionally test cloud applications without having to deploy to the cloud. | ||
|
||
The `sim` [platform]((../02-concepts/03-platforms.md)) compiles your program so it can run in the | ||
Wing Cloud Simulator. | ||
|
||
## Usage | ||
|
||
```sh | ||
$ wing compile [entrypoint] --platform sim | ||
``` | ||
|
||
## Parameters | ||
|
||
No parameters. | ||
|
||
## Output | ||
|
||
The output will be found under `target/<entrypoint>.wsim`. | ||
|
||
## Deployment | ||
|
||
The Wing Simulator can be used in one of these methods: | ||
|
||
* Interactively through the [Wing Console](/docs/start-here/local) | ||
* Using the `wing run|it target/<entrypoint>.wsim` command through the Wing CLI. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
title: Terraform/AWS | ||
id: tf-aws | ||
sidebar_label: tf-aws | ||
description: Terraform/AWS platform | ||
keywords: [Wing reference, Wing language, language, Wing language spec, Wing programming language, cli, terraform, aws, tf-aws, tfaws, amazon web services, platform] | ||
--- | ||
|
||
The `tf-gcp` [platform](../02-concepts/03-platforms.md) compiles your program for Terraform and run on AWS. | ||
|
||
## Usage | ||
|
||
```sh | ||
$ wing compile --platform tf-aws [entrypoint] | ||
``` | ||
|
||
## Parameters | ||
|
||
The `tf-aws` platform supports the following parameters (in `wing.toml`): | ||
|
||
* `vpc` - Determine whether to create a new VPC or use an existing one. Allowed values: `"new"` or `"existing"`. | ||
* `private_subnet_ids` (array of strings) - If using an existing VPC, provide the private subnet IDs. | ||
* `public_subnet_ids` (array of strings) - If using an existing VPC, provide the public subnet IDs. | ||
* `vpc_api_gateway` (boolean) - Whether Api gateways should be deployed in a VPC. | ||
* `vpc_lambda` (boolean) - Whether Lambda functions should be deployed in a VPC. | ||
|
||
Example `wing.toml`: | ||
|
||
```toml | ||
[ tf-aws ] | ||
vpc = "new" | ||
vpc_lambda = true | ||
vpc_api_gateway = true | ||
vpc_id = "vpc-123xyz" | ||
private_subnet_ids = ["subnet-123xyz"] | ||
public_subnet_ids = ["subnet-123xyz"] | ||
``` | ||
|
||
|
||
## Output | ||
|
||
The output includes both a Terraform configuration file (under `target/cdktf.out/stacks/root`) and | ||
JavaScript bundles that include inflight code that executes on compute platform such as AWS Lambda. | ||
|
||
## Deployment | ||
|
||
You can deploy your stack to AWS using Terraform ([instructions](/docs/start-here/aws)). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
title: Terraform/Azure | ||
id: tf-azure | ||
sidebar_label: tf-azure | ||
description: Terraform/Azure platform | ||
keywords: [Wing reference, Wing language, language, Wing language spec, Wing programming language, cli, terraform, tf-azure, azure, microsoft azure, platform] | ||
--- | ||
|
||
The `tf-azure` [platform](../02-concepts/03-platforms.md) compiles your program for Terraform and run on Azure. | ||
|
||
## Usage | ||
|
||
```sh | ||
$ export AZURE_LOCATION="East US" | ||
$ wing compile [entrypoint] --platform tf-azure | ||
``` | ||
|
||
## Parameters | ||
|
||
The environment variable `AZURE_LOCATION` is required and indicates the [deployment | ||
location](https://github.com/claranet/terraform-azurerm-regions/blob/master/REGIONS.md) of your | ||
stack. | ||
|
||
## Output | ||
|
||
The output includes both a Terraform configuration file (under `target/cdktf.out/stacks/root`) and | ||
JavaScript bundles that include inflight code that executes on compute platform such as Azure | ||
Functions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
title: Terraform/GCP | ||
id: tf-gcp | ||
sidebar_label: tf-gcp | ||
description: Terraform/GCP platform | ||
keywords: [Wing reference, Wing language, language, Wing language spec, Wing programming language, cli, terraform, tf-gcp, gcp, google cloud platform, platform] | ||
--- | ||
|
||
The `tf-gcp` [platform](../02-concepts/03-platforms.md) compiles your program for Terraform and run on Google Cloud Platform. | ||
|
||
## Usage | ||
|
||
```sh | ||
$ export GOOGLE_PROJECT_ID="my-project" | ||
$ export GOOGLE_STORAGE_LOCATION="US" | ||
$ wing compile [entrypoint] --platform tf-gcp | ||
``` | ||
|
||
## Parameters | ||
|
||
The environment variable `GOOGLE_STORAGE_LOCATION` is required and indicates the [deployment | ||
location](https://cloud.google.com/storage/docs/locations) of all storage | ||
resources (such as buckets and queues). | ||
|
||
The environment variable `GOOGLE_PROJECT_ID` is required and indicates | ||
the project ID of your stack. | ||
|
||
The output includes both a Terraform configuration file (under `target/cdktf.out/stacks/root`) and | ||
JavaScript bundles that include inflight code that executes on compute platform such as Google Cloud Functions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.