-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
In lesson 06/05 'Securely Handle Algolia API key', I received an error:
"errorMessage": "Invalid value \"undefined\" for header \"x-algolia-api-key\"",
"code": "ERR_HTTP_INVALID_HEADER_VALUE",
I checked the @middy/ssm docs and changed the ssm middleware implementation in functions/sync-users-to-algolia.js to:
.use(
ssm({
cache: true,
cacheExpiry: 5 * 60 * 1000,
fetchData: {
ALGOLIA_APP_ID: `/${STAGE}/algolia-app-id`,
ALGOLIA_WRITE_KEY: `/${STAGE}/algolia-admin-key`,
},
setToContext: true,
throwOnFailedCall: true,
})
)
This resolved the error from the Lambda function and successfully got data into the Algolia index.
Dependencies are:
"@middy/core": "^2.5.7",
"@middy/ssm": "^2.5.7",
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels