1. Packages
  2. Vra Provider
  3. API Docs
  4. getNetwork
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,
});
Copy
import pulumi
import pulumi_vra as vra

test_network = vra.get_network(id=var["network_id"])
Copy
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
	})
}
Copy
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,
    });

});
Copy
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());

    }
}
Copy
variables:
  test-network:
    fn::invoke:
      function: vra:getNetwork
      arguments:
        id: ${var.network_id}
Copy

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,
});
Copy
import pulumi
import pulumi_vra as vra

test_network = vra.get_network(name=var["network_name"])
Copy
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
	})
}
Copy
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,
    });

});
Copy
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());

    }
}
Copy
variables:
  test-network:
    fn::invoke:
      function: vra:getNetwork
      arguments:
        name: ${var.network_name}
Copy

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}'`,
});
Copy
import pulumi
import pulumi_vra as vra

test_network = vra.get_network(filter=f"name eq '{var['network_name']}'")
Copy
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
	})
}
Copy
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}'",
    });

});
Copy
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());

    }
}
Copy
variables:
  test-network:
    fn::invoke:
      function: vra:getNetwork
      arguments:
        filter: name eq '${var.network_name}'
Copy

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>
Copy
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]
Copy
func LookupNetwork(ctx *Context, args *LookupNetworkArgs, opts ...InvokeOption) (*LookupNetworkResult, error)
func LookupNetworkOutput(ctx *Context, args *LookupNetworkOutputArgs, opts ...InvokeOption) LookupNetworkResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetNetworkResult> getNetwork(GetNetworkArgs args, InvokeOptions options)
public static Output<GetNetworkResult> getNetwork(GetNetworkArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: vra:index/getNetwork:getNetwork
  arguments:
    # arguments dictionary
Copy

The 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.
Tags List<GetNetworkTag>
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.
Tags []GetNetworkTag
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.
tags List<GetNetworkTag>
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.
tags GetNetworkTag[]
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.
tags Sequence[GetNetworkTag]
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.
tags 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.
CloudAccountIds List<string>
Set of ids of the cloud accounts this resource belongs to.
CustomProperties Dictionary<string, string>
Additional properties that may be used to extend the base resource.
DeploymentId string
Deployment id that is associated with this resource.
Description string
A human-friendly description.
ExternalId string
External entity Id on the provider side.
ExternalRegionId string
The external regionId of the resource.
ExternalZoneId string
The external zoneId of the resource.
Id string
Links List<GetNetworkLink>
HATEOAS of the entity
Name string
OrganizationId 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.
ProjectId string
The id of the project this resource belongs to.
UpdatedAt string
Filter string
Tags List<GetNetworkTag>
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.
CloudAccountIds []string
Set of ids of the cloud accounts this resource belongs to.
CustomProperties map[string]string
Additional properties that may be used to extend the base resource.
DeploymentId string
Deployment id that is associated with this resource.
Description string
A human-friendly description.
ExternalId string
External entity Id on the provider side.
ExternalRegionId string
The external regionId of the resource.
ExternalZoneId string
The external zoneId of the resource.
Id string
Links []GetNetworkLink
HATEOAS of the entity
Name string
OrganizationId 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.
ProjectId string
The id of the project this resource belongs to.
UpdatedAt string
Filter string
Tags []GetNetworkTag
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.
cloudAccountIds List<String>
Set of ids of the cloud accounts this resource belongs to.
customProperties Map<String,String>
Additional properties that may be used to extend the base resource.
deploymentId String
Deployment id that is associated with this resource.
description String
A human-friendly description.
externalId String
External entity Id on the provider side.
externalRegionId String
The external regionId of the resource.
externalZoneId String
The external zoneId of the resource.
id String
links List<GetNetworkLink>
HATEOAS of the entity
name String
organizationId 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.
projectId String
The id of the project this resource belongs to.
updatedAt String
filter String
tags List<GetNetworkTag>
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.
cloudAccountIds string[]
Set of ids of the cloud accounts this resource belongs to.
customProperties {[key: string]: string}
Additional properties that may be used to extend the base resource.
deploymentId string
Deployment id that is associated with this resource.
description string
A human-friendly description.
externalId string
External entity Id on the provider side.
externalRegionId string
The external regionId of the resource.
externalZoneId string
The external zoneId of the resource.
id string
links GetNetworkLink[]
HATEOAS of the entity
name string
organizationId 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.
projectId string
The id of the project this resource belongs to.
updatedAt string
filter string
tags GetNetworkTag[]
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_ids Sequence[str]
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_id str
The external regionId of the resource.
external_zone_id str
The external zoneId of the resource.
id str
links Sequence[GetNetworkLink]
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
tags Sequence[GetNetworkTag]
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.
cloudAccountIds List<String>
Set of ids of the cloud accounts this resource belongs to.
customProperties Map<String>
Additional properties that may be used to extend the base resource.
deploymentId String
Deployment id that is associated with this resource.
description String
A human-friendly description.
externalId String
External entity Id on the provider side.
externalRegionId String
The external regionId of the resource.
externalZoneId String
The external zoneId of the resource.
id String
links List<Property Map>
HATEOAS of the entity
name String
organizationId 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.
projectId String
The id of the project this resource belongs to.
updatedAt String
filter String
tags List<Property Map>
A set of tag keys and optional values that were set on this resource. example: [ { "key" : "ownedBy", "value": "Rainpole" } ]

Supporting Types

Href This property is required. string
Hrefs This property is required. List<string>
Rel This property is required. string
Href This property is required. string
Hrefs This property is required. []string
Rel This property is required. string
href This property is required. String
hrefs This property is required. List<String>
rel This property is required. String
href This property is required. string
hrefs This property is required. string[]
rel This property is required. string
href This property is required. str
hrefs This property is required. Sequence[str]
rel This property is required. str
href This property is required. String
hrefs This property is required. List<String>
rel This property is required. String

GetNetworkTag

Key This property is required. string
Value This property is required. string
Key This property is required. string
Value This property is required. string
key This property is required. String
value This property is required. String
key This property is required. string
value This property is required. string
key This property is required. str
value This property is required. str
key This property is required. String
value This property is required. String

Package Details

Repository
vra vmware/terraform-provider-vra
License
Notes
This Pulumi package is based on the vra Terraform Provider.