# APIGateway backed by Lambda and protected by Cognito User Pools. --- ![Stability: Stable](https://img.shields.io/badge/stability-Stable-success.svg?style=for-the-badge) > **This is a stable example. It should successfully build out of the box** > > This examples is built on Construct Libraries marked "Stable" and does not have any infrastructure prerequisites to build. --- This an example of an APIGateway that is protected with a Cognito User Pool, pointing to a Hello World Lambda. ## Build To build this app, you need to be in this example's root folder. Then run the following: ```bash npm install -g aws-cdk npm install npm run build ``` This will install the necessary CDK, then this example's dependencies, and then build your TypeScript files and your CloudFormation template. ## Deploy Run `cdk deploy`. This will deploy / redeploy your Stack to your AWS Account. After the deployment you will see the API's URL, which represents the url you can then use. ## The Component Structure The whole component contains: - A Lambda Function that returns "Hello world!". - An API with GET method that points to this Function. - A Cognito User Pool - An Authorizer for the API with the User Pool attached. ## CDK Toolkit The [`cdk.json`](./cdk.json) file in the root of this repository includes instructions for the CDK toolkit on how to execute this program. After building your TypeScript code, you will be able to run the CDK toolkits commands as usual: $ cdk ls $ cdk synth $ cdk deploy $ cdk diff