1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Identity
  5. getNetworkSources
Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi

oci.Identity.getNetworkSources

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi

This data source provides the list of Network Sources in Oracle Cloud Infrastructure Identity service.

Lists the network sources in your tenancy. You must specify your tenancy’s OCID as the value for the compartment ID (remember that the tenancy is simply the root compartment). See Where to Get the Tenancy’s OCID and User’s OCID.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testNetworkSources = oci.Identity.getNetworkSources({
    compartmentId: tenancyOcid,
    name: networkSourceName,
    state: networkSourceState,
});
Copy
import pulumi
import pulumi_oci as oci

test_network_sources = oci.Identity.get_network_sources(compartment_id=tenancy_ocid,
    name=network_source_name,
    state=network_source_state)
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/identity"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := identity.GetNetworkSources(ctx, &identity.GetNetworkSourcesArgs{
			CompartmentId: tenancyOcid,
			Name:          pulumi.StringRef(networkSourceName),
			State:         pulumi.StringRef(networkSourceState),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testNetworkSources = Oci.Identity.GetNetworkSources.Invoke(new()
    {
        CompartmentId = tenancyOcid,
        Name = networkSourceName,
        State = networkSourceState,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Identity.IdentityFunctions;
import com.pulumi.oci.Identity.inputs.GetNetworkSourcesArgs;
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 testNetworkSources = IdentityFunctions.getNetworkSources(GetNetworkSourcesArgs.builder()
            .compartmentId(tenancyOcid)
            .name(networkSourceName)
            .state(networkSourceState)
            .build());

    }
}
Copy
variables:
  testNetworkSources:
    fn::invoke:
      function: oci:Identity:getNetworkSources
      arguments:
        compartmentId: ${tenancyOcid}
        name: ${networkSourceName}
        state: ${networkSourceState}
Copy

Using getNetworkSources

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 getNetworkSources(args: GetNetworkSourcesArgs, opts?: InvokeOptions): Promise<GetNetworkSourcesResult>
function getNetworkSourcesOutput(args: GetNetworkSourcesOutputArgs, opts?: InvokeOptions): Output<GetNetworkSourcesResult>
Copy
def get_network_sources(compartment_id: Optional[str] = None,
                        filters: Optional[Sequence[_identity.GetNetworkSourcesFilter]] = None,
                        name: Optional[str] = None,
                        state: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetNetworkSourcesResult
def get_network_sources_output(compartment_id: Optional[pulumi.Input[str]] = None,
                        filters: Optional[pulumi.Input[Sequence[pulumi.Input[_identity.GetNetworkSourcesFilterArgs]]]] = None,
                        name: Optional[pulumi.Input[str]] = None,
                        state: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetNetworkSourcesResult]
Copy
func GetNetworkSources(ctx *Context, args *GetNetworkSourcesArgs, opts ...InvokeOption) (*GetNetworkSourcesResult, error)
func GetNetworkSourcesOutput(ctx *Context, args *GetNetworkSourcesOutputArgs, opts ...InvokeOption) GetNetworkSourcesResultOutput
Copy

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

public static class GetNetworkSources 
{
    public static Task<GetNetworkSourcesResult> InvokeAsync(GetNetworkSourcesArgs args, InvokeOptions? opts = null)
    public static Output<GetNetworkSourcesResult> Invoke(GetNetworkSourcesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetNetworkSourcesResult> getNetworkSources(GetNetworkSourcesArgs args, InvokeOptions options)
public static Output<GetNetworkSourcesResult> getNetworkSources(GetNetworkSourcesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:Identity/getNetworkSources:getNetworkSources
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

CompartmentId This property is required. string
The OCID of the compartment (remember that the tenancy is simply the root compartment).
Filters Changes to this property will trigger replacement. List<GetNetworkSourcesFilter>
Name string
A filter to only return resources that match the given name exactly.
State string
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
CompartmentId This property is required. string
The OCID of the compartment (remember that the tenancy is simply the root compartment).
Filters Changes to this property will trigger replacement. []GetNetworkSourcesFilter
Name string
A filter to only return resources that match the given name exactly.
State string
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
compartmentId This property is required. String
The OCID of the compartment (remember that the tenancy is simply the root compartment).
filters Changes to this property will trigger replacement. List<GetNetworkSourcesFilter>
name String
A filter to only return resources that match the given name exactly.
state String
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
compartmentId This property is required. string
The OCID of the compartment (remember that the tenancy is simply the root compartment).
filters Changes to this property will trigger replacement. GetNetworkSourcesFilter[]
name string
A filter to only return resources that match the given name exactly.
state string
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
compartment_id This property is required. str
The OCID of the compartment (remember that the tenancy is simply the root compartment).
filters Changes to this property will trigger replacement. Sequence[identity.GetNetworkSourcesFilter]
name str
A filter to only return resources that match the given name exactly.
state str
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
compartmentId This property is required. String
The OCID of the compartment (remember that the tenancy is simply the root compartment).
filters Changes to this property will trigger replacement. List<Property Map>
name String
A filter to only return resources that match the given name exactly.
state String
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.

getNetworkSources Result

The following output properties are available:

CompartmentId string
The OCID of the tenancy containing the network source. The tenancy is the root compartment.
Id string
The provider-assigned unique ID for this managed resource.
NetworkSources List<GetNetworkSourcesNetworkSource>
The list of network_sources.
Filters List<GetNetworkSourcesFilter>
Name string
The name you assign to the network source during creation. The name must be unique across the tenancy and cannot be changed.
State string
The network source object's current state. After creating a network source, make sure its lifecycleState changes from CREATING to ACTIVE before using it.
CompartmentId string
The OCID of the tenancy containing the network source. The tenancy is the root compartment.
Id string
The provider-assigned unique ID for this managed resource.
NetworkSources []GetNetworkSourcesNetworkSource
The list of network_sources.
Filters []GetNetworkSourcesFilter
Name string
The name you assign to the network source during creation. The name must be unique across the tenancy and cannot be changed.
State string
The network source object's current state. After creating a network source, make sure its lifecycleState changes from CREATING to ACTIVE before using it.
compartmentId String
The OCID of the tenancy containing the network source. The tenancy is the root compartment.
id String
The provider-assigned unique ID for this managed resource.
networkSources List<GetNetworkSourcesNetworkSource>
The list of network_sources.
filters List<GetNetworkSourcesFilter>
name String
The name you assign to the network source during creation. The name must be unique across the tenancy and cannot be changed.
state String
The network source object's current state. After creating a network source, make sure its lifecycleState changes from CREATING to ACTIVE before using it.
compartmentId string
The OCID of the tenancy containing the network source. The tenancy is the root compartment.
id string
The provider-assigned unique ID for this managed resource.
networkSources GetNetworkSourcesNetworkSource[]
The list of network_sources.
filters GetNetworkSourcesFilter[]
name string
The name you assign to the network source during creation. The name must be unique across the tenancy and cannot be changed.
state string
The network source object's current state. After creating a network source, make sure its lifecycleState changes from CREATING to ACTIVE before using it.
compartment_id str
The OCID of the tenancy containing the network source. The tenancy is the root compartment.
id str
The provider-assigned unique ID for this managed resource.
network_sources Sequence[identity.GetNetworkSourcesNetworkSource]
The list of network_sources.
filters Sequence[identity.GetNetworkSourcesFilter]
name str
The name you assign to the network source during creation. The name must be unique across the tenancy and cannot be changed.
state str
The network source object's current state. After creating a network source, make sure its lifecycleState changes from CREATING to ACTIVE before using it.
compartmentId String
The OCID of the tenancy containing the network source. The tenancy is the root compartment.
id String
The provider-assigned unique ID for this managed resource.
networkSources List<Property Map>
The list of network_sources.
filters List<Property Map>
name String
The name you assign to the network source during creation. The name must be unique across the tenancy and cannot be changed.
state String
The network source object's current state. After creating a network source, make sure its lifecycleState changes from CREATING to ACTIVE before using it.

Supporting Types

GetNetworkSourcesFilter

Name This property is required. string
A filter to only return resources that match the given name exactly.
Values This property is required. List<string>
Regex bool
Name This property is required. string
A filter to only return resources that match the given name exactly.
Values This property is required. []string
Regex bool
name This property is required. String
A filter to only return resources that match the given name exactly.
values This property is required. List<String>
regex Boolean
name This property is required. string
A filter to only return resources that match the given name exactly.
values This property is required. string[]
regex boolean
name This property is required. str
A filter to only return resources that match the given name exactly.
values This property is required. Sequence[str]
regex bool
name This property is required. String
A filter to only return resources that match the given name exactly.
values This property is required. List<String>
regex Boolean

GetNetworkSourcesNetworkSource

CompartmentId This property is required. string
The OCID of the compartment (remember that the tenancy is simply the root compartment).
DefinedTags This property is required. 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"}
Description This property is required. string
The description you assign to the network source. Does not have to be unique, and it's changeable.
FreeformTags This property is required. 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 This property is required. string
The OCID of the network source.
InactiveState This property is required. string
The detailed status of INACTIVE lifecycleState.
Name This property is required. string
A filter to only return resources that match the given name exactly.
PublicSourceLists This property is required. List<string>
A list of allowed public IP addresses and CIDR ranges.
Services This property is required. List<string>
A list of services allowed to make on-behalf-of requests. These requests can have different source IPs than those specified in the network source. Currently, only all and none are supported. The default is all.
State This property is required. string
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
TimeCreated This property is required. string
Date and time the group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
VirtualSourceLists This property is required. List<GetNetworkSourcesNetworkSourceVirtualSourceList>
A list of allowed VCN OCID and IP range pairs. Example:"vcnId": "ocid1.vcn.oc1.iad.aaaaaaaaexampleuniqueID", "ipRanges": [ "129.213.39.0/24" ]
CompartmentId This property is required. string
The OCID of the compartment (remember that the tenancy is simply the root compartment).
DefinedTags This property is required. 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"}
Description This property is required. string
The description you assign to the network source. Does not have to be unique, and it's changeable.
FreeformTags This property is required. 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 This property is required. string
The OCID of the network source.
InactiveState This property is required. string
The detailed status of INACTIVE lifecycleState.
Name This property is required. string
A filter to only return resources that match the given name exactly.
PublicSourceLists This property is required. []string
A list of allowed public IP addresses and CIDR ranges.
Services This property is required. []string
A list of services allowed to make on-behalf-of requests. These requests can have different source IPs than those specified in the network source. Currently, only all and none are supported. The default is all.
State This property is required. string
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
TimeCreated This property is required. string
Date and time the group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
VirtualSourceLists This property is required. []GetNetworkSourcesNetworkSourceVirtualSourceList
A list of allowed VCN OCID and IP range pairs. Example:"vcnId": "ocid1.vcn.oc1.iad.aaaaaaaaexampleuniqueID", "ipRanges": [ "129.213.39.0/24" ]
compartmentId This property is required. String
The OCID of the compartment (remember that the tenancy is simply the root compartment).
definedTags This property is required. 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"}
description This property is required. String
The description you assign to the network source. Does not have to be unique, and it's changeable.
freeformTags This property is required. 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 This property is required. String
The OCID of the network source.
inactiveState This property is required. String
The detailed status of INACTIVE lifecycleState.
name This property is required. String
A filter to only return resources that match the given name exactly.
publicSourceLists This property is required. List<String>
A list of allowed public IP addresses and CIDR ranges.
services This property is required. List<String>
A list of services allowed to make on-behalf-of requests. These requests can have different source IPs than those specified in the network source. Currently, only all and none are supported. The default is all.
state This property is required. String
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
timeCreated This property is required. String
Date and time the group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
virtualSourceLists This property is required. List<GetNetworkSourcesNetworkSourceVirtualSourceList>
A list of allowed VCN OCID and IP range pairs. Example:"vcnId": "ocid1.vcn.oc1.iad.aaaaaaaaexampleuniqueID", "ipRanges": [ "129.213.39.0/24" ]
compartmentId This property is required. string
The OCID of the compartment (remember that the tenancy is simply the root compartment).
definedTags This property is required. {[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"}
description This property is required. string
The description you assign to the network source. Does not have to be unique, and it's changeable.
freeformTags This property is required. {[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 This property is required. string
The OCID of the network source.
inactiveState This property is required. string
The detailed status of INACTIVE lifecycleState.
name This property is required. string
A filter to only return resources that match the given name exactly.
publicSourceLists This property is required. string[]
A list of allowed public IP addresses and CIDR ranges.
services This property is required. string[]
A list of services allowed to make on-behalf-of requests. These requests can have different source IPs than those specified in the network source. Currently, only all and none are supported. The default is all.
state This property is required. string
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
timeCreated This property is required. string
Date and time the group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
virtualSourceLists This property is required. GetNetworkSourcesNetworkSourceVirtualSourceList[]
A list of allowed VCN OCID and IP range pairs. Example:"vcnId": "ocid1.vcn.oc1.iad.aaaaaaaaexampleuniqueID", "ipRanges": [ "129.213.39.0/24" ]
compartment_id This property is required. str
The OCID of the compartment (remember that the tenancy is simply the root compartment).
defined_tags This property is required. 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"}
description This property is required. str
The description you assign to the network source. Does not have to be unique, and it's changeable.
freeform_tags This property is required. 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 This property is required. str
The OCID of the network source.
inactive_state This property is required. str
The detailed status of INACTIVE lifecycleState.
name This property is required. str
A filter to only return resources that match the given name exactly.
public_source_lists This property is required. Sequence[str]
A list of allowed public IP addresses and CIDR ranges.
services This property is required. Sequence[str]
A list of services allowed to make on-behalf-of requests. These requests can have different source IPs than those specified in the network source. Currently, only all and none are supported. The default is all.
state This property is required. str
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
time_created This property is required. str
Date and time the group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
virtual_source_lists This property is required. Sequence[identity.GetNetworkSourcesNetworkSourceVirtualSourceList]
A list of allowed VCN OCID and IP range pairs. Example:"vcnId": "ocid1.vcn.oc1.iad.aaaaaaaaexampleuniqueID", "ipRanges": [ "129.213.39.0/24" ]
compartmentId This property is required. String
The OCID of the compartment (remember that the tenancy is simply the root compartment).
definedTags This property is required. 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"}
description This property is required. String
The description you assign to the network source. Does not have to be unique, and it's changeable.
freeformTags This property is required. 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 This property is required. String
The OCID of the network source.
inactiveState This property is required. String
The detailed status of INACTIVE lifecycleState.
name This property is required. String
A filter to only return resources that match the given name exactly.
publicSourceLists This property is required. List<String>
A list of allowed public IP addresses and CIDR ranges.
services This property is required. List<String>
A list of services allowed to make on-behalf-of requests. These requests can have different source IPs than those specified in the network source. Currently, only all and none are supported. The default is all.
state This property is required. String
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
timeCreated This property is required. String
Date and time the group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
virtualSourceLists This property is required. List<Property Map>
A list of allowed VCN OCID and IP range pairs. Example:"vcnId": "ocid1.vcn.oc1.iad.aaaaaaaaexampleuniqueID", "ipRanges": [ "129.213.39.0/24" ]

GetNetworkSourcesNetworkSourceVirtualSourceList

IpRanges This property is required. List<string>
VcnId This property is required. string
IpRanges This property is required. []string
VcnId This property is required. string
ipRanges This property is required. List<String>
vcnId This property is required. String
ipRanges This property is required. string[]
vcnId This property is required. string
ip_ranges This property is required. Sequence[str]
vcn_id This property is required. str
ipRanges This property is required. List<String>
vcnId This property is required. String

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.
Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi