Hari Sekhon - Environments
February 3, 2026 · View on GitHub
Environments
Quick Setup
Edit the <cloud>/<environment>/.envrc files with the profiles, regions, and other settings for your environments:
"$EDITOR" aws/dev/.envrc
Then just run make from the top level directory to install direnv and approve all the .envrc files:
make
Now whenever you cd into one of the <cloud>/<environment> directories it'll automatically:
- configure your cloud CLI settings, such as your:
- AWS:
- profile
- region
- EKS cluster
- GCP:
- project
- config configuration
- region (even different regions per service)
- GKE cluster
- AWS:
- switch your
kubectlcontext to the right Kubernetes cluster - set any other environment variables you've specified, such as
- API keys for other services such as Cloudflare
- AWS or GCP Secret Manager keys that tools use to pull secrets from
Detailed Setup
Install
Install direnv.
For convenience you can just run:
make install
which will attempt to install direnv using whatever your local package manager is, or fall back to binary download.
Configure
Edit the <cloud>/<environment>/.envrc files with the profile config names, regions, kubernetes cluster names and other
settings for your environments:
"$EDITOR" aws/dev/.envrc
Approve
Changes to an .envrc require (re)approval for safety.
See aws/README.md or gcp/README.md for more cloud specific information.
Approve Individual .envrc
Approve the $PWD/.envrc changes in the current directory:
direnv allow
Alternatively approve one at a different path:
direnv allow path/to/.envrc
Approve all .envrc
To approve all .envrc under the current directory tree, run this from the top level directory of this repo:
make allow
to direnv allow all the .envrc found in this repo's directory tree.
Directory Structure
$ tree -a aws gcp
aws
├── .envrc
├── README.md
├── dev
│ └── .envrc
├── prod
│ └── .envrc
└── staging
└── .envrc
gcp
├── .envrc
├── README.md
├── dev
│ └── .envrc
├── prod
│ └── .envrc
└── staging
└── .envrc
More Core Repos
Knowledge
DevOps Code
Containerization
CI/CD
Databases - DBA - SQL
DevOps Reloaded
Monitoring
Templates
Desktop
Spotify
The rest of my original source repos are here.
Pre-built Docker images are available on my DockerHub and can be re-generated using the my Dockerfiles repo.