-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use this with S3 or ES? #13
Comments
@simonvanderveldt you're bringing a good point to use S3 with When NGINX is used only to proxy directly to an AWS service this is not a bad idea. For other cases( i.e. sending logs to Kinesis on |
@ddragosd sorry for the delay, needed some time to checkout the options and see how to implement it, was my first time using openresty :) Anyway, we currently use AWS ElasticSearch service as well as S3 and we needed a proxy to sign our requests to ElasticSearch using v4 auth based on IAM roles/instance profiles. So I worked on that, though the actual implementation is pretty much the same as it would be for S3.
I've commited what I have here https://github.com/simonvanderveldt/api-gateway-aws/tree/payjp/extend-get-authz-header based on the code that's in #12. I do think it would be relatively easy to implement this based on I'd be interested to know what you think about it. I don't mind to make a PR to include it here, though I expect some things should be changed/enhanced. |
I put together a working example of how to use the changes in #12 to https://github.com/azavea/docker-s3-proxy-cache Docker is used to combine the Lua module dependencies with OpenResty into one package. From there, the majority of the heavy lifting is contained within the |
I have a question regarding how to use this with S3 (or other services that don't really have an action).
I've been using the code as proposed in #12 with some changes and I've been able to requests plain text files from S3, but it doesn't really feel right, mainly because
AwsService
basically expects one to useperformAction
and because to make it work with other files I'd have to add all captured headers to the response, effectively creating something that somewhat resembles a proxy.Wouldn't it make more sense to use this library only for the signing of the request and just
proxy_pass
the actual request? That would make the code simpler and fix the header issue as well.Does anyone have any experience with this?
The text was updated successfully, but these errors were encountered: