https://github.com/winebarrel/sev
A tool that retrieves AWS Secrets Manager secret values, sets them to environment variables, and executes commands.
https://github.com/winebarrel/sev
aws golang secretsmanager
Last synced: about 1 year ago
JSON representation
A tool that retrieves AWS Secrets Manager secret values, sets them to environment variables, and executes commands.
- Host: GitHub
- URL: https://github.com/winebarrel/sev
- Owner: winebarrel
- License: mit
- Created: 2024-07-04T06:19:53.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-21T03:13:18.000Z (about 1 year ago)
- Last Synced: 2025-04-21T04:34:57.157Z (about 1 year ago)
- Topics: aws, golang, secretsmanager
- Language: Go
- Homepage:
- Size: 176 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sev
[](https://github.com/winebarrel/sev/actions/workflows/ci.yml)
A tool that retrieves AWS Secrets Manager / Parameter Store values, sets them to environment variables, and executes commands.
## Usage
```
Usage: sev --config-glob="~/.sev.toml" ... [flags]
Arguments:
Profile name.
... Command and arguments.
Flags:
-h, --help Show help.
--config-glob="~/.sev.toml" Config file path glob pattern ($SEV_CONFIG).
--default-profile=STRING Fallback profile name ($SEV_DEFAULT_PROFILE).
--[no-]override-aws-profile Use AWS_PROFILE in sev config (enabled by default).
--version
```
## Example
```sh
$ aws secretsmanager get-secret-value --secret-id foo/bar
{
...
"SecretString": "BAZ",
...
$ aws secretsmanager get-secret-value --secret-id foo/zoo # JSON secret
{
...
"SecretString": "{\"TOKEN\":\"AAA\",\"SECRET\":\"BBB\"}",
...
```
```sh
$ cat ~/.sev.toml
[default]
AWS_PROFILE = "prof1" # By default, the AWS_PROFILE in the configuration file is used.
FOO = "secretsmanager://foo/bar"
ZOO = "secretsmanager://foo/zoo:TOKEN"
BAZ = "BAZBAZBAZ"
[another]
HOGE = "secretsmanager://foo/zoo:SECRET"
FOGA = "secretsmanager://foo/bar"
PIYO = "PIYOPIYOPIYO"
```
```sh
# Run `env` command with extra environment variables
$ sev default -- env
FOO=BAZ
ZOO=AAA
BAZ=BAZBAZBAZ
$ sev another -- env
HOGE=BBB
FUGA=BAZ
PIYO=PIYOPIYOPIYO
```
## Get values from Parameter Store
```toml
[default]
AWS_PROFILE = "prof1"
FOO = "parameterstore:///foo/bar"
ZOO = "parameterstore:///foo/zoo"
BAZ = "BAZBAZBAZ"
```