Class Folder
The vsphere..Folder resource can be used to manage vSphere inventory folders.
The resource supports creating folders of the 5 major types - datacenter
folders, host and cluster folders, virtual machine folders, datastore folders,
and network folders.
Paths are always relative to the specific type of folder you are creating.
Subfolders are discovered by parsing the relative path specified in path, so
foo/bar will create a folder named bar in the parent folder foo, as long
as that folder exists.
Example Usage
using Pulumi;
using VSphere = Pulumi.VSphere;
class MyStack : Stack
{
public MyStack()
{
var dc = Output.Create(VSphere.GetDatacenter.InvokeAsync());
var folder = new VSphere.Folder("folder", new VSphere.FolderArgs
{
DatacenterId = dc.Apply(dc => dc.Id),
Path = "test-folder",
Type = "vm",
});
}
}
Example with subfolders
using Pulumi;
using VSphere = Pulumi.VSphere;
class MyStack : Stack
{
public MyStack()
{
var dc = Output.Create(VSphere.GetDatacenter.InvokeAsync());
var parent = new VSphere.Folder("parent", new VSphere.FolderArgs
{
DatacenterId = dc.Apply(dc => dc.Id),
Path = "test-parent",
Type = "vm",
});
var folder = new VSphere.Folder("folder", new VSphere.FolderArgs
{
DatacenterId = dc.Apply(dc => dc.Id),
Path = parent.Path.Apply(path => $"{path}/test-folder"),
Type = "vm",
});
}
}
Inherited Members
Namespace: Pulumi.VSphere
Assembly: Pulumi.VSphere.dll
Syntax
public class Folder : CustomResource
Constructors
View SourceFolder(String, FolderArgs, CustomResourceOptions)
Create a Folder resource with the given unique name, arguments, and options.
Declaration
public Folder(string name, FolderArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| FolderArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceCustomAttributes
Map of custom attribute ids to attribute value strings to set for folder. See [here][docs-setting-custom-attributes] for a reference on how to set values for custom attributes.
Declaration
public Output<ImmutableDictionary<string, string>> CustomAttributes { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>> |
DatacenterId
The ID of the datacenter the folder will be created in. Required for all folder types except for datacenter folders. Forces a new resource if changed.
Declaration
public Output<string> DatacenterId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Path
The path of the folder to be created. This is relative to
the root of the type of folder you are creating, and the supplied datacenter.
For example, given a default datacenter of default-dc, a folder of type
vm (denoting a virtual machine folder), and a supplied folder of
test-folder, the resulting path would be
/default-dc/vm/test-folder.
Declaration
public Output<string> Path { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Tags
The IDs of any tags to attach to this resource.
Declaration
public Output<ImmutableArray<string>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Type
The type of folder to create. Allowed options are
datacenter for datacenter folders, host for host and cluster folders,
vm for virtual machine folders, datastore for datastore folders, and
network for network folders. Forces a new resource if changed.
Declaration
public Output<string> Type { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, FolderState, CustomResourceOptions)
Get an existing Folder resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Folder Get(string name, Input<string> id, FolderState 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. |
| FolderState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Folder |