https://github.com/codegenieapp/cloudfront-lambda-url-vs-apigw
https://github.com/codegenieapp/cloudfront-lambda-url-vs-apigw
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/codegenieapp/cloudfront-lambda-url-vs-apigw
- Owner: CodeGenieApp
- License: other
- Created: 2024-09-15T01:36:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-18T10:06:16.000Z (over 1 year ago)
- Last Synced: 2024-12-23T09:49:05.417Z (about 1 year ago)
- Language: TypeScript
- Size: 16.4 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
## Pre-requisites
- [AWS Account + CLI](https://docs.aws.amazon.com/polly/latest/dg/setup-aws-cli.html)
- Node.js
## Getting started
Run `npm run init:dev` to deploy a developer instance to your AWS account. This command does the following:
1. Installs NPM dependencies (`npm i`)
1. Creates a new entry in `~/.aws/credentials` called `recipes_development` using credentials copied from the `default` profile.
- If you'd rather copy credentials from a different profile, run `COPY_AWS_PROFILE=profile-name-to-copy npm run init:dev`, or if you'd rather not copy any credentials, run `COPY_AWS_PROFILE=0 npm run init:dev` (this requires you to manually define a profile named `recipes_development`).
1. Bootstraps CDK in the AWS account (`npm run cdk-bootstrap:dev`)
1. Deploys to AWS (`npm run deploy:dev`)
- Since the UI has a dependency on Cognito and the API, this setup command actually runs deploy a second time.
1. Copies CloudFormation/CDK outputs to local `.env` files for running the UI and API locally.
1. Opens the live version of the web app.
## Developing
After deploying to your developer AWS account, start the UI locally with:
```
npm run start-ui:dev
```
If you want to run your UI against a local version of your API, instead run these two commands in separate terminals:
```
npm run start-api:dev
```
```
npm run start-ui-local-api:dev
```
Note that this will still use your other cloud resources (e.g. Database and Auth) but allows you to quickly iterate on your UI and API.
## Pull outputs
Note that sometimes when you receive a CDK/CloudFormation error (e.g. after a CloudFormation rollback), the `cdk-outputs.json` file gets wiped and you need to re-run `npm run pull-stack-outputs:dev`.