-
Create a workspace on your local, and prepare python lib if not included in AWS sdk
pip install requests -t your_workspace_pathFor mac user, you may need to add a
setup.cfgfile to fix error. -
Copy script of
lambda_function.py, do remember to change username/email settings. -
zipcontents (including dependency lib, e.g.requestshere), pay attention to the root should be current path. -
Sign up AWS on your region (it's free for first 1-million lambda call per month, perhaps enough for you). Vist lambda in products or here's a fast link.
-
Create function as following:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as s3 from '@aws-cdk/aws-s3'; | |
| import * as iam from '@aws-cdk/aws-iam'; | |
| import * as lambda from '@aws-cdk/aws-lambda'; | |
| import * as ses from '@aws-cdk/aws-ses'; | |
| import * as sesActions from '@aws-cdk/aws-ses-actions' | |
| import * as logs from '@aws-cdk/aws-logs' | |
| import * as cdk from '@aws-cdk/core'; | |
| export class EmailProxyStack extends cdk.Stack { | |
| constructor(scope: cdk.App, id: string, props?: cdk.StackProps) { |