/
README.yaml
86 lines (66 loc) · 3.08 KB
/
README.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#
# Name of this project
name: terraform-null-smtp-mail
# License of this project
license: "APACHE2"
# Canonical GitHub repo
github_repo: cloudposse/terraform-null-smtp-mail
# Badges to display
badges:
- name: Latest Release
image: https://img.shields.io/github/release/cloudposse/terraform-null-smtp-mail.svg?style=for-the-badge
url: https://github.com/cloudposse/terraform-null-smtp-mail/releases/latest
- name: Last Updated
image: https://img.shields.io/github/last-commit/cloudposse/terraform-null-smtp-mail.svg?style=for-the-badge
url: https://github.com/cloudposse/terraform-null-smtp-mail/commits
- name: Slack Community
image: https://slack.cloudposse.com/for-the-badge.svg
url: https://slack.cloudposse.com
# List any related terraform modules that this module may be used with or that this module depends on.
related:
- name: "emailcli"
description: "12-factor compatible command line tool for sending emails that is written in Go."
url: "https://github.com/wrouesnel/emailcli"
# Short description of this project
description: |-
Terraform Module to send emails using an SMTP server by calling an external `email` command.
introduction: |-
This terraform module uses an external command using the [`local-exec`](https://www.terraform.io/docs/provisioners/local-exec.html) provisioner to send emails. It's ideally suited for sending transactional emails
related to the `apply` phase. For example, notifying a user of their [IAM user account](https://github.com/cloudposse/terraform-aws-iam-user) getting created or the deployment of a new [ECS application](https://github.com/cloudposse/terraform-aws-ecs-web-app).
**NOTE:** The `null` refers to the primary Terraform [provider](https://www.terraform.io/docs/providers/null/index.html) used in this module.
## Dependencies
First install the latest release of the `email` cli tool here: https://github.com/wrouesnel/emailcli/releases
Make sure it exists in your `PATH` (E.g. `/usr/local/bin`)
We distribute an Alpine Linux package (`emailcli`) as part of our [toolchain](https://github.com/cloudposse/packages).
```
curl -sSL https://apk.cloudposse.com/install.sh | sudo bash
apk add emailcli@cloudposse
```
# How to use this project
usage: |2-
```hcl
module "welcome" {
source = "git::https://github.com/cloudposse/terraform-null-smtp-mail.git?ref=master"
host = "smtp.mailgun.org"
port = "587"
username = "postmaster@ourdomain.com"
password = "changeme"
from = "admin@yourdomain.com"
to = ["example@yourdomain.com"]
subject = "Welcome $${first_name}"
body = "Your account has been created. Login here: $${homepage}"
vars = {
first_name = "Example"
homepage = "https://cloudposse.com"
}
}
```
__NOTE:__ Use the `file(...)` interpolation function to use a template file.
include:
- "docs/targets.md"
- "docs/terraform.md"
# Contributors to this project
contributors: []