1. Packages
  2. Vra Provider
  3. API Docs
  4. getRegion
vra 0.12.0 published on Monday, Apr 14, 2025 by vmware

vra.getRegion

Explore with Pulumi AI

vra 0.12.0 published on Monday, Apr 14, 2025 by vmware

This is an example of how to lookup a region data source:

Region data source by id:

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

const _this = vra.getRegion({
    id: _var.vra_region_id,
});
Copy
import pulumi
import pulumi_vra as vra

this = vra.get_region(id=var["vra_region_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.GetRegion(ctx, &vra.GetRegionArgs{
			Id: pulumi.StringRef(_var.Vra_region_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 @this = Vra.GetRegion.Invoke(new()
    {
        Id = @var.Vra_region_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.GetRegionArgs;
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 this = VraFunctions.getRegion(GetRegionArgs.builder()
            .id(var_.vra_region_id())
            .build());

    }
}
Copy
variables:
  this:
    fn::invoke:
      function: vra:getRegion
      arguments:
        id: ${var.vra_region_id}
Copy

Region data source by filter:

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

const _this = vra.getRegion({
    filter: `name eq '${_var.vra_region_name}'`,
});
Copy
import pulumi
import pulumi_vra as vra

this = vra.get_region(filter=f"name eq '{var['vra_region_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.GetRegion(ctx, &vra.GetRegionArgs{
			Filter: pulumi.StringRef(fmt.Sprintf("name eq '%v'", _var.Vra_region_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 @this = Vra.GetRegion.Invoke(new()
    {
        Filter = $"name eq '{@var.Vra_region_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.GetRegionArgs;
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 this = VraFunctions.getRegion(GetRegionArgs.builder()
            .filter(String.format("name eq '%s'", var_.vra_region_name()))
            .build());

    }
}
Copy
variables:
  this:
    fn::invoke:
      function: vra:getRegion
      arguments:
        filter: name eq '${var.vra_region_name}'
Copy

Region data source by cloud account id and region:

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

const _this = vra.getRegion({
    cloudAccountId: _var.vra_cloud_account_id,
    region: _var.vra_region_external_id,
});
Copy
import pulumi
import pulumi_vra as vra

this = vra.get_region(cloud_account_id=var["vra_cloud_account_id"],
    region=var["vra_region_external_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.GetRegion(ctx, &vra.GetRegionArgs{
			CloudAccountId: pulumi.StringRef(_var.Vra_cloud_account_id),
			Region:         pulumi.StringRef(_var.Vra_region_external_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 @this = Vra.GetRegion.Invoke(new()
    {
        CloudAccountId = @var.Vra_cloud_account_id,
        Region = @var.Vra_region_external_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.GetRegionArgs;
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 this = VraFunctions.getRegion(GetRegionArgs.builder()
            .cloudAccountId(var_.vra_cloud_account_id())
            .region(var_.vra_region_external_id())
            .build());

    }
}
Copy
variables:
  this:
    fn::invoke:
      function: vra:getRegion
      arguments:
        cloudAccountId: ${var.vra_cloud_account_id}
        region: ${var.vra_region_external_id}
Copy

Using getRegion

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 getRegion(args: GetRegionArgs, opts?: InvokeOptions): Promise<GetRegionResult>
function getRegionOutput(args: GetRegionOutputArgs, opts?: InvokeOptions): Output<GetRegionResult>
Copy
def get_region(cloud_account_id: Optional[str] = None,
               filter: Optional[str] = None,
               id: Optional[str] = None,
               region: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetRegionResult
def get_region_output(cloud_account_id: Optional[pulumi.Input[str]] = None,
               filter: Optional[pulumi.Input[str]] = None,
               id: Optional[pulumi.Input[str]] = None,
               region: Optional[pulumi.Input[str]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetRegionResult]
Copy
func GetRegion(ctx *Context, args *GetRegionArgs, opts ...InvokeOption) (*GetRegionResult, error)
func GetRegionOutput(ctx *Context, args *GetRegionOutputArgs, opts ...InvokeOption) GetRegionResultOutput
Copy

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

public static class GetRegion 
{
    public static Task<GetRegionResult> InvokeAsync(GetRegionArgs args, InvokeOptions? opts = null)
    public static Output<GetRegionResult> Invoke(GetRegionInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetRegionResult> getRegion(GetRegionArgs args, InvokeOptions options)
public static Output<GetRegionResult> getRegion(GetRegionArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: vra:index/getRegion:getRegion
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

CloudAccountId string
The id of the cloud account the region belongs to.
Filter string
Search criteria to narrow down Regions.
Id string
The id of the region instance.
Region string

The specific region associated with the cloud account. On vSphere, this is the external ID.

Note: One of id, filter or cloud_account_id and region must be specified.

CloudAccountId string
The id of the cloud account the region belongs to.
Filter string
Search criteria to narrow down Regions.
Id string
The id of the region instance.
Region string

The specific region associated with the cloud account. On vSphere, this is the external ID.

Note: One of id, filter or cloud_account_id and region must be specified.

cloudAccountId String
The id of the cloud account the region belongs to.
filter String
Search criteria to narrow down Regions.
id String
The id of the region instance.
region String

The specific region associated with the cloud account. On vSphere, this is the external ID.

Note: One of id, filter or cloud_account_id and region must be specified.

cloudAccountId string
The id of the cloud account the region belongs to.
filter string
Search criteria to narrow down Regions.
id string
The id of the region instance.
region string

The specific region associated with the cloud account. On vSphere, this is the external ID.

Note: One of id, filter or cloud_account_id and region must be specified.

cloud_account_id str
The id of the cloud account the region belongs to.
filter str
Search criteria to narrow down Regions.
id str
The id of the region instance.
region str

The specific region associated with the cloud account. On vSphere, this is the external ID.

Note: One of id, filter or cloud_account_id and region must be specified.

cloudAccountId String
The id of the cloud account the region belongs to.
filter String
Search criteria to narrow down Regions.
id String
The id of the region instance.
region String

The specific region associated with the cloud account. On vSphere, this is the external ID.

Note: One of id, filter or cloud_account_id and region must be specified.

getRegion Result

The following output properties are available:

CloudAccountId string
CreatedAt string
Date when the entity was created. The date is in ISO 8601 and UTC.
ExternalRegionId string
Unique identifier of region on the provider side.
Id string
Name string
Name of region on the provider side. In vSphere, the name of the region is different from its id.
OrgId string
The id of the organization this entity belongs to.
Owner string
Email of the user that owns the entity.
UpdatedAt string
Date when the entity was last updated. The date is ISO 8601 and UTC.
Filter string
Region string
CloudAccountId string
CreatedAt string
Date when the entity was created. The date is in ISO 8601 and UTC.
ExternalRegionId string
Unique identifier of region on the provider side.
Id string
Name string
Name of region on the provider side. In vSphere, the name of the region is different from its id.
OrgId string
The id of the organization this entity belongs to.
Owner string
Email of the user that owns the entity.
UpdatedAt string
Date when the entity was last updated. The date is ISO 8601 and UTC.
Filter string
Region string
cloudAccountId String
createdAt String
Date when the entity was created. The date is in ISO 8601 and UTC.
externalRegionId String
Unique identifier of region on the provider side.
id String
name String
Name of region on the provider side. In vSphere, the name of the region is different from its id.
orgId String
The id of the organization this entity belongs to.
owner String
Email of the user that owns the entity.
updatedAt String
Date when the entity was last updated. The date is ISO 8601 and UTC.
filter String
region String
cloudAccountId string
createdAt string
Date when the entity was created. The date is in ISO 8601 and UTC.
externalRegionId string
Unique identifier of region on the provider side.
id string
name string
Name of region on the provider side. In vSphere, the name of the region is different from its id.
orgId string
The id of the organization this entity belongs to.
owner string
Email of the user that owns the entity.
updatedAt string
Date when the entity was last updated. The date is ISO 8601 and UTC.
filter string
region string
cloud_account_id str
created_at str
Date when the entity was created. The date is in ISO 8601 and UTC.
external_region_id str
Unique identifier of region on the provider side.
id str
name str
Name of region on the provider side. In vSphere, the name of the region is different from its id.
org_id str
The id of the organization this entity belongs to.
owner str
Email of the user that owns the entity.
updated_at str
Date when the entity was last updated. The date is ISO 8601 and UTC.
filter str
region str
cloudAccountId String
createdAt String
Date when the entity was created. The date is in ISO 8601 and UTC.
externalRegionId String
Unique identifier of region on the provider side.
id String
name String
Name of region on the provider side. In vSphere, the name of the region is different from its id.
orgId String
The id of the organization this entity belongs to.
owner String
Email of the user that owns the entity.
updatedAt String
Date when the entity was last updated. The date is ISO 8601 and UTC.
filter String
region String

Package Details

Repository
vra vmware/terraform-provider-vra
License
Notes
This Pulumi package is based on the vra Terraform Provider.
vra 0.12.0 published on Monday, Apr 14, 2025 by vmware