Skip to content

Instantly share code, notes, and snippets.

@oshri-humanz
Last active April 4, 2021 14:56
Show Gist options
  • Save oshri-humanz/886b0c826ff7e383603fe5e0e83c8b2a to your computer and use it in GitHub Desktop.
Save oshri-humanz/886b0c826ff7e383603fe5e0e83c8b2a to your computer and use it in GitHub Desktop.
AWS copy environment variables using js console
// Copy from lambda
let str="";document.getElementsByClassName("awsui-table-row").forEach(e=>{str+=e.innerText.split("\t").join("=")+";"});
let dummy=document.createElement("textarea");
document.body.appendChild(dummy),dummy.value=str,dummy.select(),document.execCommand("copy"),document.body.removeChild(dummy);
// Copy from EBS
let str="";document.querySelectorAll('.properties-table tbody tr').forEach(e=>{
let row = e.querySelectorAll('td input');
if(row && row.length===2 && row[0].value!=='' && row[1].value!==''){
str+=row[0].value +"=" + row[1].value + ";"}});
let dummy=document.createElement("textarea");
document.body.appendChild(dummy),dummy.value=str,dummy.select(),document.execCommand("copy"),document.body.removeChild(dummy);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment