Skip to content

Instantly share code, notes, and snippets.

@Whitecx
Last active May 18, 2023 17:22
Show Gist options
  • Save Whitecx/d9c3019998137f61575f959f4c59ed56 to your computer and use it in GitHub Desktop.
Save Whitecx/d9c3019998137f61575f959f4c59ed56 to your computer and use it in GitHub Desktop.
A chrome snippet for auto-refreshing cloudformation stacks (only for a specific stack, not the list of stacks)
//Returns a promise that resolves after a setTimeout wait period of "seconds"
const wait = async (seconds = 1)=> {
seconds *= 1000;
return new Promise((resolve, reject) => { setTimeout(resolve, seconds)});
}
//Targets the second stacks refresh button (the one when a stack is being viewed) and clicks it on a loop
const runStackRefresh = async () =>{
const stackRefreshBtn = document.getElementsByClassName("stacks-refresh-button")[1];
while(true){
stackRefreshBtn.click();
await wait();
}
}
runStackRefresh();
/*
Could refactor to be more dynamic of any useful refresh button
Would work better as a chrome extension for automatically running when in cloudformation via the console
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment