Skip to content

Commit

Permalink
feat(env): expose env .access, .server, .region
Browse files Browse the repository at this point in the history
  • Loading branch information
uladkasach committed Sep 16, 2024
1 parent a036309 commit d653a07
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/practices/environments/best-practice/src/utils/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,13 @@ export const { stage } = getEnvironment();
export const serviceClientStage =
stage === Stage.PRODUCTION ? Stage.PRODUCTION : Stage.DEVELOPMENT; // i.e., if its prod, hit prod. otherwise, dev

// export whether we were asked to run locally; // todo, replace this with env.server
export const locally = process.env.LOCALLY === 'true'; // whether we want to acceptance test locally or deployed lambda
// export the v3 environmental variables
export const environment = {
access: stage,
server: (() => {
if (process.env.CI) return 'CICD' as const;
if (process.env.LAMBDA_TASK_ROOT) return 'AWS:LAMBDA' as const;
return 'LOCAL' as const; // default to local
})(),
// region: // todo
};

0 comments on commit d653a07

Please sign in to comment.