You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While this might be intentional I have the problem that AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from my environment are overwriting the credentials stated in the sourcecode. Is there an option to "force" credentials from the code?
Here is my code:
const{ Client }=require('@elastic/elasticsearch')// const elasticsearch = require('@elastic/elasticsearch')const{ createConnector }=require('aws-elasticsearch-js')constdomain=process.env.ES_HOSTconstregion=process.env.AWS_DEFAULT_REGIONconstaccessKeyId=process.env.AWS_ACCESS_KEY_IDconstsecretAccessKey=process.env.AWS_SECRET_ACCESS_KEY// heads up: this is called on every requestconstgetCreds=(cb)=>{// load creds from somewhere...constcredentials={ accessKeyId, secretAccessKey }// or credentials = { sessionToken }consterr=null// if you give an error, the request will abortcb(err,credentials)}exportconstes=newClient({node: domain,Connection: createConnector({ region, getCreds }),})
The text was updated successfully, but these errors were encountered:
While this might be intentional I have the problem that AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from my environment are overwriting the credentials stated in the sourcecode. Is there an option to "force" credentials from the code?
Here is my code:
The text was updated successfully, but these errors were encountered: