()
| 12 | let cacheInstance; |
| 13 | |
| 14 | async function buildAxios() { |
| 15 | if (cacheInstance) { |
| 16 | return cacheInstance; |
| 17 | } |
| 18 | |
| 19 | const apiKey = await ssm |
| 20 | .getParameter({ |
| 21 | Name: `/linen-dev/${STAGE}/INTERNAL_API_KEY`, |
| 22 | WithDecryption: true, |
| 23 | }) |
| 24 | .promise(); |
| 25 | |
| 26 | cacheInstance = axios.create({ |
| 27 | headers: { 'x-api-internal': apiKey.Parameter?.Value }, |
| 28 | }); |
| 29 | |
| 30 | return cacheInstance; |
| 31 | } |
| 32 | |
| 33 | module.exports.handler = async function (event, context, callback) { |
| 34 | console.log('Process email'); |