Skip to content

Instantly share code, notes, and snippets.

@steve-jansen
Last active August 19, 2016 23:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steve-jansen/cc99c0bd190477573997 to your computer and use it in GitHub Desktop.
Save steve-jansen/cc99c0bd190477573997 to your computer and use it in GitHub Desktop.
Bookmarklet to create a terraform.tfvars file from an Atlas Terraform environment variables page
javascript:var s='';for(i=0;;i++){k=document.forms[0]["runtime_configuration[tf_vars_attributes]["+i+"][key]"];v=document.forms[0]["runtime_configuration[tf_vars_attributes]["+i+"][value]"]; if(k && v){s+=[k.value,'=',v.value,'\n'].join('');}else{break};};window.location="data:text/plain;base64,"+btoa(s);
@steve-jansen
Copy link
Author

Tested in OS X Safari 9.1. YMMV.

@steve-jansen
Copy link
Author

Updated for Atlas' new variables page. Tested in OS X Safari 9.1.2.

@avichalbadaya
Copy link

Works great in chrome as well. Tested on OS X Chrome v 51.0.2704.106 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment