Skip to content

Instantly share code, notes, and snippets.

@klauszhang
Last active May 23, 2019 04:01
Show Gist options
  • Save klauszhang/558662b2476e51796f6fe461def25bae to your computer and use it in GitHub Desktop.
Save klauszhang/558662b2476e51796f6fe461def25bae to your computer and use it in GitHub Desktop.
Extract aws config from eb
const val = Array.from(document.getElementsByTagName('tbody')[1].children)
.filter(ele => ele.className === 'ng-scope')
.map(element => ({
[element.children[0].children[0].value]:
element.children[1].children[0].value,
}))
.filter(value => Object.keys(value)[0])
.reduce((curr, acc) => ({ ...curr, ...acc }), {})
JSON.stringify(val)
// adding the following will make it useable for bash
Object.keys(val).reduce((result, key)=>(`${result}${key}=${val[key]}\n`), '')
@klauszhang
Copy link
Author

klauszhang commented Apr 15, 2019

Stay on config page and run the script

@SherryH
Copy link

SherryH commented Apr 29, 2019

For Elasticbeanstalk

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