aws_ses_template Resource
Use the aws_ses_template
InSpec audit resource to test properties of a single AWS Simple Email Service (SES) template.
The AWS::SES::Template
resource specifies an email template.
For additional information, including details on parameters and properties, see the AWS documentation on AWS SES Template.
Install
This resource is available in the Chef InSpec AWS resource pack.
For information on configuring your AWS environment for Chef InSpec and creating an InSpec profile that uses the InSpec AWS resource pack, see the Chef InSpec documentation on the AWS cloud platform.
Syntax
Ensure that the template exists.
describe aws_ses_template(template_name: 'TEMPLATE_NAME') do
it { should exist }
end
Parameters
template_name
(required)The name of the template.
Properties
template_name
- The name of the template.
subject_part
- The subject line of the email.
text_part
- The email body that will be visible to recipients whose email clients do not display HTML.
html_part
- The HTML body of the email.
Examples
Ensure a template name is available.
describe aws_ses_template(template_name: 'TEMPLATE_NAME') do
its('template_name') { should eq 'TEMPLATE_NAME' }
end
Ensure a subject is available in the template.
describe aws_ses_template(template_name: 'TEMPLATE_NAME') do
its('subject_part') { should eq 'HTML_SUBJECT' }
end
Ensure a text part is available in the template.
describe aws_ses_template(template_name: 'TEMPLATE_NAME') do
its('text_part') { should eq 'HTML_TEXT_PART' }
end
Ensure an HTML body is available in the template.
describe aws_ses_template(template_name: 'TEMPLATE_NAME') do
its('html_part') { should eq 'HTML_PART' }
end
Matchers
For a full list of available matchers, see our Universal Matchers page.This resource has the following special matchers.
exist
Use should
to test that the entity exists.
describe aws_ses_template(template_name: 'TEMPLATE_NAME') do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_ses_template(template_name: 'TEMPLATE_NAME') do
it { should_not exist }
end
be_available
Use should
to check if the entity is available.
describe aws_ses_template(template_name: 'TEMPLATE_NAME') do
it { should be_available }
end
AWS Permissions
Your Principal will need the SES:Client:GetTemplateResponse
action with Effect
set to Allow
.