- Create an AWS account if you do not already have one and log in. The IAM user that you use must have sufficient permissions to make necessary AWS service calls and manage AWS resources.
- AWS CLI installed and configured
- Git Installed
- Node and NPM installed
- AWS Cloud Development Kit (AWS CDK) installed
-
Create a new directory, navigate to that directory in a terminal and clone the GitHub repository:
git clone https://github.com/aws-samples/react-formik-on-aws
-
From the command line, use npm to install the development dependencies:
npm install
-
From the command line, use npm to build the React website:
npm run build:ui
-
Bundle Lambda function
npx esbuild resources/lambda/index.js --bundle --platform=node --target=node12 --external:aws-sdk --outfile=dist/lambda/build/index.js
-
Configure CDK
cdk bootstrap aws://<ACCOUNT_ID>/<ACCOUNT_REGION>
-
To deploy from the command line use the following:
npx cdk deploy
- After deployment, the output shows the API Gateway URL, open the link in the browser.
- From the command line, use the following in the source folder
npx cdk destroy
- Confirm the removal and wait for the resource deletion to complete.
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testsnpx cdk deploy
deploy this stack to your default AWS account/regionnpx cdk diff
compare deployed stack with current statenpx cdk synth
emits the synthesized CloudFormation template