Skip to content

Latest commit

 

History

History

asset-management

Description

Project creates CloudFormation stack with the following resources:

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 by sls create-cert --stage yourStage.
  • Assets deploy managed by serverless-s3-deploy plugin
  • CloudFront invalidation managed by serverless-plugin-scripts plugin.
    See after:s3deploy:deploy and after:deploy:finalize hooks.
  • Assets deploy occurs while SES template update and before standard serverless deploy process.

Install

  1. Buy Domain (AWS Route 53)
  2. Install dependencies with yarn - yarn
  3. Update project config section in serverless.yml. See custom.projectConfig
  4. Create a domain certificate - sls create-cert --stage yourStage
  5. Deploy the service - sls deploy --stage yourStage
  6. Make sure your emails are verified in SES -> Email Addresses

Test

Invoke send_email_template lambda function:

sls invoke -f send_email_template -d '{"templateId":"example", "recipientEmail":"[email protected]"}' -l --stage yourStage

Remove

  1. sls remove --stage yourStage

Additional

  1. Manually sync assets - sls s3deploy --stage yourStage
  2. Create a domain certificate - sls create-cert --stage yourStage
  3. Remove a domain certificate - sls remove-cert --stage yourStage