-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
838fa45
commit 8fa3d76
Showing
3 changed files
with
60 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { findParameter, getParameters } from "./configHelpers"; | ||
import { Parameter, SSM } from '@aws-sdk/client-ssm'; | ||
|
||
interface TranscriptionConfig { | ||
test: string // TODO: This is just the foundation of getting params from SSM | ||
} | ||
|
||
const region = process.env['AWS_REGION']; | ||
|
||
const ssm = new SSM({ | ||
region, | ||
}); | ||
|
||
export const getConfig = async (): Promise<TranscriptionConfig> => { | ||
const stage = process.env['STAGE'] || 'DEV'; | ||
const paramPath = `/${stage}/investigations/transcription-service/`; | ||
|
||
const parameters = await getParameters(paramPath, ssm); | ||
const parameterNames = parameters.map((param: Parameter) => { | ||
return param.Name; | ||
}); | ||
|
||
console.log(`Parameters fetched: ${parameterNames.join(", ")}`); | ||
const testParam = findParameter(parameters, paramPath, "test"); | ||
|
||
return { | ||
test: testParam | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters