Comments (8)
@jradtilbrook Yep, looks good enough to me. Actually, it's so small, you should just copy-paste the code I'd say. Let's not get left-pad
ded here :)
(BTW, https://github.com/alessio/shellescape/blob/master/escargs/escargs.go really should have been called "escargo" :P)
from chamber.
This sounds like quite a useful addition. I'd be willing to give it a go if no one else has elected to do it and/or you need some help. Let me know
from chamber.
@nickatsegment proposal accepted - I'll rename the tool shortly :)
from chamber.
Hi! Can you tell us about your use case?
It's not possible for a child process to manipulate the environment of its caller, so what you're asking for isn't technically possible. Specifically, chamber
is a child process of the shell from which you're invoking it -- once chamber
exits, any environment variables it sets disappear along with it.
There are a few workarounds possible.
One is to make chamber
have a mode that emits a shell script that can then be evaluated by the invoking shell. You'd then capture the environment variables by invoking it like eval "$(chamber export)"
.
The other option, which you can use without any modifications to Chamber, is to run something like exec chamber exec ... /bin/bash
. This substitutes the current shell process with one that has been populated with the environment variables from Parameter Store.
from chamber.
@otterley Hi, my use case is populating secrets to an environment that runs locally.
I thought about something like your second option with eval "$(chamber export)"
If you think that this is not a good use then you can drop it...
Anyway, chamber is truly awesome. our production is using it completely now and I've written a blog post about it - https://medium.com/prodopsio/managing-application-secrets-on-aws-with-ssm-and-chamber-3615d08cc599
Kudos!
from chamber.
I've updated the title to better describe your request. Specifically, something like a chamber env
that prints a shell script that can be eval
'ed by the caller.
from chamber.
@jradtilbrook Go for it!
One thing you'd have to watch out for is safe shell quoting. That's non-trivial code; maybe there's a library out there to do it for us
from chamber.
Sounds good. I've found this pretty simple library, https://github.com/alessio/shellescape. Are you happy for me to use that?
from chamber.
Related Issues (20)
- Support camel-cased / snake-cased keys HOT 1
- `list` and `exec` on non-existent or inaccessible services fails silently on S3 KMS backend
- Chamber exec bash function HOT 1
- Add option to write the `value` from prompt if `value` is not provided
- Allow reading from and writing to plain text using secretsmanager backend
- Add ability to deploy configs from the configuration file HOT 4
- CVE-2022-27664 - net/http in Go before 1.18.6 and 1.19.x before 1.19.1 HOT 2
- `write` allows for invalid shell variable creation HOT 2
- Security Scans flagging go-complier v1.13.15 HOT 3
- Bug Importing UPPER_CASE_KEYs HOT 3
- consider adding semantic version info in "version" subcommand HOT 4
- Issues with chamber and aws sso
- CVE-2023-24538 - Go Lang 1.19.6 Critical Vulnerability HOT 1
- Please add renovatebot or dependabot to keep dependencies updated HOT 1
- Please consider dropping support for older golang versions like go1.15 and go1.16
- Please consider using GetParameter(s) instead of GetParametersByPath
- Logger writes to stdout, messing up output HOT 2
- Chamber is not working with recommended AWS SSO config that uses sso-session HOT 15
- CVE-2023-29404 - Go Lang Critical Vulnerability HOT 1
- Feature request: No clobber of existing environment variables HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chamber.