This project is build with AWS SAM. The CloudFormation structure is definied in template.yml.
The URL will be changed if you delete the stack and recreate as example
- Go to your lambda function https://eu-central-1.console.aws.amazon.com/lambda/...
- Click on the tab "Configuration"
- Click on the tab "Triggers"
- In the list should be an API Gateway. The link behind "API endpoint:" is the current public URL.
Your have to install Docker because SAM will create containers
You can invoke your function with a predefined event (json format). How to coming soon...
- Run
sam buildto compile the code - Run
sam local start-apito run the api Now you can test your api (default is localhost:3000) via Postman, Curl etc.
The API Gateway endpoints are protected through an API key
- Go to your lambda function https://eu-central-1.console.aws.amazon.com/lambda/...
- Click on the tab "Configuration"
- Click on the tab "Triggers"
- In the list should be an API Gateway. Click on "Details"
- Copy the "API key: "
| Path | Body | Success response |
|---|---|---|
| / | { emailTemplate: "Name of SES Template", destinationAddress: "E-Mail Address of destination", templateData: {templateKey:templateValue} messageTag:{"email-api-tracking":key} } |
200. E-Mail has been sent |
| Type | HTTP status code | Body |
|---|---|---|
| OK | 200 | E-Mail sent |
| Bad Request | 400 | String with explanation |
| Server Error | 500 | Server error happened. Check cloudwatch logs |