Skip to content

Instantly share code, notes, and snippets.

@theY4Kman
Last active June 8, 2020 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theY4Kman/9938a82b2176aa4ef3fb38fec564500c to your computer and use it in GitHub Desktop.
Save theY4Kman/9938a82b2176aa4ef3fb38fec564500c to your computer and use it in GitHub Desktop.
Link instance IDs on Beanstalk's Health page to the EC2 Console
// ==UserScript==
// @name Linkify beanstalk instances
// @namespace https://perchsecurity.com
// @updateURL https://gist.githubusercontent.com/theY4Kman/9938a82b2176aa4ef3fb38fec564500c/raw/beanstalk-instance-linker.tamper.js
// @version 1.0
// @description Link instance IDs to EC2 console in Beanstalk
// @author theY4Kman
// @match https://console.aws.amazon.com/elasticbeanstalk/*
// @match https://*.console.aws.amazon.com/elasticbeanstalk/*
// @grant none
// ==/UserScript==
$(function() {
'use strict';
$('body').on('mouseup', '[ng-click*="instancePopover"]', function(e) {
const instanceId = $(this).text().trim();
const href = `https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#Instances:instanceId=${instanceId};sort=instanceId`;
const link = $('<a>').attr('href', href).hide().appendTo(this);
link.on('click', function() { $(this).remove() });
link[0].dispatchEvent(new MouseEvent('click', { button: e.button, which: e.which }));
e.preventDefault();
return false;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment