Open winsomely opened 1 month ago
Hi, @winsomely
TokenFileWebIdentityCredential is an implementation of fetching IAM credentials in the EKS environment with "IAM role for service account" enabled. Typically you don't need to call it directly
If you're running your openresty program inside the EKS environment with IRSA enabled, you can do something simple as follows:
-- in the "init" phase initialize the configuration
local _ = require("resty.aws.config").global
-- In your code
local AWS = require("resty.aws")
local AWS_global_config = require("resty.aws.config").global
local config = { region = AWS_global_config.region }
local aws = AWS(config)
local s3 = aws:S3()
-- Invoke a method.
local results, err = s3:getObject {
Bucket = "my-bucket",
Key = "my-key",
}
Can you provide an example of getting the aws s3 object using the TokenFileWebIdentityCredentials approach?