Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

getCustomAttribute

The vsphere.CustomAttribute data source can be used to reference custom attributes that are not managed by this provider. Its attributes are exactly the same as the vsphere.CustomAttribute resource, and, like importing, the data source takes a name to search on. The id and other attributes are then populated with the data found by the search.

NOTE: Custom attributes are unsupported on direct ESXi connections and require vCenter.

Example Usage

using Pulumi;
using VSphere = Pulumi.VSphere;

class MyStack : Stack
{
    public MyStack()
    {
        var attribute = Output.Create(VSphere.GetCustomAttribute.InvokeAsync(new VSphere.GetCustomAttributeArgs
        {
            Name = "test-attribute",
        }));
    }

}
package main

import (
    "github.com/pulumi/pulumi-vsphere/sdk/v2/go/vsphere"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := vsphere.LookupCustomAttribute(ctx, &vsphere.LookupCustomAttributeArgs{
            Name: "test-attribute",
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_vsphere as vsphere

attribute = vsphere.get_custom_attribute(name="test-attribute")
import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const attribute = pulumi.output(vsphere.getCustomAttribute({
    name: "test-attribute",
}, { async: true }));

Using getCustomAttribute

function getCustomAttribute(args: GetCustomAttributeArgs, opts?: InvokeOptions): Promise<GetCustomAttributeResult>
def get_custom_attribute(name: Optional[str] = None, opts: Optional[InvokeOptions] = None) -> GetCustomAttributeResult
func LookupCustomAttribute(ctx *Context, args *LookupCustomAttributeArgs, opts ...InvokeOption) (*LookupCustomAttributeResult, error)

Note: This function is named LookupCustomAttribute in the Go SDK.

public static class GetCustomAttribute {
    public static Task<GetCustomAttributeResult> InvokeAsync(GetCustomAttributeArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Name string

The name of the custom attribute.

Name string

The name of the custom attribute.

name string

The name of the custom attribute.

name str

The name of the custom attribute.

getCustomAttribute Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

ManagedObjectType string
Name string
Id string

The provider-assigned unique ID for this managed resource.

ManagedObjectType string
Name string
id string

The provider-assigned unique ID for this managed resource.

managedObjectType string
name string
id str

The provider-assigned unique ID for this managed resource.

managed_object_type str
name str

Package Details

Repository
https://github.com/pulumi/pulumi-vsphere
License
Apache-2.0
Notes
This Pulumi package is based on the vsphere Terraform Provider.