How we can access SQS queue using "AmazonSQSClient" without using AcccessKey and SecretKey? Is there any options or code sample which use Role instead of AccessKey and SecretKey. We are trying to access SQS queue in our AWS environment where Lambda has Role assigned who has access to SQS and we don;t allow to use AccessKey and SecretKey. How to achieve this? Any idea>
I am using Lambda function and AWSSDK.SQS Nuget Package to work with AWS SQS Queues for sending , reading and deleting messages.
So if your lambda function running using IAM Role which has permission to access (read, write, delete = full) then without providing AccessKey and SecretKey you can access sqs queue. I have done this in my project recently.
https://ramanisandeep.wordpress.com/2018/03/10/amazon-simple-queue-service-sqs/
Note: You need to use ProxyHost and ProxyPort if you are running your Lambda function in restricted environment.
i.e
_sqsConfig = new AmazonSQSConfig
{
ProxyHost = proxyHost,
ProxyPort = proxyPort,
ServiceURL = queueUrl,
RegionEndpoint = RegionEndpoint.USEast1
};