Package: psread
Quick, simple AWS Parameter Store CLI for listing/reading params with tab completionBackgroundThe AWS-provided tools for using Parameter Store (the web UI and awscli) are fine if you knowexactlywhat you’re trying to find. They’re not so good if you’re… looking… for something, and want to explore your Parameter Store parameters like a filesystem, or hierarchical datastore. This is a dead-simple, quick, and rather ugly hack of a CLI built in Python and largely inspired by theHashicorp VaultCLI, plus shell completion for parameter paths. This doesn’t write parameters or do other “fancy” things. It’s mainly intended for teams who are also using Parameter Store to replace human-centered secret stores (i.e. Vault, KeePass, random encrypted files, etc.) and often have only a vague idea of the exact parameter name they’re looking for.StatusThis is a somewhat-tipsy Friday evening quarantine project. There are (it’s almost painful to write this) no unit tests, and it’s largely cargo-culted from previous work of mine. I’ll gladly accept PRs assuming they look correct, meet PEP8/PyFlakes style, and are relatively straightforward and working. That’s about the end of “support”.RequirementsThis projectrequiresPython 3.6 or later, as it makes use of bothPEP484 type hintsandPEP498 f-strings. It also requiresboto3,argcomplete, andappdirs.Installationpsread can be installed withpip install psreadorpython-mpipinstall psreadTo set up autocompletion in your shell, eitheractivate global completion for argcomplete, or for bash, set up completion for this project specifically. To do that in just your current shell:eval"$(psread--bash-wrapper)"To do that permanently (recommended):echo-e"eval \"\$($(whichpsread)--bash-wrapper)\"">>~/.bashrcUsageThere are two main functionalities: listing parameters and reading parameters. Shell tab completion is included, primarily forbash, via theargcompletepackage.$psread-husage:psread[-h][-v][-w][-V][-R][--called-from-wrapper][{ls,list,read,get}][PARAM]Quick,simpleAWSParameterStoreCLIforlisting/readingparamswithtabcompletionpositionalarguments:{ls,read,get}ActiontoperformPARAMParameter(orparameterpath)tolistorreadoptionalarguments:-h,--helpshowthishelpmessageandexit-v,--verboseverboseoutput.specifytwicefordebug-leveloutput.-w,--bash-wrapperprintbashwrapperfunctiontoSTDOUTandexit-V,--versionPrintversionnumberandexit-R,--recachere-cacheparametersforthisregionofthisaccount--called-from-wrapperDONOTUSEParameter Cachingpsread caches the Names (and only the names) of all parameters in each region of each account that you use it with; this is effectively required for sane tab-completion speeds. The parameters are cached in a Pickle file at a platform-specific path, which can be seen in thepsread-Voutput. This path can be overridden with thePSREAD_CACHE_PATHenvironment variable, which should specify the absolute path to write the pkl file at.By default, parameter names are cached for 86400 seconds (1 day); this can be overridden by setting thePSREAD_CACHE_TTLenvironment variable to an integer cache TTL in seconds.Re-caching of the current region of the current account can be forced by running psread with the-Ror--recacheoption.DebuggingIn order to enable debug logging before normal command-line options and arguments are parsed, such as during tab completion:export PSREAD_LOG=DEBUGRelease ProcessCompletely manual right now:Bump the version inpsread.pyand update the Changelog.python setup.py sdist && python setup.py bdist_wheeltwine upload dist/*git pushgit tag-s-aX.Y.Z-m'X.Y.Z releasedYYYY-mm-dd'&& git tag-vX.Y.Z && git push origin X.Y.Z