-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathtest2.lua
48 lines (31 loc) · 1.13 KB
/
test2.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
setmetatable(_G, nil) -- disable global warnings
-- make sure we can use dev code
package.path = "./src/?.lua;./src/?/init.lua;"..package.path
-- quick debug dump function
local dump = function(...)
local t = { n = select("#", ...), ...}
if t.n == 1 and type(t[1]) == "table" then t = t[1] end
print(require("pl.pretty").write(t))
end
local AWS = require("resty.aws")
local aws = AWS()
local secretsmanager = aws:SecretsManager { region = "us-east-2" }
dump(secretsmanager:getSecretValue {
SecretId = "arn:aws:secretsmanager:us-east-2:238406704566:secret:test2-HN1F1k",
VersionStage = "AWSCURRENT",
})
--[[
local secret = assert(credentials.fetch_secret(creds, {
SecretId = "arn:aws:secretsmanager:us-east-2:238406704566:secret:test2-HN1F1k",
}))
dump(secret)
local secret = assert(credentials.fetch_secret(creds, {
SecretId = "arn:aws:secretsmanager:us-east-2:238406704566:secret:KEY_VALUE_test-IHwf2S",
}))
dump(secret)
local secret = assert(credentials.fetch_secret(creds, {
SecretId = "arn:aws:secretsmanager:us-east-2:238406704566:secret:test3_plain_text-PDPBwp",
}))
dump(secret)
--]]
--require "resty.credentials.aws.api"