1. Registry
  2. Packages
  3. Planetscale Provider
  4. API Docs
  5. PostgresReadOnlyReplica
Viewing docs for planetscale 1.20.0
published on Thursday, Nov 12, 2026 by planetscale
planetscale
Viewing docs for planetscale 1.20.0
published on Thursday, Nov 12, 2026 by planetscale

    Create PostgresReadOnlyReplica Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new PostgresReadOnlyReplica(name: string, args: PostgresReadOnlyReplicaArgs, opts?: CustomResourceOptions);
    @overload
    def PostgresReadOnlyReplica(resource_name: str,
                                args: PostgresReadOnlyReplicaArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def PostgresReadOnlyReplica(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                branch: Optional[str] = None,
                                database: Optional[str] = None,
                                organization: Optional[str] = None,
                                region: Optional[str] = None,
                                cluster_size: Optional[str] = None,
                                name: Optional[str] = None,
                                replicas: Optional[float] = None)
    func NewPostgresReadOnlyReplica(ctx *Context, name string, args PostgresReadOnlyReplicaArgs, opts ...ResourceOption) (*PostgresReadOnlyReplica, error)
    public PostgresReadOnlyReplica(string name, PostgresReadOnlyReplicaArgs args, CustomResourceOptions? opts = null)
    public PostgresReadOnlyReplica(String name, PostgresReadOnlyReplicaArgs args)
    public PostgresReadOnlyReplica(String name, PostgresReadOnlyReplicaArgs args, CustomResourceOptions options)
    
    type: planetscale:PostgresReadOnlyReplica
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "planetscale_postgres_read_only_replica" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args PostgresReadOnlyReplicaArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args PostgresReadOnlyReplicaArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args PostgresReadOnlyReplicaArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PostgresReadOnlyReplicaArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PostgresReadOnlyReplicaArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var postgresReadOnlyReplicaResource = new Planetscale.PostgresReadOnlyReplica("postgresReadOnlyReplicaResource", new()
    {
        Branch = "string",
        Database = "string",
        Organization = "string",
        Region = "string",
        ClusterSize = "string",
        Name = "string",
        Replicas = 0.0,
    });
    
    example, err := planetscale.NewPostgresReadOnlyReplica(ctx, "postgresReadOnlyReplicaResource", &planetscale.PostgresReadOnlyReplicaArgs{
    	Branch:       pulumi.String("string"),
    	Database:     pulumi.String("string"),
    	Organization: pulumi.String("string"),
    	Region:       pulumi.String("string"),
    	ClusterSize:  pulumi.String("string"),
    	Name:         pulumi.String("string"),
    	Replicas:     pulumi.Float64(0),
    })
    
    resource "planetscale_postgres_read_only_replica" "postgresReadOnlyReplicaResource" {
      lifecycle {
        create_before_destroy = true
      }
      branch       = "string"
      database     = "string"
      organization = "string"
      region       = "string"
      cluster_size = "string"
      name         = "string"
      replicas     = 0
    }
    
    var postgresReadOnlyReplicaResource = new PostgresReadOnlyReplica("postgresReadOnlyReplicaResource", PostgresReadOnlyReplicaArgs.builder()
        .branch("string")
        .database("string")
        .organization("string")
        .region("string")
        .clusterSize("string")
        .name("string")
        .replicas(0.0)
        .build());
    
    postgres_read_only_replica_resource = planetscale.PostgresReadOnlyReplica("postgresReadOnlyReplicaResource",
        branch="string",
        database="string",
        organization="string",
        region="string",
        cluster_size="string",
        name="string",
        replicas=float(0))
    
    const postgresReadOnlyReplicaResource = new planetscale.PostgresReadOnlyReplica("postgresReadOnlyReplicaResource", {
        branch: "string",
        database: "string",
        organization: "string",
        region: "string",
        clusterSize: "string",
        name: "string",
        replicas: 0,
    });
    
    type: planetscale:PostgresReadOnlyReplica
    properties:
        branch: string
        clusterSize: string
        database: string
        name: string
        organization: string
        region: string
        replicas: 0
    

    PostgresReadOnlyReplica Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The PostgresReadOnlyReplica resource accepts the following input properties:

    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.
    Region string
    The region slug for the dedicated read replica, e.g. us-east. The dedicated read replica can run in a different region than the primary. Requires replacement if changed.
    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 dedicated read replica. Requires replacement if changed.
    Replicas double
    The number of instances serving reads. Defaults to 1.
    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.
    Region string
    The region slug for the dedicated read replica, e.g. us-east. The dedicated read replica can run in a different region than the primary. Requires replacement if changed.
    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 dedicated read replica. Requires replacement if changed.
    Replicas float64
    The number of instances serving reads. Defaults to 1.
    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.
    region string
    The region slug for the dedicated read replica, e.g. us-east. The dedicated read replica can run in a different region than the primary. Requires replacement if changed.
    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 dedicated read replica. Requires replacement if changed.
    replicas number
    The number of instances serving reads. Defaults to 1.
    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.
    region String
    The region slug for the dedicated read replica, e.g. us-east. The dedicated read replica can run in a different region than the primary. Requires replacement if changed.
    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 dedicated read replica. Requires replacement if changed.
    replicas Double
    The number of instances serving reads. Defaults to 1.
    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.
    region string
    The region slug for the dedicated read replica, e.g. us-east. The dedicated read replica can run in a different region than the primary. Requires replacement if changed.
    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 dedicated read replica. Requires replacement if changed.
    replicas number
    The number of instances serving reads. Defaults to 1.
    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.
    region str
    The region slug for the dedicated read replica, e.g. us-east. The dedicated read replica can run in a different region than the primary. Requires replacement if changed.
    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 dedicated read replica. Requires replacement if changed.
    replicas float
    The number of instances serving reads. Defaults to 1.
    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.
    region String
    The region slug for the dedicated read replica, e.g. us-east. The dedicated read replica can run in a different region than the primary. Requires replacement if changed.
    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 dedicated read replica. Requires replacement if changed.
    replicas Number
    The number of instances serving reads. Defaults to 1.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the PostgresReadOnlyReplica resource produces the following output properties:

    AccessHostUrl string
    The database connection host for the dedicated read replica.
    Id string
    The provider-assigned unique ID for this managed resource.
    PrivateAccessHostUrl string
    The private database connection host for the dedicated read replica.
    PrivateConnectionServiceName string
    The service name to set up private connectivity for the dedicated read replica.
    AccessHostUrl string
    The database connection host for the dedicated read replica.
    Id string
    The provider-assigned unique ID for this managed resource.
    PrivateAccessHostUrl string
    The private database connection host for the dedicated read replica.
    PrivateConnectionServiceName string
    The service name to set up private connectivity for the dedicated read replica.
    access_host_url string
    The database connection host for the dedicated read replica.
    id string
    The provider-assigned unique ID for this managed resource.
    private_access_host_url string
    The private database connection host for the dedicated read replica.
    private_connection_service_name string
    The service name to set up private connectivity for the dedicated read replica.
    accessHostUrl String
    The database connection host for the dedicated read replica.
    id String
    The provider-assigned unique ID for this managed resource.
    privateAccessHostUrl String
    The private database connection host for the dedicated read replica.
    privateConnectionServiceName String
    The service name to set up private connectivity for the dedicated read replica.
    accessHostUrl string
    The database connection host for the dedicated read replica.
    id string
    The provider-assigned unique ID for this managed resource.
    privateAccessHostUrl string
    The private database connection host for the dedicated read replica.
    privateConnectionServiceName string
    The service name to set up private connectivity for the dedicated read replica.
    access_host_url str
    The database connection host for the dedicated read replica.
    id str
    The provider-assigned unique ID for this managed resource.
    private_access_host_url str
    The private database connection host for the dedicated read replica.
    private_connection_service_name str
    The service name to set up private connectivity for the dedicated read replica.
    accessHostUrl String
    The database connection host for the dedicated read replica.
    id String
    The provider-assigned unique ID for this managed resource.
    privateAccessHostUrl String
    The private database connection host for the dedicated read replica.
    privateConnectionServiceName String
    The service name to set up private connectivity for the dedicated read replica.

    Look up Existing PostgresReadOnlyReplica Resource

    Get an existing PostgresReadOnlyReplica resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: PostgresReadOnlyReplicaState, opts?: CustomResourceOptions): PostgresReadOnlyReplica
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            access_host_url: Optional[str] = None,
            branch: Optional[str] = None,
            cluster_size: Optional[str] = None,
            database: Optional[str] = None,
            name: Optional[str] = None,
            organization: Optional[str] = None,
            private_access_host_url: Optional[str] = None,
            private_connection_service_name: Optional[str] = None,
            region: Optional[str] = None,
            replicas: Optional[float] = None) -> PostgresReadOnlyReplica
    func GetPostgresReadOnlyReplica(ctx *Context, name string, id IDInput, state *PostgresReadOnlyReplicaState, opts ...ResourceOption) (*PostgresReadOnlyReplica, error)
    public static PostgresReadOnlyReplica Get(string name, Input<string> id, PostgresReadOnlyReplicaState? state, CustomResourceOptions? opts = null)
    public static PostgresReadOnlyReplica get(String name, Output<String> id, PostgresReadOnlyReplicaState state, CustomResourceOptions options)
    resources:  existingPostgresReadOnlyReplica:    type: planetscale:PostgresReadOnlyReplica    get:      id: ${id}
    import {
      to = planetscale_postgres_read_only_replica.example
      id = "${id}"
    }
    
    name string
    The unique name of the resulting resource.
    id Input<ID>
    The unique provider ID of the resource to look up.
    state PostgresReadOnlyReplicaState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resulting resource.
    id str
    The unique provider ID of the resource to look up.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resulting resource.
    id IDInput
    The unique provider ID of the resource to look up.
    state PostgresReadOnlyReplicaState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resulting resource.
    id Input<string>
    The unique provider ID of the resource to look up.
    state PostgresReadOnlyReplicaState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resulting resource.
    id Output<String>
    The unique provider ID of the resource to look up.
    state PostgresReadOnlyReplicaState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    options CustomResourceOptions
    Bag of options to control resource's behavior.
    The following state arguments are supported:
    AccessHostUrl string
    The database connection host for the dedicated read replica.
    Branch string
    Branch name from list_branches. Example: main.
    ClusterSize string
    The cluster size SKU, e.g. PS_10_AWS_ARM. Defaults to the primary's cluster size.
    Database string
    Database name slug from list_databases. Example: app-db.
    Name string
    The name of the dedicated read replica. Requires replacement if changed.
    Organization string
    Organization name slug from list_organizations. Example: acme.
    PrivateAccessHostUrl string
    The private database connection host for the dedicated read replica.
    PrivateConnectionServiceName string
    The service name to set up private connectivity for the dedicated read replica.
    Region string
    The region slug for the dedicated read replica, e.g. us-east. The dedicated read replica can run in a different region than the primary. Requires replacement if changed.
    Replicas double
    The number of instances serving reads. Defaults to 1.
    AccessHostUrl string
    The database connection host for the dedicated read replica.
    Branch string
    Branch name from list_branches. Example: main.
    ClusterSize string
    The cluster size SKU, e.g. PS_10_AWS_ARM. Defaults to the primary's cluster size.
    Database string
    Database name slug from list_databases. Example: app-db.
    Name string
    The name of the dedicated read replica. Requires replacement if changed.
    Organization string
    Organization name slug from list_organizations. Example: acme.
    PrivateAccessHostUrl string
    The private database connection host for the dedicated read replica.
    PrivateConnectionServiceName string
    The service name to set up private connectivity for the dedicated read replica.
    Region string
    The region slug for the dedicated read replica, e.g. us-east. The dedicated read replica can run in a different region than the primary. Requires replacement if changed.
    Replicas float64
    The number of instances serving reads. Defaults to 1.
    access_host_url string
    The database connection host for the dedicated read replica.
    branch string
    Branch name from list_branches. Example: main.
    cluster_size string
    The cluster size SKU, e.g. PS_10_AWS_ARM. Defaults to the primary's cluster size.
    database string
    Database name slug from list_databases. Example: app-db.
    name string
    The name of the dedicated read replica. Requires replacement if changed.
    organization string
    Organization name slug from list_organizations. Example: acme.
    private_access_host_url string
    The private database connection host for the dedicated read replica.
    private_connection_service_name string
    The service name to set up private connectivity for the dedicated read replica.
    region string
    The region slug for the dedicated read replica, e.g. us-east. The dedicated read replica can run in a different region than the primary. Requires replacement if changed.
    replicas number
    The number of instances serving reads. Defaults to 1.
    accessHostUrl String
    The database connection host for the dedicated read replica.
    branch String
    Branch name from list_branches. Example: main.
    clusterSize String
    The cluster size SKU, e.g. PS_10_AWS_ARM. Defaults to the primary's cluster size.
    database String
    Database name slug from list_databases. Example: app-db.
    name String
    The name of the dedicated read replica. Requires replacement if changed.
    organization String
    Organization name slug from list_organizations. Example: acme.
    privateAccessHostUrl String
    The private database connection host for the dedicated read replica.
    privateConnectionServiceName String
    The service name to set up private connectivity for the dedicated read replica.
    region String
    The region slug for the dedicated read replica, e.g. us-east. The dedicated read replica can run in a different region than the primary. Requires replacement if changed.
    replicas Double
    The number of instances serving reads. Defaults to 1.
    accessHostUrl string
    The database connection host for the dedicated read replica.
    branch string
    Branch name from list_branches. Example: main.
    clusterSize string
    The cluster size SKU, e.g. PS_10_AWS_ARM. Defaults to the primary's cluster size.
    database string
    Database name slug from list_databases. Example: app-db.
    name string
    The name of the dedicated read replica. Requires replacement if changed.
    organization string
    Organization name slug from list_organizations. Example: acme.
    privateAccessHostUrl string
    The private database connection host for the dedicated read replica.
    privateConnectionServiceName string
    The service name to set up private connectivity for the dedicated read replica.
    region string
    The region slug for the dedicated read replica, e.g. us-east. The dedicated read replica can run in a different region than the primary. Requires replacement if changed.
    replicas number
    The number of instances serving reads. Defaults to 1.
    access_host_url str
    The database connection host for the dedicated read replica.
    branch str
    Branch name from list_branches. Example: main.
    cluster_size str
    The cluster size SKU, e.g. PS_10_AWS_ARM. Defaults to the primary's cluster size.
    database str
    Database name slug from list_databases. Example: app-db.
    name str
    The name of the dedicated read replica. Requires replacement if changed.
    organization str
    Organization name slug from list_organizations. Example: acme.
    private_access_host_url str
    The private database connection host for the dedicated read replica.
    private_connection_service_name str
    The service name to set up private connectivity for the dedicated read replica.
    region str
    The region slug for the dedicated read replica, e.g. us-east. The dedicated read replica can run in a different region than the primary. Requires replacement if changed.
    replicas float
    The number of instances serving reads. Defaults to 1.
    accessHostUrl String
    The database connection host for the dedicated read replica.
    branch String
    Branch name from list_branches. Example: main.
    clusterSize String
    The cluster size SKU, e.g. PS_10_AWS_ARM. Defaults to the primary's cluster size.
    database String
    Database name slug from list_databases. Example: app-db.
    name String
    The name of the dedicated read replica. Requires replacement if changed.
    organization String
    Organization name slug from list_organizations. Example: acme.
    privateAccessHostUrl String
    The private database connection host for the dedicated read replica.
    privateConnectionServiceName String
    The service name to set up private connectivity for the dedicated read replica.
    region String
    The region slug for the dedicated read replica, e.g. us-east. The dedicated read replica can run in a different region than the primary. Requires replacement if changed.
    replicas Number
    The number of instances serving reads. Defaults to 1.

    Package Details

    Repository
    planetscale planetscale/terraform-provider-planetscale
    License
    Notes
    This Pulumi package is based on the planetscale Terraform Provider.
    planetscale
    Viewing docs for planetscale 1.20.0
    published on Thursday, Nov 12, 2026 by planetscale

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial