vsphere.Folder
Explore with Pulumi AI
Create Folder Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Folder(name: string, args: FolderArgs, opts?: CustomResourceOptions);
@overload
def Folder(resource_name: str,
args: FolderArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Folder(resource_name: str,
opts: Optional[ResourceOptions] = None,
path: Optional[str] = None,
type: Optional[str] = None,
custom_attributes: Optional[Mapping[str, str]] = None,
datacenter_id: Optional[str] = None,
tags: Optional[Sequence[str]] = None)
func NewFolder(ctx *Context, name string, args FolderArgs, opts ...ResourceOption) (*Folder, error)
public Folder(string name, FolderArgs args, CustomResourceOptions? opts = null)
public Folder(String name, FolderArgs args)
public Folder(String name, FolderArgs args, CustomResourceOptions options)
type: vsphere:Folder
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args FolderArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args FolderArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args FolderArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FolderArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FolderArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var folderResource = new VSphere.Folder("folderResource", new()
{
Path = "string",
Type = "string",
CustomAttributes =
{
{ "string", "string" },
},
DatacenterId = "string",
Tags = new[]
{
"string",
},
});
example, err := vsphere.NewFolder(ctx, "folderResource", &vsphere.FolderArgs{
Path: pulumi.String("string"),
Type: pulumi.String("string"),
CustomAttributes: pulumi.StringMap{
"string": pulumi.String("string"),
},
DatacenterId: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
})
var folderResource = new Folder("folderResource", FolderArgs.builder()
.path("string")
.type("string")
.customAttributes(Map.of("string", "string"))
.datacenterId("string")
.tags("string")
.build());
folder_resource = vsphere.Folder("folderResource",
path="string",
type="string",
custom_attributes={
"string": "string",
},
datacenter_id="string",
tags=["string"])
const folderResource = new vsphere.Folder("folderResource", {
path: "string",
type: "string",
customAttributes: {
string: "string",
},
datacenterId: "string",
tags: ["string"],
});
type: vsphere:Folder
properties:
customAttributes:
string: string
datacenterId: string
path: string
tags:
- string
type: string
Folder Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Folder resource accepts the following input properties:
- Path string
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 typevm
(denoting a virtual machine folder), and a supplied folder oftest-folder
, the resulting path would be/default-dc/vm/test-folder
.NOTE:
path
can be modified - the resulting behavior is dependent on what section ofpath
you are modifying. If you are modifying the parent (so any part before the last/
), your folder will be moved to that new parent. If modifying the name (the part after the last/
), your folder will be renamed.- Type string
- 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, andnetwork
for network folders. Forces a new resource if changed. - Custom
Attributes Dictionary<string, string> Map of custom attribute ids to attribute value strings to set for folder. See here for a reference on how to set values for custom attributes.
NOTE: Custom attributes are unsupported on direct ESXi connections and require vCenter.
- Datacenter
Id string - 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.
- List<string>
The IDs of any tags to attach to this resource.
NOTE: Tagging support is unsupported on direct ESXi connections and requires vCenter 6.0 or higher.
- Path string
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 typevm
(denoting a virtual machine folder), and a supplied folder oftest-folder
, the resulting path would be/default-dc/vm/test-folder
.NOTE:
path
can be modified - the resulting behavior is dependent on what section ofpath
you are modifying. If you are modifying the parent (so any part before the last/
), your folder will be moved to that new parent. If modifying the name (the part after the last/
), your folder will be renamed.- Type string
- 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, andnetwork
for network folders. Forces a new resource if changed. - Custom
Attributes map[string]string Map of custom attribute ids to attribute value strings to set for folder. See here for a reference on how to set values for custom attributes.
NOTE: Custom attributes are unsupported on direct ESXi connections and require vCenter.
- Datacenter
Id string - 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.
- []string
The IDs of any tags to attach to this resource.
NOTE: Tagging support is unsupported on direct ESXi connections and requires vCenter 6.0 or higher.
- path String
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 typevm
(denoting a virtual machine folder), and a supplied folder oftest-folder
, the resulting path would be/default-dc/vm/test-folder
.NOTE:
path
can be modified - the resulting behavior is dependent on what section ofpath
you are modifying. If you are modifying the parent (so any part before the last/
), your folder will be moved to that new parent. If modifying the name (the part after the last/
), your folder will be renamed.- type String
- 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, andnetwork
for network folders. Forces a new resource if changed. - custom
Attributes Map<String,String> Map of custom attribute ids to attribute value strings to set for folder. See here for a reference on how to set values for custom attributes.
NOTE: Custom attributes are unsupported on direct ESXi connections and require vCenter.
- datacenter
Id String - 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.
- List<String>
The IDs of any tags to attach to this resource.
NOTE: Tagging support is unsupported on direct ESXi connections and requires vCenter 6.0 or higher.
- path string
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 typevm
(denoting a virtual machine folder), and a supplied folder oftest-folder
, the resulting path would be/default-dc/vm/test-folder
.NOTE:
path
can be modified - the resulting behavior is dependent on what section ofpath
you are modifying. If you are modifying the parent (so any part before the last/
), your folder will be moved to that new parent. If modifying the name (the part after the last/
), your folder will be renamed.- type string
- 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, andnetwork
for network folders. Forces a new resource if changed. - custom
Attributes {[key: string]: string} Map of custom attribute ids to attribute value strings to set for folder. See here for a reference on how to set values for custom attributes.
NOTE: Custom attributes are unsupported on direct ESXi connections and require vCenter.
- datacenter
Id string - 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.
- string[]
The IDs of any tags to attach to this resource.
NOTE: Tagging support is unsupported on direct ESXi connections and requires vCenter 6.0 or higher.
- path str
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 typevm
(denoting a virtual machine folder), and a supplied folder oftest-folder
, the resulting path would be/default-dc/vm/test-folder
.NOTE:
path
can be modified - the resulting behavior is dependent on what section ofpath
you are modifying. If you are modifying the parent (so any part before the last/
), your folder will be moved to that new parent. If modifying the name (the part after the last/
), your folder will be renamed.- type str
- 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, andnetwork
for network folders. Forces a new resource if changed. - custom_
attributes Mapping[str, str] Map of custom attribute ids to attribute value strings to set for folder. See here for a reference on how to set values for custom attributes.
NOTE: Custom attributes are unsupported on direct ESXi connections and require vCenter.
- datacenter_
id str - 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.
- Sequence[str]
The IDs of any tags to attach to this resource.
NOTE: Tagging support is unsupported on direct ESXi connections and requires vCenter 6.0 or higher.
- path String
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 typevm
(denoting a virtual machine folder), and a supplied folder oftest-folder
, the resulting path would be/default-dc/vm/test-folder
.NOTE:
path
can be modified - the resulting behavior is dependent on what section ofpath
you are modifying. If you are modifying the parent (so any part before the last/
), your folder will be moved to that new parent. If modifying the name (the part after the last/
), your folder will be renamed.- type String
- 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, andnetwork
for network folders. Forces a new resource if changed. - custom
Attributes Map<String> Map of custom attribute ids to attribute value strings to set for folder. See here for a reference on how to set values for custom attributes.
NOTE: Custom attributes are unsupported on direct ESXi connections and require vCenter.
- datacenter
Id String - 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.
- List<String>
The IDs of any tags to attach to this resource.
NOTE: Tagging support is unsupported on direct ESXi connections and requires vCenter 6.0 or higher.
Outputs
All input properties are implicitly available as output properties. Additionally, the Folder resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Folder Resource
Get an existing Folder resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: FolderState, opts?: CustomResourceOptions): Folder
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
custom_attributes: Optional[Mapping[str, str]] = None,
datacenter_id: Optional[str] = None,
path: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
type: Optional[str] = None) -> Folder
func GetFolder(ctx *Context, name string, id IDInput, state *FolderState, opts ...ResourceOption) (*Folder, error)
public static Folder Get(string name, Input<string> id, FolderState? state, CustomResourceOptions? opts = null)
public static Folder get(String name, Output<String> id, FolderState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Custom
Attributes Dictionary<string, string> Map of custom attribute ids to attribute value strings to set for folder. See here for a reference on how to set values for custom attributes.
NOTE: Custom attributes are unsupported on direct ESXi connections and require vCenter.
- Datacenter
Id string - 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.
- Path string
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 typevm
(denoting a virtual machine folder), and a supplied folder oftest-folder
, the resulting path would be/default-dc/vm/test-folder
.NOTE:
path
can be modified - the resulting behavior is dependent on what section ofpath
you are modifying. If you are modifying the parent (so any part before the last/
), your folder will be moved to that new parent. If modifying the name (the part after the last/
), your folder will be renamed.- List<string>
The IDs of any tags to attach to this resource.
NOTE: Tagging support is unsupported on direct ESXi connections and requires vCenter 6.0 or higher.
- Type string
- 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, andnetwork
for network folders. Forces a new resource if changed.
- Custom
Attributes map[string]string Map of custom attribute ids to attribute value strings to set for folder. See here for a reference on how to set values for custom attributes.
NOTE: Custom attributes are unsupported on direct ESXi connections and require vCenter.
- Datacenter
Id string - 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.
- Path string
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 typevm
(denoting a virtual machine folder), and a supplied folder oftest-folder
, the resulting path would be/default-dc/vm/test-folder
.NOTE:
path
can be modified - the resulting behavior is dependent on what section ofpath
you are modifying. If you are modifying the parent (so any part before the last/
), your folder will be moved to that new parent. If modifying the name (the part after the last/
), your folder will be renamed.- []string
The IDs of any tags to attach to this resource.
NOTE: Tagging support is unsupported on direct ESXi connections and requires vCenter 6.0 or higher.
- Type string
- 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, andnetwork
for network folders. Forces a new resource if changed.
- custom
Attributes Map<String,String> Map of custom attribute ids to attribute value strings to set for folder. See here for a reference on how to set values for custom attributes.
NOTE: Custom attributes are unsupported on direct ESXi connections and require vCenter.
- datacenter
Id String - 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.
- path String
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 typevm
(denoting a virtual machine folder), and a supplied folder oftest-folder
, the resulting path would be/default-dc/vm/test-folder
.NOTE:
path
can be modified - the resulting behavior is dependent on what section ofpath
you are modifying. If you are modifying the parent (so any part before the last/
), your folder will be moved to that new parent. If modifying the name (the part after the last/
), your folder will be renamed.- List<String>
The IDs of any tags to attach to this resource.
NOTE: Tagging support is unsupported on direct ESXi connections and requires vCenter 6.0 or higher.
- type String
- 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, andnetwork
for network folders. Forces a new resource if changed.
- custom
Attributes {[key: string]: string} Map of custom attribute ids to attribute value strings to set for folder. See here for a reference on how to set values for custom attributes.
NOTE: Custom attributes are unsupported on direct ESXi connections and require vCenter.
- datacenter
Id string - 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.
- path string
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 typevm
(denoting a virtual machine folder), and a supplied folder oftest-folder
, the resulting path would be/default-dc/vm/test-folder
.NOTE:
path
can be modified - the resulting behavior is dependent on what section ofpath
you are modifying. If you are modifying the parent (so any part before the last/
), your folder will be moved to that new parent. If modifying the name (the part after the last/
), your folder will be renamed.- string[]
The IDs of any tags to attach to this resource.
NOTE: Tagging support is unsupported on direct ESXi connections and requires vCenter 6.0 or higher.
- type string
- 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, andnetwork
for network folders. Forces a new resource if changed.
- custom_
attributes Mapping[str, str] Map of custom attribute ids to attribute value strings to set for folder. See here for a reference on how to set values for custom attributes.
NOTE: Custom attributes are unsupported on direct ESXi connections and require vCenter.
- datacenter_
id str - 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.
- path str
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 typevm
(denoting a virtual machine folder), and a supplied folder oftest-folder
, the resulting path would be/default-dc/vm/test-folder
.NOTE:
path
can be modified - the resulting behavior is dependent on what section ofpath
you are modifying. If you are modifying the parent (so any part before the last/
), your folder will be moved to that new parent. If modifying the name (the part after the last/
), your folder will be renamed.- Sequence[str]
The IDs of any tags to attach to this resource.
NOTE: Tagging support is unsupported on direct ESXi connections and requires vCenter 6.0 or higher.
- type str
- 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, andnetwork
for network folders. Forces a new resource if changed.
- custom
Attributes Map<String> Map of custom attribute ids to attribute value strings to set for folder. See here for a reference on how to set values for custom attributes.
NOTE: Custom attributes are unsupported on direct ESXi connections and require vCenter.
- datacenter
Id String - 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.
- path String
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 typevm
(denoting a virtual machine folder), and a supplied folder oftest-folder
, the resulting path would be/default-dc/vm/test-folder
.NOTE:
path
can be modified - the resulting behavior is dependent on what section ofpath
you are modifying. If you are modifying the parent (so any part before the last/
), your folder will be moved to that new parent. If modifying the name (the part after the last/
), your folder will be renamed.- List<String>
The IDs of any tags to attach to this resource.
NOTE: Tagging support is unsupported on direct ESXi connections and requires vCenter 6.0 or higher.
- type String
- 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, andnetwork
for network folders. Forces a new resource if changed.
Package Details
- Repository
- vSphere pulumi/pulumi-vsphere
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vsphere
Terraform Provider.