Table of Contents
This is a Serverless App using AWS SDK (Lambda, API Gateway, EC2) and retrieves a list of SecurityGroups from EC2
A. API Gateway + Lambda
-
Create a Serverless framework application. More info: https://www.serverless.com/framework/docs/
-
Create a Lambda to list all EC2 security groups in an AWS Account.
-
Make the Lambda function available via an AWS API Gateway endpoint.
-
Write unit tests for your code by mocking AWS EC2 API. Hint: You can use the aws-sdk-mock npm module
-
Produce a code coverage report for your test suite.
-
Secure the endpoint using a custom API Gateway Lambda Authoriser. More info: https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-use-lambda-authorizer.html
-
Make response JSON:API 1.0 (https://jsonapi.org/format/1.0/) compatible.
To get a local copy up and running follow these simple example steps.
Run npm install to install the required packages for this repo
- npm
npm install npm@latest -g
- Clone the repo
git clone https://github.com/github_username/repo_name.git
- Install NPM packages
npm install
- Generate temporary AWS credentials using aws sts assume-role
- Create your own
.envcontaining your AWS credentials (refer toexample.env) - Run locally using
npm run start
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Project Link: https://github.com/jpajar/trend-micro-test