https://github.com/jaxxstorm/pulumi-cdk-http
An AWS CDK construct embedded inside a Pulumi Automation API webserver
https://github.com/jaxxstorm/pulumi-cdk-http
Last synced: 3 months ago
JSON representation
An AWS CDK construct embedded inside a Pulumi Automation API webserver
- Host: GitHub
- URL: https://github.com/jaxxstorm/pulumi-cdk-http
- Owner: jaxxstorm
- Created: 2022-05-23T07:44:39.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T05:40:08.000Z (over 1 year ago)
- Last Synced: 2025-02-10T03:41:35.788Z (5 months ago)
- Language: JavaScript
- Size: 223 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AWS CDK Over HTTP
This example is based heavily on the following examples:
- Deploying a fargate app with CDK constructs: https://github.com/pulumi/pulumi-cdk/tree/main/examples/fargate
- Pulumi over HTTP automation API example: https://github.com/pulumi/automation-api-examples/tree/main/nodejs/pulumiOverHttp-tsIt has been modified to make a little more sense for this example.
You can see it in action here:
[](https://asciinema.org/a/TagTpyjefwwjESuV5lerwIf87)
## Prerequisites
To get this running, ensure:
- You have valid AWS credentials
- You've got the [Pulumi CLI installed](https://www.pulumi.com/docs/get-started/install/)
- You have a recentish version of node.## Running
Once you've done that, simply install the deps:
```bash
yarn install
```Wait a few minutes for the server to start on port 1337.
Then send some data to the server, including an `image` in the content:
```bash
curl --header "Content-Type: application/json" --request POST --data '{"id":"helloworld","image":"nginx"}' http://localhost:1337/sites
```You can then delete this site by sending a delete request:
```bash
curl --header "Content-Type: application/json" --request DELETE http://localhost:1337/sites/helloworld
```## Frontend
You can run the frontend with```bash
yarn start-frontend
```The frontend will communicate directly with your server running on port 1337. Ensure that your frontend is running on port 3000 or port 3001, or you may encounter CORS errors when making requests.