vSphere

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

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 argument for the search. The id and other attributes are then populated with the data found by the search.

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

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/v4/go/vsphere"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

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

Coming soon!

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",
}));

Coming soon!

Using getCustomAttribute

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 getCustomAttribute(args: GetCustomAttributeArgs, opts?: InvokeOptions): Promise<GetCustomAttributeResult>
function getCustomAttributeOutput(args: GetCustomAttributeOutputArgs, opts?: InvokeOptions): Output<GetCustomAttributeResult>
def get_custom_attribute(name: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetCustomAttributeResult
def get_custom_attribute_output(name: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetCustomAttributeResult]
func LookupCustomAttribute(ctx *Context, args *LookupCustomAttributeArgs, opts ...InvokeOption) (*LookupCustomAttributeResult, error)
func LookupCustomAttributeOutput(ctx *Context, args *LookupCustomAttributeOutputArgs, opts ...InvokeOption) LookupCustomAttributeResultOutput

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

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

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 string

The name of the custom attribute.

name str

The name of the custom attribute.

name String

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 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
id String

The provider-assigned unique ID for this managed resource.

managedObjectType String
name 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.