Project creates CloudFormation stack with the following resources:
- KMS key
- S3 bucket
- CloudFront Distribution and Access Identity
- Route53 RecordSetGroup
- Lambda function to send emails
Configuration details:
- Lambda function permissions defined by
serverless-iam-roles-per-function
plugin - Domain certificate managed by
serverless-certificate-creator
+serverless-plugin-scripts
plugins.
Certificate should be manually created bysls create-cert --stage yourStage
. - Assets deploy managed by serverless-s3-deploy plugin
- CloudFront invalidation managed by
serverless-plugin-scripts
plugin.
Seeafter:s3deploy:deploy
andafter:deploy:finalize
hooks. - Assets deploy occurs while SES template update and before standard serverless deploy process.
- Buy Domain (AWS Route 53)
- Install dependencies with yarn -
yarn
- Update project config section in
serverless.yml
. Seecustom.projectConfig
- Create a domain certificate -
sls create-cert --stage yourStage
- Deploy the service -
sls deploy --stage yourStage
- Make sure your emails are verified in SES -> Email Addresses
Invoke send_email_template
lambda function:
sls invoke -f send_email_template -d '{"templateId":"example", "recipientEmail":"[email protected]"}' -l --stage yourStage
sls remove --stage yourStage
- Manually sync assets -
sls s3deploy --stage yourStage
- Create a domain certificate -
sls create-cert --stage yourStage
- Remove a domain certificate -
sls remove-cert --stage yourStage