Looker is launching an AWS EC2 Stop Instance action, allowing customers to manage their IT infrastructure directly from within Looker. This action will allow Looker customers to stop an EC2 instance based on advance analysis of AWS Cost and Usage data on a one-off or scheduled basis.
Note: Your Looker instance must be on Looker 5.6.
To enable the action in Looker, go to your Admin panel. Then in the Platform section, click the Actions Tab. (Admin > Platform > Actions).
Select “Enable” on the Action you would like to enable.
In your AWS IAM user console, generate and copy an API key [https://console.aws.amazon.com/iam/home?#/users]. (AWS > User Console > Security > Create Access Key)
Copy your AWS Access key and Secret Access key and paste into the Looker Actions Page.
Great, now you’ve setup your API keys so that Looker can communicate with AWS!
dimension: aws_resource_id {
sql: ${TABLE}.aws_resource_id ;;
tags: ["aws_resource_id"]
}
In Looker, view a Look or explore data to displays the EC2 instances you want to stop, e.g. high cost and low utilized instances.
To stop a single instance use the data action, select the ellipsis next to the ID tagged with aws_resource_id.
Then start to send the data now or schedule the data to be sent later or periodically to stop a full list of EC2 instances.
In the Send or Schedule window’s Destination field, select “AWS EC2 - Stop Instance”.
Your instances will be stopped in your AWS management console!