Come join Pulumi for the industry's first Cloud Engineering Summit! October 7–8. Save Your Spot

PostgreSQL

The PostgreSQL provider for Pulumi can be used to provision any of the resources available for PostgreSQL. The PostgreSQL provider must be configured with credentials to deploy and update resources in PostgreSQL.

See the full API documentation for complete details of the available PostgreSQL provider APIs.

Setup

The PostgreSQL provider supports several options for providing access to PostgreSQL credentials. See the PostgreSQL setup page for details.

Example

const postgresql = require("@pulumi/postgresql")

const myDb = new postgresql.Database("my-database");
import * as postgresql from "@pulumi/postgresql";

const myDb = new postgresql.Database("my-database");
import pulumi_postgresql as postgresql

my_db = postgresql.Database("my-database")
import (
  postgresql "github.com/pulumi/pulumi-postgresql/sdk/v2/go/postgresql"
)

myDb, _ := postgresql.NewDatabase(ctx, "my-database", &postgresql.DatabaseArgs{})
using System.Collections.Generic;
using System.Threading.Tasks;
using Pulumi;
using Pulumi.Postgresql;

class Program
{
    static Task Main() =>
        Deployment.Run(() => {
            mydatabase = new Database("my-database", new DatabaseArgs{});
        });
}

Libraries

The following packages are available in packager managers:

The PostgreSQL provider is open source and available in the pulumi/pulumi-postgresql repo.