Giter VIP home page Giter VIP logo

lua-aws's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lua-aws's Issues

SQS response list or object

In SQS 's response, when there are only one message, an object is returned.
But when there are many messages it returns a table with a key "list=true".

This is normal? It should not be a list always?

lua-aws in Openresty

I am planning to use lua-aws module under Openresty environment. How to leverage the openresty http engine for aws api calls?

TagSpecification does not have rules to serialize

Hi,
I was trying to add Tags when executing RunInstances. On stepping through the code I notice that there are no rules for TagSpecification Array and the function serialize_Struct in request/query_string_serializer.lua prints the message "has no rule to handle. ignored". How are these rules populated? How can we get the rule for TagSpecification?

Thanks,
Milind

s3 putObject is not supported in lua-resty-http

Hello, I'm returning to use the library in a new project!.
So, using lua-resty-http as preferred_engine, s3 putOject returns:

core.lua:159: api_log(): s3:v[2006-03-01]:PutObject:error:...al/share/lua/5.1/lua-aws/engines/http/lua-resty-http.lua:24: Method not supported: PUT @ stack traceback:

use IAM Credentials

I am testing ecs api query on AWS EC2 where my IAM role has full permission to ECS api. But lua-aws is not able to use the IAM role. How to configure lua-aws to use IAM role?

local AWS = require ('lua-aws.init')
local Region = os.getenv('AWS_REGION') or 'us-east-1'
local aws = AWS.new({
region = Region,
endpoint = "https://ecs." .. Region .. ".amazonaws.com"
})

print("https://ecs." .. Region .. ".amazonaws.com")
local api = aws.ECS:api_by_version('2014-11-13')
ok, r = api:listClusters({
maxResults = 10,
})

if not ok then
assert(ok, r)
end

Error trying load services in aws

Hey. i am using the library inside a web app using lapis framework (running on openresty) and i get this error when i try to use it:

ls: cannot access /usr/local/openresty/lualib//usr/local/share/lua/5.1/lua-aws/services//definitions/dynamodb*: No such file or directory

Any idea?

retry API call

suggested by @nkzawa, and I'm +1 on this.

motivation

  • API call not always success, due to various reason. and simply retry API call until success (with some limit) can be good solution for this.
  • if retry duration based on exponential backoff, configuration should be like following:
-- if omitted, proper default value is set
{ 
     max_retry: number, 
     jitter: { 
         lower: number, 
         upper: number 
     }, 
     initial_backoff: number 
} 
  • and can be speficied like following
-- as default config to AWS.new
local aws = AWS.new({
		accessKeyId = os.getenv('AWS_ACCESS_KEY'),
		secretAccessKey = os.getenv('AWS_SECRET_KEY'),
                retry = { ... above configuration }
})

-- or as per call configuration of each API, as its 2nd argument 
-- (need breaking change for the 2nd argument specification, because it currently used to provide response object, which contains file handle to write response directly, see s3 test getObject to file for example)
aws.EC2:api():describeInstances({}, {
        retry = { ... above configuration }
})

test STS

refs #63
figure out the way to test STS use case

S3 not supported

Trying to use s3 does not work,
There are not s3 signer and, rest-xml request,

Cant decode json body in sqs message

Hey, I'm currently sending a json-string in the sqs body message.
I'm having troubles when i try to decode this string message, seems to be that the xml contains
" in each attribute of the message body.
To handle this my poor solution was to do a base64.encode in a string, and a base.decode

SWF failed!

Trying to test swf i get:

swf:v[2012-01-25]: Something wrong in the request nil {"__type":"com.amazon.coral.service#IncompleteSignatureException","message":
"Date must be in ISO-8601 'basic format'. Got '1442252505'. See http://en.wikipedia.org/wiki/ISO_8601"}

in class.lua i think have a bug

local super_class = (type(super) == 'string' or classes[super] and super)

if "type(super)" is "string", then super_class is true, but i think what you want is "classes[super]"

describeInstances with Instance ID does not work

Hi,
I was trying out describeInstances by providing an array (as a lua table) of 1 instance ID. But it always returns all the instances. I tried initializing the array table from the 0 index but that does not work either. Has anyone tried this?

Errors in request 403

Sometimes... when i am sending messages to sqs i get

SENDED: OK
SENDED: OK
sqs:v[2012-11-05]: Something wrong in the request 403 f172e95b-e0c7-4c64-b1be-6b4efcd705654711480a2ec1eb9a97ac41c3268dbcc277a6782e-af92-52ec-9728-34992d8b18dff27f1369-b07b-4faf-9b9b-53af6648d41488bcf4efe24e40ab3131b8c595165db65f212ede-085a-5789-9ce5-62698a40803f6e1930a3-5cb4-4ba5-9241-fda26574ccacaab93f3e2d8c0b37bda597a4038cd320c8d6f592-19ef-5943-bcd0-b9259bf502fbfcb2175f-1fa1-4405-a316-ff7e53a40c5e0e88c6ad853c3e41e04fbf6ec86cc308b95e80fe-b1ff-5a62-917f-cc4933e4b1b00b59c5bb-100d-4ee7-9fa7-fbb4714611b94a4fec4e894444d85dac079518d9ee468fb7d210-3422-5864-a616-9ea7b639936f8b70a9ba-3aba-4751-93d7-ace85b8eab7df287283c0b8cea2d952688cb5174274be153be9c-67e4-5512-adb5-f22be5f8612a67da005e-e9e6-425d-b6fa-a6daddd6fbf9c90029612d8016f39a83d48319a0d5c058f9cf2e-0ed4-5d68-b5a1-83998cc8a65cSenderSignatureDoesNotMatchThe request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.9a08c7ac-067f-5d0a-b3b7-8b1b846273fb
SENDED: OK
SENDED: OK
SENDED: OK

any idea?

How to send params?

When i try to send params for the request...

params = {
QueueUrl = "DEV_email-one2one",
MessageBody = "testing"
}

res = AWS.SQS:api_by_version('2012-11-05'):sendMessage(params)

criztianix@blacker:~$ lua test-aws.lua
sqs:v[2012-11-05]: sendMessage:error:/usr/lib64/lua/5.1/lua-aws/class.lua:34: no such method: QueueUrl
stack traceback:
/usr/lib64/lua/5.1/lua-aws/class.lua:34: in function </usr/lib64/lua/5.1/lua-aws/class.lua:31>
...lua/5.1/lua-aws/requests/query_string_serializer.lua:16: in function 'serialize_struct'
...lua/5.1/lua-aws/requests/query_string_serializer.lua:11: in function 'serialize'
/usr/lib64/lua/5.1/lua-aws/requests/query.lua:13: in function 'serialize_query'
/usr/lib64/lua/5.1/lua-aws/requests/query.lua:27: in function 'build_request'
/usr/lib64/lua/5.1/lua-aws/requests/base.lua:23: in function </usr/lib64/lua/5.1/lua-aws/requests/base.lua:21>
(tail call): ?
[C]: in function 'pcall'
/usr/lib64/lua/5.1/lua-aws/api.lua:79: in function 'sendMessage'
test-aws.lua:19: in main chunk
[C]: ?

on demain initialization of API

motivation

  • currently, lua-aws initialize all version of API of all supported service. that is waste of bootstrap time and resources.
  • it would be better to move on demand initialization, that is, quit build_apis() call in service class constructor and API is initialized when user calls Service:api() or api_by_version()
  • moreover, if API class will be initialized when api() and api_by_version() called, we can pass different AWS config for each API, which is usefull for more enterprise use case.
local aws = AWS.new({
	accessKeyId = os.getenv('AWS_ACCESS_KEY'),
	secretAccessKey = os.getenv('AWS_SECRET_KEY'),
})
aws.EC2:api({ --specific config for ec2. if omitted, default config passed to AWS.new will be used
	accessKeyId = os.getenv('EC2_AWS_ACCESS_KEY'),
	secretAccessKey = os.getenv('EC2_AWS_SECRET_KEY'),
}):describeInstances()

thought

  • we may allow preload API for user those who want to avoid cold start. like following:
local aws = AWS.new({
	accessKeyId = os.getenv('AWS_ACCESS_KEY'),
	secretAccessKey = os.getenv('AWS_SECRET_KEY'),
}, {
           ec2 = "2016-11-15" -- indicate preload 2016-11-15 version of API on creation
           lambda = { -- indicate preload 2015-03-31 version of API with specific config
                "2015-03-31", {
                   accessKeyId = os.getenv('LAMBDA_AWS_ACCESS_KEY'),
                   secretAccessKey = os.getenv('LAMBDA_AWS_SECRET_KEY'),
                }
           }
       }
})

s3 select support

latest version of nodejs aws-sdk support s3 select. Can you add support for s3 select in lua-aws?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.