1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. oracledatabase
  5. getOdbSubnet
Viewing docs for Google Cloud v9.16.0
published on Thursday, Mar 19, 2026 by Pulumi
gcp logo
Viewing docs for Google Cloud v9.16.0
published on Thursday, Mar 19, 2026 by Pulumi

    Get information about an ODB Subnet.

    For more information see the

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const my_subnet = gcp.oracledatabase.getOdbSubnet({
        location: "us-east4",
        odbnetwork: "my-network-id",
        odbSubnetId: "my-subnet-id",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    my_subnet = gcp.oracledatabase.get_odb_subnet(location="us-east4",
        odbnetwork="my-network-id",
        odb_subnet_id="my-subnet-id")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/oracledatabase"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := oracledatabase.LookupOdbSubnet(ctx, &oracledatabase.LookupOdbSubnetArgs{
    			Location:    "us-east4",
    			Odbnetwork:  "my-network-id",
    			OdbSubnetId: "my-subnet-id",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var my_subnet = Gcp.OracleDatabase.GetOdbSubnet.Invoke(new()
        {
            Location = "us-east4",
            Odbnetwork = "my-network-id",
            OdbSubnetId = "my-subnet-id",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.oracledatabase.OracledatabaseFunctions;
    import com.pulumi.gcp.oracledatabase.inputs.GetOdbSubnetArgs;
    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 my-subnet = OracledatabaseFunctions.getOdbSubnet(GetOdbSubnetArgs.builder()
                .location("us-east4")
                .odbnetwork("my-network-id")
                .odbSubnetId("my-subnet-id")
                .build());
    
        }
    }
    
    variables:
      my-subnet:
        fn::invoke:
          function: gcp:oracledatabase:getOdbSubnet
          arguments:
            location: us-east4
            odbnetwork: my-network-id
            odbSubnetId: my-subnet-id
    

    Attributes reference

    See gcp.oracledatabase.OdbSubnet resource for details of the available attributes.

    Using getOdbSubnet

    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 getOdbSubnet(args: GetOdbSubnetArgs, opts?: InvokeOptions): Promise<GetOdbSubnetResult>
    function getOdbSubnetOutput(args: GetOdbSubnetOutputArgs, opts?: InvokeOptions): Output<GetOdbSubnetResult>
    def get_odb_subnet(location: Optional[str] = None,
                       odb_subnet_id: Optional[str] = None,
                       odbnetwork: Optional[str] = None,
                       project: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetOdbSubnetResult
    def get_odb_subnet_output(location: Optional[pulumi.Input[str]] = None,
                       odb_subnet_id: Optional[pulumi.Input[str]] = None,
                       odbnetwork: Optional[pulumi.Input[str]] = None,
                       project: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetOdbSubnetResult]
    func LookupOdbSubnet(ctx *Context, args *LookupOdbSubnetArgs, opts ...InvokeOption) (*LookupOdbSubnetResult, error)
    func LookupOdbSubnetOutput(ctx *Context, args *LookupOdbSubnetOutputArgs, opts ...InvokeOption) LookupOdbSubnetResultOutput

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

    public static class GetOdbSubnet 
    {
        public static Task<GetOdbSubnetResult> InvokeAsync(GetOdbSubnetArgs args, InvokeOptions? opts = null)
        public static Output<GetOdbSubnetResult> Invoke(GetOdbSubnetInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetOdbSubnetResult> getOdbSubnet(GetOdbSubnetArgs args, InvokeOptions options)
    public static Output<GetOdbSubnetResult> getOdbSubnet(GetOdbSubnetArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcp:oracledatabase/getOdbSubnet:getOdbSubnet
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Location string
    The location of the resource.
    OdbSubnetId string
    The ID of the ODB Subnet.
    Odbnetwork string
    The ID of the parent ODB Network.
    Project string
    The project to which the resource belongs. If it is not provided, the provider project is used.
    Location string
    The location of the resource.
    OdbSubnetId string
    The ID of the ODB Subnet.
    Odbnetwork string
    The ID of the parent ODB Network.
    Project string
    The project to which the resource belongs. If it is not provided, the provider project is used.
    location String
    The location of the resource.
    odbSubnetId String
    The ID of the ODB Subnet.
    odbnetwork String
    The ID of the parent ODB Network.
    project String
    The project to which the resource belongs. If it is not provided, the provider project is used.
    location string
    The location of the resource.
    odbSubnetId string
    The ID of the ODB Subnet.
    odbnetwork string
    The ID of the parent ODB Network.
    project string
    The project to which the resource belongs. If it is not provided, the provider project is used.
    location str
    The location of the resource.
    odb_subnet_id str
    The ID of the ODB Subnet.
    odbnetwork str
    The ID of the parent ODB Network.
    project str
    The project to which the resource belongs. If it is not provided, the provider project is used.
    location String
    The location of the resource.
    odbSubnetId String
    The ID of the ODB Subnet.
    odbnetwork String
    The ID of the parent ODB Network.
    project String
    The project to which the resource belongs. If it is not provided, the provider project is used.

    getOdbSubnet Result

    The following output properties are available:

    CidrRange string
    CreateTime string
    DeletionProtection bool
    EffectiveLabels Dictionary<string, string>
    Id string
    The provider-assigned unique ID for this managed resource.
    Labels Dictionary<string, string>
    Location string
    Name string
    OdbSubnetId string
    Odbnetwork string
    PulumiLabels Dictionary<string, string>
    Purpose string
    State string
    Project string
    CidrRange string
    CreateTime string
    DeletionProtection bool
    EffectiveLabels map[string]string
    Id string
    The provider-assigned unique ID for this managed resource.
    Labels map[string]string
    Location string
    Name string
    OdbSubnetId string
    Odbnetwork string
    PulumiLabels map[string]string
    Purpose string
    State string
    Project string
    cidrRange String
    createTime String
    deletionProtection Boolean
    effectiveLabels Map<String,String>
    id String
    The provider-assigned unique ID for this managed resource.
    labels Map<String,String>
    location String
    name String
    odbSubnetId String
    odbnetwork String
    pulumiLabels Map<String,String>
    purpose String
    state String
    project String
    cidrRange string
    createTime string
    deletionProtection boolean
    effectiveLabels {[key: string]: string}
    id string
    The provider-assigned unique ID for this managed resource.
    labels {[key: string]: string}
    location string
    name string
    odbSubnetId string
    odbnetwork string
    pulumiLabels {[key: string]: string}
    purpose string
    state string
    project string
    cidr_range str
    create_time str
    deletion_protection bool
    effective_labels Mapping[str, str]
    id str
    The provider-assigned unique ID for this managed resource.
    labels Mapping[str, str]
    location str
    name str
    odb_subnet_id str
    odbnetwork str
    pulumi_labels Mapping[str, str]
    purpose str
    state str
    project str
    cidrRange String
    createTime String
    deletionProtection Boolean
    effectiveLabels Map<String>
    id String
    The provider-assigned unique ID for this managed resource.
    labels Map<String>
    location String
    name String
    odbSubnetId String
    odbnetwork String
    pulumiLabels Map<String>
    purpose String
    state String
    project String

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Viewing docs for Google Cloud v9.16.0
    published on Thursday, Mar 19, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.