{"id":17561988,"url":"https://github.com/goldstack/ses-terraform-typescript-boilerplate","last_synced_at":"2026-03-14T04:03:21.825Z","repository":{"id":44373269,"uuid":"484590592","full_name":"goldstack/ses-terraform-typescript-boilerplate","owner":"goldstack","description":"Boilerplate for sending emails using Amazon Simple Email Service (SES) with TypeScript ready for deployment to AWS using low-cost, highly scaleable serverless infrastructure defined using Terraform.","archived":false,"fork":false,"pushed_at":"2025-04-12T02:13:50.000Z","size":352667,"stargazers_count":8,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-18T15:16:21.591Z","etag":null,"topics":["aws","boilerplate","ses","template","terraform","typescript"],"latest_commit_sha":null,"homepage":"https://goldstack.party/templates/ses","language":"HTML","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/goldstack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-04-22T22:42:01.000Z","updated_at":"2025-04-12T02:13:53.000Z","dependencies_parsed_at":"2025-04-18T04:04:44.484Z","dependency_job_id":null,"html_url":"https://github.com/goldstack/ses-terraform-typescript-boilerplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldstack%2Fses-terraform-typescript-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldstack%2Fses-terraform-typescript-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldstack%2Fses-terraform-typescript-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldstack%2Fses-terraform-typescript-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goldstack","download_url":"https://codeload.github.com/goldstack/ses-terraform-typescript-boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251294373,"owners_count":21566263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","boilerplate","ses","template","terraform","typescript"],"created_at":"2024-10-21T12:10:19.844Z","updated_at":"2026-03-14T04:03:19.185Z","avatar_url":"https://github.com/goldstack.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"right\"\u003e\u003cimg src=\"https://cdn.goldstack.party/img/202203/goldstack_icon.png\" height=\"12\"\u003e Generated with \u003ca href=\"https://goldstack.party\"\u003eGoldstack\u003c/a\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://goldstack.party/templates/ses\"\u003e\n    \u003cimg src=\"https://cdn.goldstack.party/img/202204/ses2.svg\" height=\"80\"\u003e\n    \u003ch1 align=\"center\"\u003eSES, Terraform and TypeScript Boilerplate\u003c/h1\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/e8c2651eeac340ff9aa25f5466df1aee)](https://www.codacy.com/gh/goldstack/ses-terraform-typescript-boilerplate/dashboard?utm_source=github.com\\\u0026utm_medium=referral\\\u0026utm_content=goldstack/ses-terraform-typescript-boilerplate\\\u0026utm_campaign=Badge_Grade)\n\nBoilerplate for sending emails using [Amazon Simple Email Service (SES)](https://aws.amazon.com/ses/) with [TypeScript](https://www.typescriptlang.org/) using [Yarn](https://yarnpkg.com/) ready for deployment to AWS using low-cost, highly scaleable serverless infrastructure defined using [Terraform](https://www.terraform.io/).\n\nThis boilerplate has been automatically generated using the template:\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\n        \u003cp align=\"center\"\u003e\u003ca href=\"https://goldstack.party/templates/ses\"\u003e\u003cimg width=\"50\" src=\"https://cdn.goldstack.party/img/202204/ses2.svg\"\u003e\u003c/a\u003e\u003c/p\u003e\n        \u003cp\u003e\u003ca href=\"https://goldstack.party/templates/ses\"\u003eEmail Send (SES)\u003c/a\u003e\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\nFeel free to fork this repository and modify it for your needs, or use the [Goldstack project builder](https://goldstack.party/build) to generate a boilerplate specifically generated for your project.\n\n⚠️ Note that it often makes sense to use the Email Send template with a backend server. Thus before forking this boilerplate, consider if you would want to start with a project that contains a server template, such as [Serverless API](https://goldstack.party/templates/serverless-api) or [Serverless Express.js](https://goldstack.party/templates/express-lambda).\n\n# Getting Started\n\nThank you for using this boilerplate. For any questions or feedback, please be welcome to [raise an issue on GitHub](https://github.com/goldstack/goldstack/issues) 🤗 .\n\n## 1. Fork and clone the repository\n\nFork this repository and then clone the fork into your local machine.\n\nFor more information, see [GitHub documentation - Fork a repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo)\n\n## 2. Install required local dependencies\n\nA few dependencies need to be available in your development system. Please verify they are present or install them.\n\n*   Node v20+\n*   Yarn v1.22.5+\n*   Docker v20+\n*   Terraform CLI\n*   AWS CLI v2\n\nOpen a terminal and run the following commands:\n\n```bash\nnode -v\nyarn -v\ndocker --version\n```\n\nThis should produce the following output:\n\n![Confirming versions in the console](https://cdn.goldstack.party/img/202203/confirm_versions.png)\n\nIf you need to install or update any of the dependencies, please see the following guides:\n\n*   [Downloading and installing Node.js and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)\n*   [Yarn Installation](https://yarnpkg.com/getting-started/install)\n*   [Install Docker for Windows](https://docs.docker.com/docker-for-windows/install/) / [Install Docker for Mac](https://docs.docker.com/docker-for-mac/install/)\n*   [Install Terraform](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli)\n*   [Install AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)\n\n## 3. Initialise project and install NPM Dependencies\n\nRun `yarn` in your project directory to install and download all dependencies.\n\nThe installation process should take around 3-10 minutes depending on the dependencies that need to be downloaded.\n\n![Installing project dependencies](https://cdn.goldstack.party/img/202203/install_project.gif)\n\nYou can confirm everything was installed correctly by running `yarn -v`. This should show a yarn version of `3.0.0+`.\n\n![Confirming Yarn Version after install](https://cdn.goldstack.party/img/202203/confirm_yarn_version_after_install.png)\n\n## 4. Build modules\n\nMake sure that the project compiles correctly by running `yarn build` your project directory:\n\n![Building your project](https://cdn.goldstack.party/img/202203/build_project.gif)\n\nNote that this command also ensures that all TypeScript project references are configured correctly.\n\n## 5. Configure VSCode\n\nIn order to setup VSCode, open the project in VSCode.\n\nVSCode may prompt you to ask if you trust the authors of the workspace. Respond with Yes.\n\n\u003cimg src=\"https://cdn.goldstack.party/img/202201/trust_authors.png\" width=\"300\" alt=\"VSCode Prompt trust authors\"\u003e\n\nYou may also be asked if you want to install recommended extensions for this workspace. We recommend to do so since the template will be optimised to work with the suggested extensions.\n\n![VSCode Prompt install extensions](https://cdn.goldstack.party/img/202201/install_extensions.png)\n\nIf you want to install the necessary extensions manually, here are links to the extensions required:\n\n*   [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)\n*   [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)\n*   [ZipFS](https://marketplace.visualstudio.com/items?itemName=arcanis.vscode-zipfs) (optional)\n\n## 6. Initialise TypeScript\n\nLocate a `.ts` or `.tsx` file in the workspace and open it. When asked whether to use the workspace TypeScript version, click *Allow*.\n\n\u003cimg src=\"https://cdn.goldstack.party/img/202201/allow_typescript.gif\"  alt=\"VSCode Locate TypeScript\"\u003e\n\nIn the status bar on the bottom right-hand corner of the VSCode editor you should now see *TypeScript*.\n\n![TypeScript status icon in VSCode](https://cdn.goldstack.party/img/202203/typescript_init.png)\n\n## 7. AWS Infrastructure Configuration\n\nIf you want to setup your SES email send infrastructure on AWS, you will need to make some changes to the configuration files included in this project.\n\nSpecifically, the [goldstack.json](https://github.com/goldstack/ses-terraform-typescript-boilerplate/blob/master/packages/email-send-1/goldstack.json) in the `packages/email-send` folder.\n\n```json\n{\n  \"$schema\": \"./schemas/package.schema.json\",\n  \"name\": \"email-send\",\n  \"template\": \"email-send\",\n  \"templateVersion\": \"0.1.0\",\n  \"configuration\": {},\n  \"deployments\": [\n    {\n      \"name\": \"prod\",\n      \"awsRegion\": \"us-west-2\",\n      \"awsUser\": \"goldstack-dev\",\n      \"configuration\": {\n        \"domain\": \"email-send.templates.dev.goldstack.party\",\n        \"hostedZoneDomain\": \"dev.goldstack.party\"\n      },\n      \"tfStateKey\": \"app-nextjs-bootstrap-1-prod-cd7f1f0a63ccb93ef36d.tfstate\"\n    }\n  ]\n}\n```\n\nThe key properties you will need to update are:\n\n*   `deployments[0].configuration.hostedZoneDomain`\n*   `deployments[0].configuration.domain`\n\nAlso you need to *delete* `deployments[0].tfStateKey`.\n\nFor more information on these configuration options, see [Goldstack Documentation / Email Send / Configure](https://docs.goldstack.party/docs/templates/email-send#configure).\n\nYou will also need to ensure that you have a valid AWS user configure to deploy to AWS. For this, create a file in `/config/infra/config.json` (relative to project root).\n\n```json\n{\n  \"users\": [\n    {\n      \"name\": \"goldstack-dev\",\n      \"type\": \"apiKey\",\n      \"config\": {\n        \"awsAccessKeyId\": \"...\",\n        \"awsSecretAccessKey\": \"...\",\n        \"awsDefaultRegion\": \"us-west-2\"\n      }\n    },\n    {\n      \"name\": \"goldstack-prod\",\n      \"type\": \"apiKey\",\n      \"config\": {\n        \"awsAccessKeyId\": \"...\",\n        \"awsSecretAccessKey\": \"\",\n        \"awsDefaultRegion\": \"us-west-2\"\n      }\n    }\n  ]\n}\n```\n\nFor more information on configuring your local AWS users, please see [Goldstack Documentation / AWS Configuration](https://docs.goldstack.party/docs/goldstack/configuration#aws-configuration).\n\nOnce your AWS user is configured you can run `yarn infra up dev` in the `/packages/email-send` folder. For more information on the infrastructure commands for this project, see [Goldstack Documentation / Email Send / Infrastructure](https://docs.goldstack.party/docs/templates/email-send#infrastructure).\n\n## 8. Local Development\n\nThis boilerplate will come with a module that provides the functionalities for email sending. This module is defined in `packages/email-send`. Generally you won't have to make changes to this module during local development. Instead, create an additional npm module in the `packages/` folder and then import the `email-send` module as one of the dependencies.\n\nThen use the exported `connect()` and `getFromDomain()` in your code to send email from your code:\n\n```typescript\nconst ses = await connect();\nconst fromDomain = await getFromDomain();\nawait ses\n  .sendEmail({\n    Destination: { ToAddresses: ['destination@test.com'] },\n    Message: {\n      Subject: { Charset: 'UTF-8', Data: 'My email' },\n      Body: {\n        Text: {\n          Charset: 'UTF-8',\n          Data: 'This is the message body in text format.',\n        },\n      },\n    },\n    Source: 'sender@' + fromDomain,\n  })\n  .promise();\n```\n\nDuring local development and testing, a mocked email server will be used by default. The emails sent through the mocked server can be accessed through the exported `getMockedSES()`:\n\n```typescript\nconst mockedSES = getMockedSES();\nconst sentEmailRequests = mockedSES.getSentEmailRequests();\n```\n\n## 9. Contribute to Goldstack\n\nHave questions or ideas or want to contribute to the project? Please head over to [github.com/goldstack/goldstack](https://github.com/goldstack/goldstack).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoldstack%2Fses-terraform-typescript-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoldstack%2Fses-terraform-typescript-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoldstack%2Fses-terraform-typescript-boilerplate/lists"}