Pritunl Terraform provider - fetching existing host/s information

Hello,

Currently, the only method to retrieve existing hosts in Pritunl is to use the hostname of the server where Pritunl service runs. In the AWS environment, this hostname is the private IP of the EC2 instance. However, relying on an instance’s private IP is not considered best practice, as this part of the EC2 metadata is ephemeral. Is there a way to configure a static hostname for the server running Pritunl instead of depending on the instance’s private IP?

Thank you.

I didn’t develop that Terraform provider but you can set the hostname with sudo nmcli general hostname new-hostname on RHEL 9 or similar commands on other systems. This should then be reflected in Pritunl and can be used to reference the hosts with that new hostname.

Hosts are also referenced in the database by the ID stored in /var/lib/pritunl/pritunl.uuid.