Oracle Cloud Infrastructure v3.9.0 published on Wednesday, Sep 24, 2025 by Pulumi
oci.Core.getLocalPeeringGateways
This data source provides the list of Local Peering Gateways in Oracle Cloud Infrastructure Core service.
Lists the local peering gateways (LPGs) for the specified VCN and specified compartment. If the VCN ID is not provided, then the list includes the LPGs from all VCNs in the specified compartment.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testLocalPeeringGateways = oci.Core.getLocalPeeringGateways({
    compartmentId: compartmentId,
    vcnId: testVcn.id,
});
import pulumi
import pulumi_oci as oci
test_local_peering_gateways = oci.Core.get_local_peering_gateways(compartment_id=compartment_id,
    vcn_id=test_vcn["id"])
package main
import (
	"github.com/pulumi/pulumi-oci/sdk/v3/go/oci/core"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := core.GetLocalPeeringGateways(ctx, &core.GetLocalPeeringGatewaysArgs{
			CompartmentId: compartmentId,
			VcnId:         pulumi.StringRef(testVcn.Id),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() => 
{
    var testLocalPeeringGateways = Oci.Core.GetLocalPeeringGateways.Invoke(new()
    {
        CompartmentId = compartmentId,
        VcnId = testVcn.Id,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Core.CoreFunctions;
import com.pulumi.oci.Core.inputs.GetLocalPeeringGatewaysArgs;
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 testLocalPeeringGateways = CoreFunctions.getLocalPeeringGateways(GetLocalPeeringGatewaysArgs.builder()
            .compartmentId(compartmentId)
            .vcnId(testVcn.id())
            .build());
    }
}
variables:
  testLocalPeeringGateways:
    fn::invoke:
      function: oci:Core:getLocalPeeringGateways
      arguments:
        compartmentId: ${compartmentId}
        vcnId: ${testVcn.id}
Using getLocalPeeringGateways
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 getLocalPeeringGateways(args: GetLocalPeeringGatewaysArgs, opts?: InvokeOptions): Promise<GetLocalPeeringGatewaysResult>
function getLocalPeeringGatewaysOutput(args: GetLocalPeeringGatewaysOutputArgs, opts?: InvokeOptions): Output<GetLocalPeeringGatewaysResult>def get_local_peering_gateways(compartment_id: Optional[str] = None,
                               filters: Optional[Sequence[GetLocalPeeringGatewaysFilter]] = None,
                               vcn_id: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetLocalPeeringGatewaysResult
def get_local_peering_gateways_output(compartment_id: Optional[pulumi.Input[str]] = None,
                               filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetLocalPeeringGatewaysFilterArgs]]]] = None,
                               vcn_id: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetLocalPeeringGatewaysResult]func GetLocalPeeringGateways(ctx *Context, args *GetLocalPeeringGatewaysArgs, opts ...InvokeOption) (*GetLocalPeeringGatewaysResult, error)
func GetLocalPeeringGatewaysOutput(ctx *Context, args *GetLocalPeeringGatewaysOutputArgs, opts ...InvokeOption) GetLocalPeeringGatewaysResultOutput> Note: This function is named GetLocalPeeringGateways in the Go SDK.
public static class GetLocalPeeringGateways 
{
    public static Task<GetLocalPeeringGatewaysResult> InvokeAsync(GetLocalPeeringGatewaysArgs args, InvokeOptions? opts = null)
    public static Output<GetLocalPeeringGatewaysResult> Invoke(GetLocalPeeringGatewaysInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetLocalPeeringGatewaysResult> getLocalPeeringGateways(GetLocalPeeringGatewaysArgs args, InvokeOptions options)
public static Output<GetLocalPeeringGatewaysResult> getLocalPeeringGateways(GetLocalPeeringGatewaysArgs args, InvokeOptions options)
fn::invoke:
  function: oci:Core/getLocalPeeringGateways:getLocalPeeringGateways
  arguments:
    # arguments dictionaryThe following arguments are supported:
- CompartmentId string
- The OCID of the compartment.
- Filters
List<GetLocal Peering Gateways Filter> 
- VcnId string
- The OCID of the VCN.
- CompartmentId string
- The OCID of the compartment.
- Filters
[]GetLocal Peering Gateways Filter 
- VcnId string
- The OCID of the VCN.
- compartmentId String
- The OCID of the compartment.
- filters
List<GetLocal Peering Gateways Filter> 
- vcnId String
- The OCID of the VCN.
- compartmentId string
- The OCID of the compartment.
- filters
GetLocal Peering Gateways Filter[] 
- vcnId string
- The OCID of the VCN.
- compartment_id str
- The OCID of the compartment.
- filters
Sequence[GetLocal Peering Gateways Filter] 
- vcn_id str
- The OCID of the VCN.
- compartmentId String
- The OCID of the compartment.
- filters List<Property Map>
- vcnId String
- The OCID of the VCN.
getLocalPeeringGateways Result
The following output properties are available:
- CompartmentId string
- The OCID of the compartment containing the LPG.
- Id string
- The provider-assigned unique ID for this managed resource.
- LocalPeering List<GetGateways Local Peering Gateways Local Peering Gateway> 
- The list of local_peering_gateways.
- Filters
List<GetLocal Peering Gateways Filter> 
- VcnId string
- The OCID of the VCN that uses the LPG.
- CompartmentId string
- The OCID of the compartment containing the LPG.
- Id string
- The provider-assigned unique ID for this managed resource.
- LocalPeering []GetGateways Local Peering Gateways Local Peering Gateway 
- The list of local_peering_gateways.
- Filters
[]GetLocal Peering Gateways Filter 
- VcnId string
- The OCID of the VCN that uses the LPG.
- compartmentId String
- The OCID of the compartment containing the LPG.
- id String
- The provider-assigned unique ID for this managed resource.
- localPeering List<GetGateways Local Peering Gateways Local Peering Gateway> 
- The list of local_peering_gateways.
- filters
List<GetLocal Peering Gateways Filter> 
- vcnId String
- The OCID of the VCN that uses the LPG.
- compartmentId string
- The OCID of the compartment containing the LPG.
- id string
- The provider-assigned unique ID for this managed resource.
- localPeering GetGateways Local Peering Gateways Local Peering Gateway[] 
- The list of local_peering_gateways.
- filters
GetLocal Peering Gateways Filter[] 
- vcnId string
- The OCID of the VCN that uses the LPG.
- compartment_id str
- The OCID of the compartment containing the LPG.
- id str
- The provider-assigned unique ID for this managed resource.
- local_peering_ Sequence[Getgateways Local Peering Gateways Local Peering Gateway] 
- The list of local_peering_gateways.
- filters
Sequence[GetLocal Peering Gateways Filter] 
- vcn_id str
- The OCID of the VCN that uses the LPG.
- compartmentId String
- The OCID of the compartment containing the LPG.
- id String
- The provider-assigned unique ID for this managed resource.
- localPeering List<Property Map>Gateways 
- The list of local_peering_gateways.
- filters List<Property Map>
- vcnId String
- The OCID of the VCN that uses the LPG.
Supporting Types
GetLocalPeeringGatewaysFilter    
GetLocalPeeringGatewaysLocalPeeringGateway      
- CompartmentId string
- The OCID of the compartment.
- Dictionary<string, string>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
- DisplayName string
- A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Dictionary<string, string>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
- Id string
- The LPG's Oracle ID (OCID).
- IsCross boolTenancy Peering 
- Whether the VCN at the other end of the peering is in a different tenancy. Example: false
- PeerAdvertised stringCidr 
- The smallest aggregate CIDR that contains all the CIDR routes advertised by the VCN at the other end of the peering from this LPG. See peerAdvertisedCidrDetailsfor the individual CIDRs. The value isnullif the LPG is not peered. Example:192.168.0.0/16, or if aggregated with172.16.0.0/24then128.0.0.0/1
- PeerAdvertised List<string>Cidr Details 
- The specific ranges of IP addresses available on or via the VCN at the other end of the peering from this LPG. The value is nullif the LPG is not peered. You can use these as destination CIDRs for route rules to route a subnet's traffic to this LPG. Example: [192.168.0.0/16,172.16.0.0/24]
- PeerId string
- The OCID of the peered LPG
- PeeringStatus string
- Whether the LPG is peered with another LPG. NEWmeans the LPG has not yet been peered.PENDINGmeans the peering is being established.REVOKEDmeans the LPG at the other end of the peering has been deleted.
- PeeringStatus stringDetails 
- Additional information regarding the peering status, if applicable.
- RouteTable stringId 
- The OCID of the route table the LPG is using.
- State string
- The LPG's current lifecycle state.
- TimeCreated string
- The date and time the LPG was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- VcnId string
- The OCID of the VCN.
- CompartmentId string
- The OCID of the compartment.
- map[string]string
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
- DisplayName string
- A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- map[string]string
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
- Id string
- The LPG's Oracle ID (OCID).
- IsCross boolTenancy Peering 
- Whether the VCN at the other end of the peering is in a different tenancy. Example: false
- PeerAdvertised stringCidr 
- The smallest aggregate CIDR that contains all the CIDR routes advertised by the VCN at the other end of the peering from this LPG. See peerAdvertisedCidrDetailsfor the individual CIDRs. The value isnullif the LPG is not peered. Example:192.168.0.0/16, or if aggregated with172.16.0.0/24then128.0.0.0/1
- PeerAdvertised []stringCidr Details 
- The specific ranges of IP addresses available on or via the VCN at the other end of the peering from this LPG. The value is nullif the LPG is not peered. You can use these as destination CIDRs for route rules to route a subnet's traffic to this LPG. Example: [192.168.0.0/16,172.16.0.0/24]
- PeerId string
- The OCID of the peered LPG
- PeeringStatus string
- Whether the LPG is peered with another LPG. NEWmeans the LPG has not yet been peered.PENDINGmeans the peering is being established.REVOKEDmeans the LPG at the other end of the peering has been deleted.
- PeeringStatus stringDetails 
- Additional information regarding the peering status, if applicable.
- RouteTable stringId 
- The OCID of the route table the LPG is using.
- State string
- The LPG's current lifecycle state.
- TimeCreated string
- The date and time the LPG was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- VcnId string
- The OCID of the VCN.
- compartmentId String
- The OCID of the compartment.
- Map<String,String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
- displayName String
- A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Map<String,String>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
- id String
- The LPG's Oracle ID (OCID).
- isCross BooleanTenancy Peering 
- Whether the VCN at the other end of the peering is in a different tenancy. Example: false
- peerAdvertised StringCidr 
- The smallest aggregate CIDR that contains all the CIDR routes advertised by the VCN at the other end of the peering from this LPG. See peerAdvertisedCidrDetailsfor the individual CIDRs. The value isnullif the LPG is not peered. Example:192.168.0.0/16, or if aggregated with172.16.0.0/24then128.0.0.0/1
- peerAdvertised List<String>Cidr Details 
- The specific ranges of IP addresses available on or via the VCN at the other end of the peering from this LPG. The value is nullif the LPG is not peered. You can use these as destination CIDRs for route rules to route a subnet's traffic to this LPG. Example: [192.168.0.0/16,172.16.0.0/24]
- peerId String
- The OCID of the peered LPG
- peeringStatus String
- Whether the LPG is peered with another LPG. NEWmeans the LPG has not yet been peered.PENDINGmeans the peering is being established.REVOKEDmeans the LPG at the other end of the peering has been deleted.
- peeringStatus StringDetails 
- Additional information regarding the peering status, if applicable.
- routeTable StringId 
- The OCID of the route table the LPG is using.
- state String
- The LPG's current lifecycle state.
- timeCreated String
- The date and time the LPG was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- vcnId String
- The OCID of the VCN.
- compartmentId string
- The OCID of the compartment.
- {[key: string]: string}
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
- displayName string
- A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- {[key: string]: string}
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
- id string
- The LPG's Oracle ID (OCID).
- isCross booleanTenancy Peering 
- Whether the VCN at the other end of the peering is in a different tenancy. Example: false
- peerAdvertised stringCidr 
- The smallest aggregate CIDR that contains all the CIDR routes advertised by the VCN at the other end of the peering from this LPG. See peerAdvertisedCidrDetailsfor the individual CIDRs. The value isnullif the LPG is not peered. Example:192.168.0.0/16, or if aggregated with172.16.0.0/24then128.0.0.0/1
- peerAdvertised string[]Cidr Details 
- The specific ranges of IP addresses available on or via the VCN at the other end of the peering from this LPG. The value is nullif the LPG is not peered. You can use these as destination CIDRs for route rules to route a subnet's traffic to this LPG. Example: [192.168.0.0/16,172.16.0.0/24]
- peerId string
- The OCID of the peered LPG
- peeringStatus string
- Whether the LPG is peered with another LPG. NEWmeans the LPG has not yet been peered.PENDINGmeans the peering is being established.REVOKEDmeans the LPG at the other end of the peering has been deleted.
- peeringStatus stringDetails 
- Additional information regarding the peering status, if applicable.
- routeTable stringId 
- The OCID of the route table the LPG is using.
- state string
- The LPG's current lifecycle state.
- timeCreated string
- The date and time the LPG was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- vcnId string
- The OCID of the VCN.
- compartment_id str
- The OCID of the compartment.
- Mapping[str, str]
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
- display_name str
- A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Mapping[str, str]
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
- id str
- The LPG's Oracle ID (OCID).
- is_cross_ booltenancy_ peering 
- Whether the VCN at the other end of the peering is in a different tenancy. Example: false
- peer_advertised_ strcidr 
- The smallest aggregate CIDR that contains all the CIDR routes advertised by the VCN at the other end of the peering from this LPG. See peerAdvertisedCidrDetailsfor the individual CIDRs. The value isnullif the LPG is not peered. Example:192.168.0.0/16, or if aggregated with172.16.0.0/24then128.0.0.0/1
- peer_advertised_ Sequence[str]cidr_ details 
- The specific ranges of IP addresses available on or via the VCN at the other end of the peering from this LPG. The value is nullif the LPG is not peered. You can use these as destination CIDRs for route rules to route a subnet's traffic to this LPG. Example: [192.168.0.0/16,172.16.0.0/24]
- peer_id str
- The OCID of the peered LPG
- peering_status str
- Whether the LPG is peered with another LPG. NEWmeans the LPG has not yet been peered.PENDINGmeans the peering is being established.REVOKEDmeans the LPG at the other end of the peering has been deleted.
- peering_status_ strdetails 
- Additional information regarding the peering status, if applicable.
- route_table_ strid 
- The OCID of the route table the LPG is using.
- state str
- The LPG's current lifecycle state.
- time_created str
- The date and time the LPG was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- vcn_id str
- The OCID of the VCN.
- compartmentId String
- The OCID of the compartment.
- Map<String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
- displayName String
- A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Map<String>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
- id String
- The LPG's Oracle ID (OCID).
- isCross BooleanTenancy Peering 
- Whether the VCN at the other end of the peering is in a different tenancy. Example: false
- peerAdvertised StringCidr 
- The smallest aggregate CIDR that contains all the CIDR routes advertised by the VCN at the other end of the peering from this LPG. See peerAdvertisedCidrDetailsfor the individual CIDRs. The value isnullif the LPG is not peered. Example:192.168.0.0/16, or if aggregated with172.16.0.0/24then128.0.0.0/1
- peerAdvertised List<String>Cidr Details 
- The specific ranges of IP addresses available on or via the VCN at the other end of the peering from this LPG. The value is nullif the LPG is not peered. You can use these as destination CIDRs for route rules to route a subnet's traffic to this LPG. Example: [192.168.0.0/16,172.16.0.0/24]
- peerId String
- The OCID of the peered LPG
- peeringStatus String
- Whether the LPG is peered with another LPG. NEWmeans the LPG has not yet been peered.PENDINGmeans the peering is being established.REVOKEDmeans the LPG at the other end of the peering has been deleted.
- peeringStatus StringDetails 
- Additional information regarding the peering status, if applicable.
- routeTable StringId 
- The OCID of the route table the LPG is using.
- state String
- The LPG's current lifecycle state.
- timeCreated String
- The date and time the LPG was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- vcnId String
- The OCID of the VCN.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.
