1. Registry
  2. Packages
  3. Planetscale Provider
  4. API Docs
  5. getPostgresReadOnlyReplicas
Viewing docs for planetscale 1.11.0
published on Friday, Sep 18, 2026 by planetscale
Viewing docs for planetscale 1.11.0
published on Friday, Sep 18, 2026 by planetscale

    PostgresReadOnlyReplicas DataSource

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as planetscale from "@pulumi/planetscale";
    
    const myPostgresreadonlyreplicas = planetscale.getPostgresReadOnlyReplicas({
        branch: "...my_branch...",
        database: "...my_database...",
        organization: "...my_organization...",
    });
    
    import pulumi
    import pulumi_planetscale as planetscale
    
    my_postgresreadonlyreplicas = planetscale.get_postgres_read_only_replicas(branch="...my_branch...",
        database="...my_database...",
        organization="...my_organization...")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/planetscale/planetscale"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := planetscale.GetPostgresReadOnlyReplicas(ctx, &planetscale.GetPostgresReadOnlyReplicasArgs{
    			Branch:       "...my_branch...",
    			Database:     "...my_database...",
    			Organization: "...my_organization...",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Planetscale = Pulumi.Planetscale;
    
    return await Deployment.RunAsync(() => 
    {
        var myPostgresreadonlyreplicas = Planetscale.GetPostgresReadOnlyReplicas.Invoke(new()
        {
            Branch = "...my_branch...",
            Database = "...my_database...",
            Organization = "...my_organization...",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.planetscale.PlanetscaleFunctions;
    import com.pulumi.planetscale.inputs.GetPostgresReadOnlyReplicasArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var myPostgresreadonlyreplicas = PlanetscaleFunctions.getPostgresReadOnlyReplicas(GetPostgresReadOnlyReplicasArgs.builder()
                .branch("...my_branch...")
                .database("...my_database...")
                .organization("...my_organization...")
                .build());
    
        }
    }
    
    variables:
      myPostgresreadonlyreplicas:
        fn::invoke:
          function: planetscale:getPostgresReadOnlyReplicas
          arguments:
            branch: '...my_branch...'
            database: '...my_database...'
            organization: '...my_organization...'
    
    Example coming soon!
    

    Using getPostgresReadOnlyReplicas

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getPostgresReadOnlyReplicas(args: GetPostgresReadOnlyReplicasArgs, opts?: InvokeOptions): Promise<GetPostgresReadOnlyReplicasResult>
    function getPostgresReadOnlyReplicasOutput(args: GetPostgresReadOnlyReplicasOutputArgs, opts?: InvokeOutputOptions): Output<GetPostgresReadOnlyReplicasResult>
    def get_postgres_read_only_replicas(branch: Optional[str] = None,
                                        database: Optional[str] = None,
                                        organization: Optional[str] = None,
                                        opts: Optional[InvokeOptions] = None) -> GetPostgresReadOnlyReplicasResult
    def get_postgres_read_only_replicas_output(branch: pulumi.Input[Optional[str]] = None,
                                        database: pulumi.Input[Optional[str]] = None,
                                        organization: pulumi.Input[Optional[str]] = None,
                                        opts: Optional[InvokeOutputOptions] = None) -> Output[GetPostgresReadOnlyReplicasResult]
    func GetPostgresReadOnlyReplicas(ctx *Context, args *GetPostgresReadOnlyReplicasArgs, opts ...InvokeOption) (*GetPostgresReadOnlyReplicasResult, error)
    func GetPostgresReadOnlyReplicasOutput(ctx *Context, args *GetPostgresReadOnlyReplicasOutputArgs, opts ...InvokeOption) GetPostgresReadOnlyReplicasResultOutput

    > Note: This function is named GetPostgresReadOnlyReplicas in the Go SDK.

    public static class GetPostgresReadOnlyReplicas 
    {
        public static Task<GetPostgresReadOnlyReplicasResult> InvokeAsync(GetPostgresReadOnlyReplicasArgs args, InvokeOptions? opts = null)
        public static Output<GetPostgresReadOnlyReplicasResult> Invoke(GetPostgresReadOnlyReplicasInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetPostgresReadOnlyReplicasResult> Invoke(GetPostgresReadOnlyReplicasInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetPostgresReadOnlyReplicasResult> getPostgresReadOnlyReplicas(GetPostgresReadOnlyReplicasArgs args, InvokeOptions options)
    public static Output<GetPostgresReadOnlyReplicasResult> getPostgresReadOnlyReplicas(GetPostgresReadOnlyReplicasArgs args, InvokeOptions options)
    public static Output<GetPostgresReadOnlyReplicasResult> getPostgresReadOnlyReplicas(GetPostgresReadOnlyReplicasArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: planetscale:index/getPostgresReadOnlyReplicas:getPostgresReadOnlyReplicas
      arguments:
        # arguments dictionary
    data "planetscale_get_postgres_read_only_replicas" "name" {
        # arguments
    }

    The following arguments are supported:

    Branch string
    Branch name from list_branches. Example: main.
    Database string
    Database name slug from list_databases. Example: app-db.
    Organization string
    Organization name slug from list_organizations. Example: acme.
    Branch string
    Branch name from list_branches. Example: main.
    Database string
    Database name slug from list_databases. Example: app-db.
    Organization string
    Organization name slug from list_organizations. Example: acme.
    branch string
    Branch name from list_branches. Example: main.
    database string
    Database name slug from list_databases. Example: app-db.
    organization string
    Organization name slug from list_organizations. Example: acme.
    branch String
    Branch name from list_branches. Example: main.
    database String
    Database name slug from list_databases. Example: app-db.
    organization String
    Organization name slug from list_organizations. Example: acme.
    branch string
    Branch name from list_branches. Example: main.
    database string
    Database name slug from list_databases. Example: app-db.
    organization string
    Organization name slug from list_organizations. Example: acme.
    branch str
    Branch name from list_branches. Example: main.
    database str
    Database name slug from list_databases. Example: app-db.
    organization str
    Organization name slug from list_organizations. Example: acme.
    branch String
    Branch name from list_branches. Example: main.
    database String
    Database name slug from list_databases. Example: app-db.
    organization String
    Organization name slug from list_organizations. Example: acme.

    getPostgresReadOnlyReplicas Result

    The following output properties are available:

    Branch string
    Branch name from list_branches. Example: main.
    Database string
    Database name slug from list_databases. Example: app-db.
    Datas List<GetPostgresReadOnlyReplicasData>
    Returns read-only replicas
    Id string
    The provider-assigned unique ID for this managed resource.
    Organization string
    Organization name slug from list_organizations. Example: acme.
    Branch string
    Branch name from list_branches. Example: main.
    Database string
    Database name slug from list_databases. Example: app-db.
    Datas []GetPostgresReadOnlyReplicasData
    Returns read-only replicas
    Id string
    The provider-assigned unique ID for this managed resource.
    Organization string
    Organization name slug from list_organizations. Example: acme.
    branch string
    Branch name from list_branches. Example: main.
    database string
    Database name slug from list_databases. Example: app-db.
    datas list(object)
    Returns read-only replicas
    id string
    The provider-assigned unique ID for this managed resource.
    organization string
    Organization name slug from list_organizations. Example: acme.
    branch String
    Branch name from list_branches. Example: main.
    database String
    Database name slug from list_databases. Example: app-db.
    datas List<GetPostgresReadOnlyReplicasData>
    Returns read-only replicas
    id String
    The provider-assigned unique ID for this managed resource.
    organization String
    Organization name slug from list_organizations. Example: acme.
    branch string
    Branch name from list_branches. Example: main.
    database string
    Database name slug from list_databases. Example: app-db.
    datas GetPostgresReadOnlyReplicasData[]
    Returns read-only replicas
    id string
    The provider-assigned unique ID for this managed resource.
    organization string
    Organization name slug from list_organizations. Example: acme.
    branch str
    Branch name from list_branches. Example: main.
    database str
    Database name slug from list_databases. Example: app-db.
    datas Sequence[GetPostgresReadOnlyReplicasData]
    Returns read-only replicas
    id str
    The provider-assigned unique ID for this managed resource.
    organization str
    Organization name slug from list_organizations. Example: acme.
    branch String
    Branch name from list_branches. Example: main.
    database String
    Database name slug from list_databases. Example: app-db.
    datas List<Property Map>
    Returns read-only replicas
    id String
    The provider-assigned unique ID for this managed resource.
    organization String
    Organization name slug from list_organizations. Example: acme.

    Supporting Types

    GetPostgresReadOnlyReplicasData

    AccessHostUrl string
    The database connection host for the read-only replica
    ClusterSize string
    The cluster size SKU, e.g. PS_10_AWS_ARM. Defaults to the primary's cluster size.
    Name string
    The name of the read-only replica
    PrivateAccessHostUrl string
    The private database connection host for the read-only replica
    PrivateConnectionServiceName string
    The service name to set up private connectivity for the read-only replica
    Replicas double
    The number of instances serving reads in this read-only replica
    AccessHostUrl string
    The database connection host for the read-only replica
    ClusterSize string
    The cluster size SKU, e.g. PS_10_AWS_ARM. Defaults to the primary's cluster size.
    Name string
    The name of the read-only replica
    PrivateAccessHostUrl string
    The private database connection host for the read-only replica
    PrivateConnectionServiceName string
    The service name to set up private connectivity for the read-only replica
    Replicas float64
    The number of instances serving reads in this read-only replica
    access_host_url string
    The database connection host for the read-only replica
    cluster_size string
    The cluster size SKU, e.g. PS_10_AWS_ARM. Defaults to the primary's cluster size.
    name string
    The name of the read-only replica
    private_access_host_url string
    The private database connection host for the read-only replica
    private_connection_service_name string
    The service name to set up private connectivity for the read-only replica
    replicas number
    The number of instances serving reads in this read-only replica
    accessHostUrl String
    The database connection host for the read-only replica
    clusterSize String
    The cluster size SKU, e.g. PS_10_AWS_ARM. Defaults to the primary's cluster size.
    name String
    The name of the read-only replica
    privateAccessHostUrl String
    The private database connection host for the read-only replica
    privateConnectionServiceName String
    The service name to set up private connectivity for the read-only replica
    replicas Double
    The number of instances serving reads in this read-only replica
    accessHostUrl string
    The database connection host for the read-only replica
    clusterSize string
    The cluster size SKU, e.g. PS_10_AWS_ARM. Defaults to the primary's cluster size.
    name string
    The name of the read-only replica
    privateAccessHostUrl string
    The private database connection host for the read-only replica
    privateConnectionServiceName string
    The service name to set up private connectivity for the read-only replica
    replicas number
    The number of instances serving reads in this read-only replica
    access_host_url str
    The database connection host for the read-only replica
    cluster_size str
    The cluster size SKU, e.g. PS_10_AWS_ARM. Defaults to the primary's cluster size.
    name str
    The name of the read-only replica
    private_access_host_url str
    The private database connection host for the read-only replica
    private_connection_service_name str
    The service name to set up private connectivity for the read-only replica
    replicas float
    The number of instances serving reads in this read-only replica
    accessHostUrl String
    The database connection host for the read-only replica
    clusterSize String
    The cluster size SKU, e.g. PS_10_AWS_ARM. Defaults to the primary's cluster size.
    name String
    The name of the read-only replica
    privateAccessHostUrl String
    The private database connection host for the read-only replica
    privateConnectionServiceName String
    The service name to set up private connectivity for the read-only replica
    replicas Number
    The number of instances serving reads in this read-only replica

    Package Details

    Repository
    planetscale planetscale/terraform-provider-planetscale
    License
    Notes
    This Pulumi package is based on the planetscale Terraform Provider.
    Viewing docs for planetscale 1.11.0
    published on Friday, Sep 18, 2026 by planetscale

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial