Class Tag
The vsphere..Tag resource can be used to create and manage tags, which allow
you to attach metadata to objects in the vSphere inventory to make these
objects more sortable and searchable.
For more information about tags, click here.
NOTE: Tagging support is unsupported on direct ESXi connections and requires vCenter 6.0 or higher.
Example Usage
using Pulumi;
using VSphere = Pulumi.VSphere;
class MyStack : Stack
{
public MyStack()
{
var category = new VSphere.TagCategory("category", new VSphere.TagCategoryArgs
{
AssociableTypes =
{
"VirtualMachine",
"Datastore",
},
Cardinality = "SINGLE",
Description = "Managed by Pulumi",
});
var tag = new VSphere.Tag("tag", new VSphere.TagArgs
{
CategoryId = category.Id,
Description = "Managed by Pulumi",
});
}
}
Inherited Members
Namespace: Pulumi.VSphere
Assembly: Pulumi.VSphere.dll
Syntax
public class Tag : CustomResource
Constructors
View SourceTag(String, TagArgs, CustomResourceOptions)
Create a Tag resource with the given unique name, arguments, and options.
Declaration
public Tag(string name, TagArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| TagArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceCategoryId
The unique identifier of the parent category in which this tag will be created. Forces a new resource if changed.
Declaration
public Output<string> CategoryId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
A description for the tag.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
The display name of the tag. The name must be unique within its category.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, TagState, CustomResourceOptions)
Get an existing Tag resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Tag Get(string name, Input<string> id, TagState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| TagState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Tag |