1. Registry
  2. Packages
  3. Planetscale Provider
  4. API Docs
  5. getPostgresIpRestriction
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

    PostgresIPRestriction DataSource

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as planetscale from "@pulumi/planetscale";
    
    const myPostgresiprestriction = planetscale.getPostgresIpRestriction({
        database: "...my_database...",
        id: "...my_id...",
        organization: "...my_organization...",
    });
    
    import pulumi
    import pulumi_planetscale as planetscale
    
    my_postgresiprestriction = planetscale.get_postgres_ip_restriction(database="...my_database...",
        id="...my_id...",
        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.LookupPostgresIpRestriction(ctx, &planetscale.LookupPostgresIpRestrictionArgs{
    			Database:     "...my_database...",
    			Id:           "...my_id...",
    			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 myPostgresiprestriction = Planetscale.GetPostgresIpRestriction.Invoke(new()
        {
            Database = "...my_database...",
            Id = "...my_id...",
            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.GetPostgresIpRestrictionArgs;
    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 myPostgresiprestriction = PlanetscaleFunctions.getPostgresIpRestriction(GetPostgresIpRestrictionArgs.builder()
                .database("...my_database...")
                .id("...my_id...")
                .organization("...my_organization...")
                .build());
    
        }
    }
    
    variables:
      myPostgresiprestriction:
        fn::invoke:
          function: planetscale:getPostgresIpRestriction
          arguments:
            database: '...my_database...'
            id: '...my_id...'
            organization: '...my_organization...'
    
    Example coming soon!
    

    Using getPostgresIpRestriction

    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 getPostgresIpRestriction(args: GetPostgresIpRestrictionArgs, opts?: InvokeOptions): Promise<GetPostgresIpRestrictionResult>
    function getPostgresIpRestrictionOutput(args: GetPostgresIpRestrictionOutputArgs, opts?: InvokeOutputOptions): Output<GetPostgresIpRestrictionResult>
    def get_postgres_ip_restriction(database: Optional[str] = None,
                                    id: Optional[str] = None,
                                    organization: Optional[str] = None,
                                    opts: Optional[InvokeOptions] = None) -> GetPostgresIpRestrictionResult
    def get_postgres_ip_restriction_output(database: pulumi.Input[Optional[str]] = None,
                                    id: pulumi.Input[Optional[str]] = None,
                                    organization: pulumi.Input[Optional[str]] = None,
                                    opts: Optional[InvokeOutputOptions] = None) -> Output[GetPostgresIpRestrictionResult]
    func LookupPostgresIpRestriction(ctx *Context, args *LookupPostgresIpRestrictionArgs, opts ...InvokeOption) (*LookupPostgresIpRestrictionResult, error)
    func LookupPostgresIpRestrictionOutput(ctx *Context, args *LookupPostgresIpRestrictionOutputArgs, opts ...InvokeOption) LookupPostgresIpRestrictionResultOutput

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

    public static class GetPostgresIpRestriction 
    {
        public static Task<GetPostgresIpRestrictionResult> InvokeAsync(GetPostgresIpRestrictionArgs args, InvokeOptions? opts = null)
        public static Output<GetPostgresIpRestrictionResult> Invoke(GetPostgresIpRestrictionInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetPostgresIpRestrictionResult> Invoke(GetPostgresIpRestrictionInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetPostgresIpRestrictionResult> getPostgresIpRestriction(GetPostgresIpRestrictionArgs args, InvokeOptions options)
    public static Output<GetPostgresIpRestrictionResult> getPostgresIpRestriction(GetPostgresIpRestrictionArgs args, InvokeOptions options)
    public static Output<GetPostgresIpRestrictionResult> getPostgresIpRestriction(GetPostgresIpRestrictionArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: planetscale:index/getPostgresIpRestriction:getPostgresIpRestriction
      arguments:
        # arguments dictionary
    data "planetscale_get_postgres_ip_restriction" "name" {
        # arguments
    }

    The following arguments are supported:

    Database string
    The name of the database
    Id string
    The ID of the IP restriction entry
    Organization string
    The name of the organization the database belongs to
    Database string
    The name of the database
    Id string
    The ID of the IP restriction entry
    Organization string
    The name of the organization the database belongs to
    database string
    The name of the database
    id string
    The ID of the IP restriction entry
    organization string
    The name of the organization the database belongs to
    database String
    The name of the database
    id String
    The ID of the IP restriction entry
    organization String
    The name of the organization the database belongs to
    database string
    The name of the database
    id string
    The ID of the IP restriction entry
    organization string
    The name of the organization the database belongs to
    database str
    The name of the database
    id str
    The ID of the IP restriction entry
    organization str
    The name of the organization the database belongs to
    database String
    The name of the database
    id String
    The ID of the IP restriction entry
    organization String
    The name of the organization the database belongs to

    getPostgresIpRestriction Result

    The following output properties are available:

    Actor GetPostgresIpRestrictionActor
    Cidrs List<string>
    List of CIDR ranges
    Database string
    The name of the database
    Description string
    An optional description for the IP restriction rule
    Id string
    The ID of the IP restriction entry
    Organization string
    The name of the organization the database belongs to
    Role string
    The Postgres role the entry applies to. Empty when it applies to all roles.
    Schema string
    The Postgres schema the entry applies to. Empty when it applies to all schemas.
    Actor GetPostgresIpRestrictionActor
    Cidrs []string
    List of CIDR ranges
    Database string
    The name of the database
    Description string
    An optional description for the IP restriction rule
    Id string
    The ID of the IP restriction entry
    Organization string
    The name of the organization the database belongs to
    Role string
    The Postgres role the entry applies to. Empty when it applies to all roles.
    Schema string
    The Postgres schema the entry applies to. Empty when it applies to all schemas.
    actor object
    cidrs list(string)
    List of CIDR ranges
    database string
    The name of the database
    description string
    An optional description for the IP restriction rule
    id string
    The ID of the IP restriction entry
    organization string
    The name of the organization the database belongs to
    role string
    The Postgres role the entry applies to. Empty when it applies to all roles.
    schema string
    The Postgres schema the entry applies to. Empty when it applies to all schemas.
    actor GetPostgresIpRestrictionActor
    cidrs List<String>
    List of CIDR ranges
    database String
    The name of the database
    description String
    An optional description for the IP restriction rule
    id String
    The ID of the IP restriction entry
    organization String
    The name of the organization the database belongs to
    role String
    The Postgres role the entry applies to. Empty when it applies to all roles.
    schema String
    The Postgres schema the entry applies to. Empty when it applies to all schemas.
    actor GetPostgresIpRestrictionActor
    cidrs string[]
    List of CIDR ranges
    database string
    The name of the database
    description string
    An optional description for the IP restriction rule
    id string
    The ID of the IP restriction entry
    organization string
    The name of the organization the database belongs to
    role string
    The Postgres role the entry applies to. Empty when it applies to all roles.
    schema string
    The Postgres schema the entry applies to. Empty when it applies to all schemas.
    actor GetPostgresIpRestrictionActor
    cidrs Sequence[str]
    List of CIDR ranges
    database str
    The name of the database
    description str
    An optional description for the IP restriction rule
    id str
    The ID of the IP restriction entry
    organization str
    The name of the organization the database belongs to
    role str
    The Postgres role the entry applies to. Empty when it applies to all roles.
    schema str
    The Postgres schema the entry applies to. Empty when it applies to all schemas.
    actor Property Map
    cidrs List<String>
    List of CIDR ranges
    database String
    The name of the database
    description String
    An optional description for the IP restriction rule
    id String
    The ID of the IP restriction entry
    organization String
    The name of the organization the database belongs to
    role String
    The Postgres role the entry applies to. Empty when it applies to all roles.
    schema String
    The Postgres schema the entry applies to. Empty when it applies to all schemas.

    Supporting Types

    GetPostgresIpRestrictionActor

    Id string
    The ID of the actor
    Id string
    The ID of the actor
    id string
    The ID of the actor
    id String
    The ID of the actor
    id string
    The ID of the actor
    id str
    The ID of the actor
    id String
    The ID of the actor

    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