|
| 1 | +# Example – Serverless Email Sign-Up Form |
| 2 | + |
| 3 | +This demo application helps you test Serverless Framework Enterprise's main features: |
| 4 | + |
| 5 | +* **Insights** - Monitoring, metrics and alerts for your functions. |
| 6 | +* **Safeguards** - Best practice policies that run before you perform a deployment. |
| 7 | +* **Secrets** - Store sensitive credentials in the Serverless Enterprise Dashboard and reference them in your Serverless Framework Project. |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +## Installation |
| 12 | + |
| 13 | +#### Clone this repository |
| 14 | + |
| 15 | +```shell |
| 16 | +$ git clone https://github.com/serverless/enterprise.git |
| 17 | +``` |
| 18 | + |
| 19 | +#### Install Front-End & Back-End Dependencies |
| 20 | + |
| 21 | +Navigate into this example project and install dependencies on the frontend and backend. |
| 22 | + |
| 23 | +```shell |
| 24 | +# location - enterprise/examples/email-signup-form/frontend |
| 25 | +$ npm i |
| 26 | +``` |
| 27 | + |
| 28 | +```shell |
| 29 | +# location - enterprise/examples/email-signup-form/backend |
| 30 | +$ npm i |
| 31 | +``` |
| 32 | + |
| 33 | +#### Create a Tenant and Application in Serverless Framework Enterprise |
| 34 | + |
| 35 | +The Serverless Enterprise Plugin adds a `login` command to the Serverless Framework, use it like this to log you in: |
| 36 | + |
| 37 | +```shell |
| 38 | +# location - enterprise/backend |
| 39 | +$ serverless login |
| 40 | +``` |
| 41 | + |
| 42 | +Make sure to follow the prompts and create your Tenant (it's like a Github Org) and Application. |
| 43 | + |
| 44 | +#### Add the Tenant and Application to this project's `serverless.yml` |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | +#### Deploy the back-end |
| 49 | + |
| 50 | +```shell |
| 51 | +# location - enterprise/backend |
| 52 | +$ serverless deploy |
| 53 | +``` |
| 54 | + |
| 55 | +#### Run the front-end |
| 56 | + |
| 57 | +```shell |
| 58 | +# location - enterprise/backend |
| 59 | +$ npm run start |
| 60 | +``` |
| 61 | + |
| 62 | +#### Add the back-end URL in the front-end |
| 63 | + |
| 64 | +The front-end form is not directed at the API endpoint out of the box. You must copy the POST URL that is returned on `serverless deploy` of the `backend` into the front-end. |
| 65 | + |
| 66 | +The URL should resemble this. |
| 67 | + |
| 68 | +``` |
| 69 | +https://bpcn36m16a.execute-api.us-east-1.amazonaws.com/dev/submit |
| 70 | +``` |
| 71 | + |
| 72 | +In the front-end, click "Demo Utilities" and paste this URL into the `FORM API` field. The form should now work, as well as the testing features in the Utilites panel. |
| 73 | + |
| 74 | + |
| 75 | +## Testing Serverless Insights |
| 76 | + |
| 77 | +The user interface of this example application has a few utilities you can use to test out Serverless Framework Enterprise. |
| 78 | + |
| 79 | +Click on "Demo Utilities" in the top right. A side panel will expand which you can use to invoke the example application's Function several times, to fill Serverless Framework Enterprise with invocation data. |
| 80 | + |
| 81 | +You can also use the panel to generate a random Function code error that will appear in Serverless Framework Enterprise. |
| 82 | + |
| 83 | +Read more about [Insights here](https://github.com/serverless/enterprise/blob/master/docs/insights.md). |
| 84 | + |
| 85 | +## Testing Serverless Secrets |
| 86 | + |
| 87 | +The goal of our Secrets feature is to support storing and using any generic secret as a [Serverless Variable](https://serverless.com/framework/docs/providers/aws/guide/variables/). This will be supported in upcoming weeks. |
| 88 | + |
| 89 | +What Secrets supports now is creating a specific type of secret: AWS Access Keys. |
| 90 | + |
| 91 | +You can use Secrets to reference temporary AWS Access Keys that last for 1 hour, used for the purpose of deploying your Serverless Framework project to the underlying AWS account. |
| 92 | + |
| 93 | +Since these are temporary credentials, they mitigate the risk of developers leaving long-term credentials anywhere (e.g. Github) and are perfect for CI/CD. |
| 94 | + |
| 95 | +Read more about [Secrets here](https://github.com/serverless/enterprise/blob/master/docs/secrets.md). |
| 96 | + |
| 97 | +## Testing Serverless Safeguards |
| 98 | + |
| 99 | +The goal of our Safeguards feature is to be alike a linter for serverless architectures. Safeguards are best practices and organizational policies that are enforced upon deployment. When a deployment happens, Framework Enterprise scans your `serverless.yml` and CloudFormation file before deployment and looks for issues. |
| 100 | + |
| 101 | +Safeguards are immediately applied, out-of-the-box, when you add the Serverless Enterprise Plugin. |
| 102 | + |
| 103 | +Read more about [Safeguards here](https://github.com/serverless/enterprise/blob/master/docs/safeguards.md). |
0 commit comments