How to make the Trust Advisor Check automatically?

Know How Guide and Hands on Guide for AWS

How to make the Trust Advisor Check automatically?

Trust Advisor help identify the baseline issue of below 5 pillars. There is no additional charge for Trust Advisor execution.

5 pillars

Make sure

  1. customers with a Business or Enterprise support plan
  2. The lambda execution role has the AssumeRole permission
    {
     "Version": "2012-10-17",
     "Statement": {
         "Effect": "Allow",
         "Action": "sts:AssumeRole",
         "Resource": "*"
     }
    }
    
  3. You can use the AWS Security Token Service (AWS STS) token to cross account trigger and retrieve Trust Advisor report. More details about How can I configure a Lambda function to assume a role from another AWS account?

Refresh Function RefereshTrustedAdvisor

Invoke the Trust Advisor API to trigger the Check referesh-trusted-advisor.py

Report Function TrustedAdvisorReport

Get the Trust Advisor report and sent out via email to receiver get-trusted-advisor-report.py

You can select use the SES or SNS to sent email

Email example:

SES Email:

reports

SNS Email:

reports

Step Function

Integrate 2 function and automatically triggered by Amazon EventBridge (CloudWatch Events)

step-function

Sample step function define:

SES step-function.json, using SES to send email. This is recommanded deployment which can generate well format email.

SNS step-function.json, using SNS to send email, which used for AWS region which SES service is not available

Reference

Using Trusted Advisor as a web service