Hey everyone, I'm trying to use the new Glue expo...
# help
m
Hey everyone, I'm trying to use the new Glue exporter hook, and I'm new to the hooks in general. Is there a way to get the lua script to use the existing AWS IAM session for the LakeFS instance rather than configuring an
access_key_id
and
secret_access_key
in the hook? All the examples I've seen so far are explicitly configuring credentials. eg docs.
Copy code
name: Glue Exporter
on:
  post-commit:
    branches: ["main"]
hooks:
  - id: animals_table_glue_exporter
    type: lua
    properties:
      script_path: "scripts/animals_exporter.lua"
      args:
        aws:
          aws_access_key_id: "<AWS_ACCESS_KEY_ID>"
          aws_secret_access_key: "<AWS_SECRET_ACCESS_KEY>"
          aws_region: "<AWS_REGION>"
and using them to create clients in the lua script:
Copy code
-- export symlinks 
local s3 = aws.s3_client(access_key, secret_key, region)
local result = symlink_exporter.export_s3(s3, table_path, action, {debug=true})
-- register glue table
local glue = aws.glue_client(access_key, secret_key, region)
local res = glue_exporter.export_glue(glue, db, table_path, table_input, action, {debug=true})
So far with LakeFS I've been able to avoid setting up these creds explicitly.
i
Hi Michael, indeed that’s a missing functionality we intend to add soon. Meanwhile, if it helps, you can use env vars instead with
{{ ENV.NAME_OF_VAR }}
described here.