jegesh / python-sqs-listener

A simple wrapper for boto3 for listening, and sending, to an AWS SQS queue
Other
154 stars 72 forks source link

Remove check for AWS_ACCOUNT_ID. #37

Closed mmachenry closed 4 years ago

mmachenry commented 4 years ago

The boto3 library is not actually requiring these for my usage. I'm not sure if it ever does. Credentials, when run on the command line, are pulled by boto3 by the ~/aws/credentials file as well as considering the AWS_PROFILE environment variable. When running in ECS the credentials are picked up just fine but AWS_ACCOUNT_ID is not set by the environment so this check needlessly raises exception when it would work. I think it's best to leave the credentials checks to boto3 and let it report what it needs.

jegesh commented 4 years ago

Unless using an IAM role (i.e. the code is running on an EC2 instance), there's no way to get the queue url from the name without knowing the account id. So it's basically a choice between forcing the user to supply the entire queue url (which may not exist yet, and in any case always includes the account id) or supplying just the account id. There's another PR that's been submitted with a satisfactory workaround, and I hope we'll be able to merge in the near future.

hjpotter92 commented 4 years ago

The check restricts using a local server for SQS mock. For eg. https://github.com/p4tin/goaws

jegesh commented 4 years ago

I just merged a similar pull request that provides a workaround