ServicesSolutionsIndustriesExpertiseResourcesCompanyMore…Updated: Apr 5, 2024Now you are using Direnv to manage your workspaces, but you stumble upon a difficulty, maybe motivated (like me) by Terraform workspaces.You have a single codebase for a project, but this codebase needs to be deployed to different environments. Now, we can no longer have a .envrc file in the project’s folder, because the environment should be different depending on where we want to deploy. So, how do we solve this? Direnv to the rescue, again.Direnv has a directive called dotenv, which can be used to load a set of variables dynamically. So in our .direnv file, we can write:dotenv .env.${ENVIRONMENT}Then we create two files, .env.dev and .env.prod. So, each time we enter the directory, the filename of the environment to load is built with the variable $ENVIRONMENT (dev or prod in our case).Carlos BarrosoSenior MLOps Engineerteracloud.io [email protected] & AnalyticsAI & Cloud ComputingSolutionsManaged ServicesIndustriesUtilitiesResourcesSucces StoriesStartupsFinancial ServicesBlogSmall & Medium BusinessFrom Idea to Gen AICloud FitEcommerce & RetailOil and GasCompanyAboutJoin usExpertiseAWS Well ArchitectedAWS LambdaAmazon CloudfrontAmazon AuroraAmazon EKSAWS WAFAmazon ECSAmazon Open SearchCopyright © 2026 Teracloud USA LLC.All Rights Reserved. All trademarks are property of their legal owners.AWS GlueAPI Gateway