I am running a web service in Kubernetes environment. I have attached a role (custom_role) to the pod.
This role has permission to access SQS queue.
Now, how do I utilize this role while accessing the SQS? This is how the current code looks like (in a test environment).
const sqsClient = new aws.SQS({apiVersion: '2016-07-19',region: 'us-east-1',accessKeyId: XXX,secretAccessKey: YYY,params: { QueueUrl: 'Queue URL' }
});
Now I have to change this code to use the role attached to pod. How do i do that?
I tried doing this, assuming that the SDK will automatically take the creds attached to the pod, but it did not work.
const sqsClient = new aws.SQS({apiVersion: '2016-07-19',region: 'us-east-1',params: { QueueUrl: 'Queue URL' }
I got the below error
Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1
What mistake am I making?