vSphere

v4.3.0 published on Monday, Jun 27, 2022 by Pulumi

getDynamic

The vsphere.getDynamic data source can be used to get the managed object reference ID of any tagged managed object in vCenter Server by providing a list of tag IDs and an optional regular expression to filter objects by name.

Example Usage

using Pulumi;
using VSphere = Pulumi.VSphere;

class MyStack : Stack
{
    public MyStack()
    {
        var category = Output.Create(VSphere.GetTagCategory.InvokeAsync(new VSphere.GetTagCategoryArgs
        {
            Name = "SomeCategory",
        }));
        var tag1 = Output.Create(VSphere.GetTag.InvokeAsync(new VSphere.GetTagArgs
        {
            Name = "FirstTag",
            CategoryId = data.Vsphere_tag_category.Cat.Id,
        }));
        var tag2 = Output.Create(VSphere.GetTag.InvokeAsync(new VSphere.GetTagArgs
        {
            Name = "SecondTag",
            CategoryId = data.Vsphere_tag_category.Cat.Id,
        }));
        var dyn = Output.Tuple(tag1, tag1).Apply(values =>
        {
            var tag1 = values.Item1;
            var tag11 = values.Item2;
            return Output.Create(VSphere.GetDynamic.InvokeAsync(new VSphere.GetDynamicArgs
            {
                Filters = 
                {
                    tag1.Id,
                    tag11.Id,
                },
                NameRegex = "ubuntu",
                Type = "Datacenter",
            }));
        });
    }

}

Coming soon!

Coming soon!

import pulumi
import pulumi_vsphere as vsphere

category = vsphere.get_tag_category(name="SomeCategory")
tag1 = vsphere.get_tag(name="FirstTag",
    category_id=data["vsphere_tag_category"]["cat"]["id"])
tag2 = vsphere.get_tag(name="SecondTag",
    category_id=data["vsphere_tag_category"]["cat"]["id"])
dyn = vsphere.get_dynamic(filters=[
        tag1.id,
        tag1.id,
    ],
    name_regex="ubuntu",
    type="Datacenter")
import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const category = vsphere.getTagCategory({
    name: "SomeCategory",
});
const tag1 = vsphere.getTag({
    name: "FirstTag",
    categoryId: data.vsphere_tag_category.cat.id,
});
const tag2 = vsphere.getTag({
    name: "SecondTag",
    categoryId: data.vsphere_tag_category.cat.id,
});
const dyn = Promise.all([tag1, tag1]).then(([tag1, tag11]) => vsphere.getDynamic({
    filters: [
        tag1.id,
        tag11.id,
    ],
    nameRegex: "ubuntu",
    type: "Datacenter",
}));

Coming soon!

Using getDynamic

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 getDynamic(args: GetDynamicArgs, opts?: InvokeOptions): Promise<GetDynamicResult>
function getDynamicOutput(args: GetDynamicOutputArgs, opts?: InvokeOptions): Output<GetDynamicResult>
def get_dynamic(filters: Optional[Sequence[str]] = None,
                name_regex: Optional[str] = None,
                type: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetDynamicResult
def get_dynamic_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                name_regex: Optional[pulumi.Input[str]] = None,
                type: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetDynamicResult]
func GetDynamic(ctx *Context, args *GetDynamicArgs, opts ...InvokeOption) (*GetDynamicResult, error)
func GetDynamicOutput(ctx *Context, args *GetDynamicOutputArgs, opts ...InvokeOption) GetDynamicResultOutput

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

public static class GetDynamic 
{
    public static Task<GetDynamicResult> InvokeAsync(GetDynamicArgs args, InvokeOptions? opts = null)
    public static Output<GetDynamicResult> Invoke(GetDynamicInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDynamicResult> getDynamic(GetDynamicArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: vsphere:index/getDynamic:getDynamic
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Filters List<string>

A list of tag IDs that must be present on an object to be a match.

NameRegex string

A regular expression that will be used to match the object's name.

Type string

The managed object type the returned object must match. The managed object types can be found in the managed object type section here.

Filters []string

A list of tag IDs that must be present on an object to be a match.

NameRegex string

A regular expression that will be used to match the object's name.

Type string

The managed object type the returned object must match. The managed object types can be found in the managed object type section here.

filters List<String>

A list of tag IDs that must be present on an object to be a match.

nameRegex String

A regular expression that will be used to match the object's name.

type String

The managed object type the returned object must match. The managed object types can be found in the managed object type section here.

filters string[]

A list of tag IDs that must be present on an object to be a match.

nameRegex string

A regular expression that will be used to match the object's name.

type string

The managed object type the returned object must match. The managed object types can be found in the managed object type section here.

filters Sequence[str]

A list of tag IDs that must be present on an object to be a match.

name_regex str

A regular expression that will be used to match the object's name.

type str

The managed object type the returned object must match. The managed object types can be found in the managed object type section here.

filters List<String>

A list of tag IDs that must be present on an object to be a match.

nameRegex String

A regular expression that will be used to match the object's name.

type String

The managed object type the returned object must match. The managed object types can be found in the managed object type section here.

getDynamic Result

The following output properties are available:

Filters List<string>
Id string

The provider-assigned unique ID for this managed resource.

NameRegex string
Type string
Filters []string
Id string

The provider-assigned unique ID for this managed resource.

NameRegex string
Type string
filters List<String>
id String

The provider-assigned unique ID for this managed resource.

nameRegex String
type String
filters string[]
id string

The provider-assigned unique ID for this managed resource.

nameRegex string
type string
filters Sequence[str]
id str

The provider-assigned unique ID for this managed resource.

name_regex str
type str
filters List<String>
id String

The provider-assigned unique ID for this managed resource.

nameRegex String
type String

Package Details

Repository
https://github.com/pulumi/pulumi-vsphere
License
Apache-2.0
Notes

This Pulumi package is based on the vsphere Terraform Provider.