Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/compwright/aws-env
Load environment variables securely from AWS SSM
https://github.com/compwright/aws-env
aws composer env php
Last synced: about 21 hours ago
JSON representation
Load environment variables securely from AWS SSM
- Host: GitHub
- URL: https://github.com/compwright/aws-env
- Owner: compwright
- License: mit
- Created: 2023-07-24T19:44:20.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-06T15:59:56.000Z (10 months ago)
- Last Synced: 2024-10-14T07:52:51.855Z (26 days ago)
- Topics: aws, composer, env, php
- Language: PHP
- Homepage: https://packagist.org/packages/compwright/aws-env
- Size: 67.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aws-env
Command-line script to obtain service configuration environment and secrets securely from AWS SSM.
## Configuration
Configuration can be provided via command line options or environment variables:
Option | Env. Variable | Description
-------------|----------------|---------------------------------------------------
-p, --path | AWS_ENV_PATH | Path of secrets to load from SSM
-f, --format | AWS_ENV_FORMAT | Output format, one of `dotenv`, `env`, or `export`This script can find AWS credentials in the usual ways, including:
1. If running on EC2, by assuming an IAM role (recommended)
2. By reading the `~/.aws/config` and `~/.aws/credentials` files, with the optional `AWS_PROFILE` environment variable
3. Explicitly with the `AWS_REGION`, `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables## Usage
```
Usage:
aws-env [options]Options:
-p, --path=PATH Parameter key path [default: "/"]
-f, --format=FORMAT Output format: dotenv, env, export [default: "env"]
-h, --help Display help for the given command. When no command is given display help for the bin/aws-env command
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
```For example, to start a shell with a new environment consisting only of the items pulled from AWS SSM + $PATH:
env -i -S"$(bin/aws-env -p /my_app/development) PATH=$PATH" && /bin/bash
## License
MIT License