Know How Guide and Hands on Guide for AWS
Trust Advisor help identify the baseline issue of below 5 pillars. There is no additional charge for Trust Advisor execution.
Make sure
AssumeRole
permission
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource": "*"
}
}
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"trustedadvisor:*",
"support:*"
],
"Resource": "*"
}
]
}
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Action": "sts:AssumeRole"
},
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::you-account:role/lambda_basic_execution"
},
"Action": "sts:AssumeRole"
}
]
}
Invoke the Trust Advisor API to trigger the Check referesh-trusted-advisor.py
Env variable: STS_ROLE_ARN : cross account STS Role ARN list, split by “ |
” |
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
TO_EMAIL
and FROM_EMAIL
for sender email and receiver email;SNS_TOPIC_ARN
for SNS topic arn;STS_ROLE_ARN : cross account STS Role ARN list, split by “ |
” |
Email example:
SES Email:
SNS Email:
Integrate 2 function and automatically triggered by Amazon EventBridge (CloudWatch Events)
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