Open EloyTolosa opened 2 years ago
Hello @EloyTolosa Can you try the code in https://github.com/uber/athenadriver/tree/master/examples and see if they work? If they work, can do debug and compare the difference between your code and the example code?
Hi. I have been looking around the code. I saw the link you provided, and I also looked around https://github.com/uber/athenadriver/blob/master/examples/auth.go which contains several authentication methods. In the auth.go file, I cannot see any method that uses what I need. I need the driver to use the AccessKeyID and SecretAccessKey I provide to the driver, which has all permissions to call executions to Athena. What I can only see is that the AccessKeyID and the SecretAccessKey are dummy and do not have a purpose at all.
Am I wrong? Is the only solution to give the Lambda function all the permissions instead of trying to pass it the credentials?
Thanks
Can you use it like this? @EloyTolosa https://github.com/uber/athenadriver/blob/master/examples/auth.go#L31
Replace the dummy ones with your real ones.
Every time I try that method, it returns this message:
UnrecognizedClientException: The security token included in the request is invalid
I tried with fresh-new AccessKey,SecretAccessKey pair and AccessKey,SecretAccessKey pair given from Assume Role API Call using AWS SDK in Go.
What am I doing wrong? Why does it say that the token included in the request is invalid?
Hey there. I found the issue. Whenever you try to assume a role in another account, you need to set the AwsSessionToken for your request to work. I did that making a call to the sts.AssumeRole function and passing the session token to the config struct.
Thanks a lot for your time.
I have a suggestion. Maybe write this exact example as there are more people that I'm sure they want to assume a role in another account and have this exact problem. You could put the example in https://github.com/uber/athenadriver/blob/master/examples/auth.go, or at least explaining it in case someone needs it.
Great progress @EloyTolosa Can you please share the example code by creating a PR( you can add description in README.md or add the code in auth.go )?
Sure, I'll do it!
Hi, I'm having troubles accessing Athena from a Lambda function. I want to use an AccessKeyID and SecretAccessKey from an IAM User I created, which has the following permissions:
As you can see, there's plenty of permissions to execute queries to athena. Also, I'm unsetting the environment variable AWS_SDK_LOAD_CONFIG by using
as the README says.
But, whenever I make a call to athena, the next error message pops up:
I don't know what the problem could be, and this is driving me nuts. I talked to amazon and they told me that maybe this is something related to this driver.
Thanks a lot in advance.