How to create two Postgres databases on Linode?TypeScript
Even though Pulumi does not have native support for Linode as of now, we can utilize Linode's APIs to create resources, including databases. Unfortunately, there is one caveat; Linode does not provide PostgreSQL as a managed database.
However, you can create 2 VMs running on Linode and install PostgreSQL on them manually.
Here's a simple Pulumi program that creates 2 Linode instances. After creating these instances, you can manually install PostgreSQL on them:
In the above code, we are creating two Linode instances and labeling them
rootPassfield is set to
secretRootPassword, which you should change to your own secure root password. And
stackscriptDatais to provide custom data that will be passed into your StackScripts, you can also adjust to your needs. The two instances will have Ubuntu 18.04 as their OS.
You can then SSH into the instances and manually install PostgreSQL. Check Linode's guide on how to install PostgreSQL here. After you set up the databases manually, you can use Postgres' JDBC or any other Postgres client to connect to the databases and manage it from your application.