Provides a resource to create a SES template.
resource "aws_ses_template" "MyTemplate" {
name = "MyTemplate"
subject = "Greetings, {{name}}!"
html = "<h1>Hello {{name}},</h1><p>Your favorite animal is {{favoriteanimal}}.</p>"
text = "Hello {{name}},\r\nYour favorite animal is {{favoriteanimal}}."
}
This resource supports the following arguments:
name
- (Required) The name of the template. Cannot exceed 64 characters. You will refer to this name when you send email.html
- (Optional) The HTML body of the email. Must be less than 500KB in size, including both the text and HTML parts.subject
- (Optional) The subject line of the email.text
- (Optional) The email body that will be visible to recipients whose email clients do not display HTML. Must be less than 500KB in size, including both the text and HTML parts.This resource exports the following attributes in addition to the arguments above:
arn
- The ARN of the SES templateid
- The name of the SES templateIn Terraform v1.5.0 and later, use an import
block to import SES templates using the template name. For example:
import {
to = aws_ses_template.MyTemplate
id = "MyTemplate"
}
Using terraform import
, import SES templates using the template name. For example:
% terraform import aws_ses_template.MyTemplate MyTemplate