2 Answers
- Newest
- Most votes
- Most comments
1
To set up an automated process for exporting organizational reports of Trusted Advisor checks without having to sign in to the AWS Management Console, you can use AWS CLI and AWS IAM roles. Write a bash script or python code to schedule the automatic execution at your desired frequency
answered a year ago
1
Hello,
check out this step will be helpful for you
- Create IAM Role
- Go to IAM Console.
- Create a Role for Lambda with TrustedAdvisorFullAccess and AmazonS3FullAccess policies.
- Name it as you like.
- Create Lambda Function
- Go to Lambda Console.
- Create Function:
- Runtime: Python.
- Role: Use the role
3.Add Code:
import boto3
import datetime
def lambda_handler(event, context):
client = boto3.client('support')
s3_client = boto3.client('s3')
bucket_name = 'your-s3-bucket-name'
date_str = datetime.datetime.now().strftime("%Y-%m-%d")
file_name = f"trusted_advisor_report_{date_str}.json"
response = client.describe_trusted_advisor_checks(language='en')
checks = response['checks']
s3_client.put_object(
Bucket=bucket_name,
Key=file_name,
Body=str(checks)
)
return {'statusCode': 200, 'body': 'Report saved to S3'}
- Schedule Lambda
- Go to CloudWatch Console.
- Create Rule:
- Event Source: Schedule rate.
- Target: Your Lambda function.
- Name it and create.
This will automatically export the Trusted Advisor report
Relevant content
- asked 2 years ago
- asked a year ago
- asked 4 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago

Hello I have tried this approach and I believe the above solution will not be get the trusted advisor checks for all accounts **client.describe_trusted_advisor_checks(language='en') **this will only export checks for that current account. How we will be able to get all the checked for all account from org view. Is there any other API available to access the org view report and download it using API.