This script will run sysbench
CPU and MEM tests on an EC2 instance as it launches,
commit the results in CSV format into an S3 bucket of your choice,
and automatically terminate the instance (provided it has appropriate IAM permissions).
Change the S3 bucket setting above to a real S3 bucket name.
export RESULTS_BUCKET=<bucket-name>
Also, make sure your EC2 instance has sufficient IAM permissions to:
- write to the S3 bucket of your choice
- modify its own instance attributes (to enable self-destruct)
Embed the script below as part of the EC2 Userdata script on launch.