user14328853
user14328853

Reputation: 434

How to pass private key for snowsql via a github secret?

I have a SnowSQL docker container set up that uses a key and key passphrase to connect. This works fine, I tested on local with docker-compose and in my snoqsql config file I have a path to my .p8 key.

But I'm trying to use this with github actions. I created a github secret for the repo SSQL_PRIVATE_KEY where the value is the actual string within the p8 file

-----BEGIN ENCRYPTED PRIVATE KEY-----
big long string here
-----END ENCRYPTED PRIVATE KEY-----

I then tried to use this key in my entrypoint:

snowsql -f ${INPUT_QUERY_FILE} \
  -o quiet=true \
  -o friendly=false \
  -o header=false \
  --private-key-path=${INPUT_SSQL_PRIVATE_KEY} \
  --config ${INPUT_SSQL_CONFIG_FILE}

Get error message:

Path '' does not exist

This only happens when I include the private-key-path in the call to snowsql, as opposed to including it in the config file.

How can I pass the p8 key within a docker secret to snowsql to run the query?

Upvotes: 1

Views: 1091

Answers (1)

Srinath Menon
Srinath Menon

Reputation: 1642

The format for this parameter does not have an "=" sign. As in the format for this command with private key path should be as follows :

--private-key-path <path>/rsa_key.p8

Upvotes: 1

Related Questions