# Pritunl Terraform provider - fetching existing host/s information

**URL:** <https://forum.pritunl.com/t/pritunl-terraform-provider-fetching-existing-host-s-information/3200>\
**Category:** Pritunl VPN\
**Created:** [April 8, 2025, 8:25am UTC](https://forum.pritunl.com/t/pritunl-terraform-provider-fetching-existing-host-s-information/3200 "2025-04-08T08:25:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kkalugeroff](https://forum.pritunl.com/user_avatar/forum.pritunl.com/kkalugeroff/32/1298_2.png) [@kkalugeroff](https://forum.pritunl.com/u/kkalugeroff)\
**Post date:** [April 8, 2025, 8:25am UTC](https://forum.pritunl.com/t/pritunl-terraform-provider-fetching-existing-host-s-information/3200/1 "2025-04-08T08:25:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [April 8, 2025, 2:08pm UTC](https://forum.pritunl.com/t/pritunl-terraform-provider-fetching-existing-host-s-information/3200/2 "2025-04-08T14:08:08Z")

</div>

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`.
