vra 0.12.0 published on Monday, Apr 14, 2025 by vmware
vra.getNetwork
Explore with Pulumi AI
—layout: “vra”
page_title: “VMware vRealize Automation: vra.Network” description: |- Provides a data lookup for vra_network.
Data Source: vra.Network
Example Usage
S
This is an example of how to read a network data source.
Network data source by id:
import * as pulumi from "@pulumi/pulumi";
import * as vra from "@pulumi/vra";
const test_network = vra.getNetwork({
    id: _var.network_id,
});
import pulumi
import pulumi_vra as vra
test_network = vra.get_network(id=var["network_id"])
package main
import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vra/vra"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vra.LookupNetwork(ctx, &vra.LookupNetworkArgs{
			Id: pulumi.StringRef(_var.Network_id),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vra = Pulumi.Vra;
return await Deployment.RunAsync(() => 
{
    var test_network = Vra.GetNetwork.Invoke(new()
    {
        Id = @var.Network_id,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vra.VraFunctions;
import com.pulumi.vra.inputs.GetNetworkArgs;
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 test-network = VraFunctions.getNetwork(GetNetworkArgs.builder()
            .id(var_.network_id())
            .build());
    }
}
variables:
  test-network:
    fn::invoke:
      function: vra:getNetwork
      arguments:
        id: ${var.network_id}
Network data source by name:
import * as pulumi from "@pulumi/pulumi";
import * as vra from "@pulumi/vra";
const test_network = vra.getNetwork({
    name: _var.network_name,
});
import pulumi
import pulumi_vra as vra
test_network = vra.get_network(name=var["network_name"])
package main
import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vra/vra"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vra.LookupNetwork(ctx, &vra.LookupNetworkArgs{
			Name: pulumi.StringRef(_var.Network_name),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vra = Pulumi.Vra;
return await Deployment.RunAsync(() => 
{
    var test_network = Vra.GetNetwork.Invoke(new()
    {
        Name = @var.Network_name,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vra.VraFunctions;
import com.pulumi.vra.inputs.GetNetworkArgs;
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 test-network = VraFunctions.getNetwork(GetNetworkArgs.builder()
            .name(var_.network_name())
            .build());
    }
}
variables:
  test-network:
    fn::invoke:
      function: vra:getNetwork
      arguments:
        name: ${var.network_name}
Network data source by filter:
import * as pulumi from "@pulumi/pulumi";
import * as vra from "@pulumi/vra";
const test_network = vra.getNetwork({
    filter: `name eq '${_var.network_name}'`,
});
import pulumi
import pulumi_vra as vra
test_network = vra.get_network(filter=f"name eq '{var['network_name']}'")
package main
import (
	"fmt"
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vra/vra"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vra.LookupNetwork(ctx, &vra.LookupNetworkArgs{
			Filter: pulumi.StringRef(fmt.Sprintf("name eq '%v'", _var.Network_name)),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vra = Pulumi.Vra;
return await Deployment.RunAsync(() => 
{
    var test_network = Vra.GetNetwork.Invoke(new()
    {
        Filter = $"name eq '{@var.Network_name}'",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vra.VraFunctions;
import com.pulumi.vra.inputs.GetNetworkArgs;
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 test-network = VraFunctions.getNetwork(GetNetworkArgs.builder()
            .filter(String.format("name eq '%s'", var_.network_name()))
            .build());
    }
}
variables:
  test-network:
    fn::invoke:
      function: vra:getNetwork
      arguments:
        filter: name eq '${var.network_name}'
Using getNetwork
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 getNetwork(args: GetNetworkArgs, opts?: InvokeOptions): Promise<GetNetworkResult>
function getNetworkOutput(args: GetNetworkOutputArgs, opts?: InvokeOptions): Output<GetNetworkResult>def get_network(filter: Optional[str] = None,
                id: Optional[str] = None,
                name: Optional[str] = None,
                tags: Optional[Sequence[GetNetworkTag]] = None,
                opts: Optional[InvokeOptions] = None) -> GetNetworkResult
def get_network_output(filter: Optional[pulumi.Input[str]] = None,
                id: Optional[pulumi.Input[str]] = None,
                name: Optional[pulumi.Input[str]] = None,
                tags: Optional[pulumi.Input[Sequence[pulumi.Input[GetNetworkTagArgs]]]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetNetworkResult]func LookupNetwork(ctx *Context, args *LookupNetworkArgs, opts ...InvokeOption) (*LookupNetworkResult, error)
func LookupNetworkOutput(ctx *Context, args *LookupNetworkOutputArgs, opts ...InvokeOption) LookupNetworkResultOutput> Note: This function is named LookupNetwork in the Go SDK.
public static class GetNetwork 
{
    public static Task<GetNetworkResult> InvokeAsync(GetNetworkArgs args, InvokeOptions? opts = null)
    public static Output<GetNetworkResult> Invoke(GetNetworkInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetNetworkResult> getNetwork(GetNetworkArgs args, InvokeOptions options)
public static Output<GetNetworkResult> getNetwork(GetNetworkArgs args, InvokeOptions options)
fn::invoke:
  function: vra:index/getNetwork:getNetwork
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Filter string
 - The search criteria to narrow down the network instance. Only one of 'id', 'name' or 'filter' must be specified.
 - Id string
 - The id of the network instance. Only one of 'id', 'name' or 'filter' must be specified.
 - Name string
 - The human-friendly name of the network instance. Only one of 'id', 'name' or 'filter' must be specified.
 - 
List<Get
Network Tag>  - A set of tag keys and optional values that were set on this resource.
example: 
[ { "key" : "ownedBy", "value": "Rainpole" } ] 
- Filter string
 - The search criteria to narrow down the network instance. Only one of 'id', 'name' or 'filter' must be specified.
 - Id string
 - The id of the network instance. Only one of 'id', 'name' or 'filter' must be specified.
 - Name string
 - The human-friendly name of the network instance. Only one of 'id', 'name' or 'filter' must be specified.
 - 
[]Get
Network Tag  - A set of tag keys and optional values that were set on this resource.
example: 
[ { "key" : "ownedBy", "value": "Rainpole" } ] 
- filter String
 - The search criteria to narrow down the network instance. Only one of 'id', 'name' or 'filter' must be specified.
 - id String
 - The id of the network instance. Only one of 'id', 'name' or 'filter' must be specified.
 - name String
 - The human-friendly name of the network instance. Only one of 'id', 'name' or 'filter' must be specified.
 - 
List<Get
Network Tag>  - A set of tag keys and optional values that were set on this resource.
example: 
[ { "key" : "ownedBy", "value": "Rainpole" } ] 
- filter string
 - The search criteria to narrow down the network instance. Only one of 'id', 'name' or 'filter' must be specified.
 - id string
 - The id of the network instance. Only one of 'id', 'name' or 'filter' must be specified.
 - name string
 - The human-friendly name of the network instance. Only one of 'id', 'name' or 'filter' must be specified.
 - 
Get
Network Tag[]  - A set of tag keys and optional values that were set on this resource.
example: 
[ { "key" : "ownedBy", "value": "Rainpole" } ] 
- filter str
 - The search criteria to narrow down the network instance. Only one of 'id', 'name' or 'filter' must be specified.
 - id str
 - The id of the network instance. Only one of 'id', 'name' or 'filter' must be specified.
 - name str
 - The human-friendly name of the network instance. Only one of 'id', 'name' or 'filter' must be specified.
 - 
Sequence[Get
Network Tag]  - A set of tag keys and optional values that were set on this resource.
example: 
[ { "key" : "ownedBy", "value": "Rainpole" } ] 
- filter String
 - The search criteria to narrow down the network instance. Only one of 'id', 'name' or 'filter' must be specified.
 - id String
 - The id of the network instance. Only one of 'id', 'name' or 'filter' must be specified.
 - name String
 - The human-friendly name of the network instance. Only one of 'id', 'name' or 'filter' must be specified.
 - List<Property Map>
 - A set of tag keys and optional values that were set on this resource.
example: 
[ { "key" : "ownedBy", "value": "Rainpole" } ] 
getNetwork Result
The following output properties are available:
- Cidr string
 - IPv4 address range of the network in CIDR format.
 - Cloud
Account List<string>Ids  - Set of ids of the cloud accounts this resource belongs to.
 - Custom
Properties Dictionary<string, string> - Additional properties that may be used to extend the base resource.
 - Deployment
Id string - Deployment id that is associated with this resource.
 - Description string
 - A human-friendly description.
 - External
Id string - External entity Id on the provider side.
 - External
Region stringId  - The external regionId of the resource.
 - External
Zone stringId  - The external zoneId of the resource.
 - Id string
 - Links
List<Get
Network Link>  - HATEOAS of the entity
 - Name string
 - Organization
Id string - The id of the organization this entity belongs to.
 - Owner string
 - Email of the user or display name of the group that owns the entity.
 - Project
Id string - The id of the project this resource belongs to.
 - Updated
At string - Filter string
 - 
List<Get
Network Tag>  - A set of tag keys and optional values that were set on this resource.
example: 
[ { "key" : "ownedBy", "value": "Rainpole" } ] 
- Cidr string
 - IPv4 address range of the network in CIDR format.
 - Cloud
Account []stringIds  - Set of ids of the cloud accounts this resource belongs to.
 - Custom
Properties map[string]string - Additional properties that may be used to extend the base resource.
 - Deployment
Id string - Deployment id that is associated with this resource.
 - Description string
 - A human-friendly description.
 - External
Id string - External entity Id on the provider side.
 - External
Region stringId  - The external regionId of the resource.
 - External
Zone stringId  - The external zoneId of the resource.
 - Id string
 - Links
[]Get
Network Link  - HATEOAS of the entity
 - Name string
 - Organization
Id string - The id of the organization this entity belongs to.
 - Owner string
 - Email of the user or display name of the group that owns the entity.
 - Project
Id string - The id of the project this resource belongs to.
 - Updated
At string - Filter string
 - 
[]Get
Network Tag  - A set of tag keys and optional values that were set on this resource.
example: 
[ { "key" : "ownedBy", "value": "Rainpole" } ] 
- cidr String
 - IPv4 address range of the network in CIDR format.
 - cloud
Account List<String>Ids  - Set of ids of the cloud accounts this resource belongs to.
 - custom
Properties Map<String,String> - Additional properties that may be used to extend the base resource.
 - deployment
Id String - Deployment id that is associated with this resource.
 - description String
 - A human-friendly description.
 - external
Id String - External entity Id on the provider side.
 - external
Region StringId  - The external regionId of the resource.
 - external
Zone StringId  - The external zoneId of the resource.
 - id String
 - links
List<Get
Network Link>  - HATEOAS of the entity
 - name String
 - organization
Id String - The id of the organization this entity belongs to.
 - owner String
 - Email of the user or display name of the group that owns the entity.
 - project
Id String - The id of the project this resource belongs to.
 - updated
At String - filter String
 - 
List<Get
Network Tag>  - A set of tag keys and optional values that were set on this resource.
example: 
[ { "key" : "ownedBy", "value": "Rainpole" } ] 
- cidr string
 - IPv4 address range of the network in CIDR format.
 - cloud
Account string[]Ids  - Set of ids of the cloud accounts this resource belongs to.
 - custom
Properties {[key: string]: string} - Additional properties that may be used to extend the base resource.
 - deployment
Id string - Deployment id that is associated with this resource.
 - description string
 - A human-friendly description.
 - external
Id string - External entity Id on the provider side.
 - external
Region stringId  - The external regionId of the resource.
 - external
Zone stringId  - The external zoneId of the resource.
 - id string
 - links
Get
Network Link[]  - HATEOAS of the entity
 - name string
 - organization
Id string - The id of the organization this entity belongs to.
 - owner string
 - Email of the user or display name of the group that owns the entity.
 - project
Id string - The id of the project this resource belongs to.
 - updated
At string - filter string
 - 
Get
Network Tag[]  - A set of tag keys and optional values that were set on this resource.
example: 
[ { "key" : "ownedBy", "value": "Rainpole" } ] 
- cidr str
 - IPv4 address range of the network in CIDR format.
 - cloud_
account_ Sequence[str]ids  - Set of ids of the cloud accounts this resource belongs to.
 - custom_
properties Mapping[str, str] - Additional properties that may be used to extend the base resource.
 - deployment_
id str - Deployment id that is associated with this resource.
 - description str
 - A human-friendly description.
 - external_
id str - External entity Id on the provider side.
 - external_
region_ strid  - The external regionId of the resource.
 - external_
zone_ strid  - The external zoneId of the resource.
 - id str
 - links
Sequence[Get
Network Link]  - HATEOAS of the entity
 - name str
 - organization_
id str - The id of the organization this entity belongs to.
 - owner str
 - Email of the user or display name of the group that owns the entity.
 - project_
id str - The id of the project this resource belongs to.
 - updated_
at str - filter str
 - 
Sequence[Get
Network Tag]  - A set of tag keys and optional values that were set on this resource.
example: 
[ { "key" : "ownedBy", "value": "Rainpole" } ] 
- cidr String
 - IPv4 address range of the network in CIDR format.
 - cloud
Account List<String>Ids  - Set of ids of the cloud accounts this resource belongs to.
 - custom
Properties Map<String> - Additional properties that may be used to extend the base resource.
 - deployment
Id String - Deployment id that is associated with this resource.
 - description String
 - A human-friendly description.
 - external
Id String - External entity Id on the provider side.
 - external
Region StringId  - The external regionId of the resource.
 - external
Zone StringId  - The external zoneId of the resource.
 - id String
 - links List<Property Map>
 - HATEOAS of the entity
 - name String
 - organization
Id String - The id of the organization this entity belongs to.
 - owner String
 - Email of the user or display name of the group that owns the entity.
 - project
Id String - The id of the project this resource belongs to.
 - updated
At String - filter String
 - List<Property Map>
 - A set of tag keys and optional values that were set on this resource.
example: 
[ { "key" : "ownedBy", "value": "Rainpole" } ] 
Supporting Types
GetNetworkLink  
GetNetworkTag  
Package Details
- Repository
 - vra vmware/terraform-provider-vra
 - License
 - Notes
 - This Pulumi package is based on the 
vraTerraform Provider.