The ECS Environment Generator is a utility program that extracts environment variables and secrets from an AWS ECS task definition and generates a .env
file.
- Extract environment variables and secrets from ECS task definitions.
- Cache secrets to improve performance and reduce AWS Secret Manager API calls.
- Support for different cloud providers (currently AWS is supported).
- Verbose logging for debugging purposes.
- Go (v1.16 or later)
- AWS credentials set up, either as environment variables (
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
) or via the AWS credentials file.
To build the binary:
go build -o ecsenv
To generate a .env
file from an ECS task definition:
./ecsenv generate-env [taskDefinitionName] --region [region] --provider aws
To list all support cloud providers:
./ecsenv list-providers
-v, --verbose
: Enable verbose output.-r, --region
: Specify the AWS region. Defaults tous-west-2
.-p, --provider
: Specify the cloud provider. Defaults toaws
.
To run the unit tests:
go test -v ./...
Feel free to submit pull requests for new features or bug fixes. Please ensure that any changes include relevant unit tests.
MIT