Need a long lived auth token that can run flyctl proxy

I have some code that runs once a day that establishes a proxy connection to my PostgreSQL database in order to perform offsite backups. The command I use to establish the proxy connection is:

flyctl proxy 15432:5432 -a [DB_TARGET]

This command has been working for a while, using FLY_ACCESS_TOKEN from the environment variable that I created using fly auth token create. However, today that token expired.

Is there a way to create a long lived token (1+ years) that has permission to run the proxy command?

Thanks

In case anyone needs this in the future, with the help of Sam in Support, we figured out a solution.

Use a deploy token, and specify it explicitly on the proxy command. For example:

$ export FLY_PROXY_TOKEN=$(fly tokens create deploy --app [MY_APP])
$ echo $FLY_PROXY_TOKEN
$ fly proxy 15432:5432 -a [MY_APP] --access-token $FLY_PROXY_TOKEN
2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.