umegaya / lua-aws

pure-lua implementation of aws REST APIs
122 stars 35 forks source link

support v4 signature method and json style request protocol #8

Closed umegaya closed 9 years ago

umegaya commented 9 years ago

to support kinesis. basic API usage, please see test/kinesis.lua

caveat

some of api described in here, not supported because aws-sdk-js v1.x repo's service definition does not describe them. in aws-sdk-js v2.x, service definition have big change, so I only borrow them from v1.x's. but basic operation (create/delete/list/describe/put/get) are supported.

caution

local api = AWS.EC2:api()
-- new api call : returns {status, data or api_level_error or lua_level_error}
ok, r = api:describeInstances()
-- old api call : returns { data or api_level_error or false, lua_level_error(if occurs) }
r, lua_err = api:describeInstances()
local AWS = require ('lua-aws.init')
AWS = AWS.new({
    accessKeyId = os.getenv('AWS_ACCESS_KEY'),
    secretAccessKey = os.getenv('AWS_SECRET_KEY'),
    oldReturnValue = true,
})