vsphere.Host
Explore with Pulumi AI
Provides a VMware vSphere host resource. This represents an ESXi host that can be used either as a member of a cluster or as a standalone host.
Example Usage
Create a standalone host
import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";
const datacenter = vsphere.getDatacenter({
name: "dc-01",
});
const thumbprint = vsphere.getHostThumbprint({
address: "esx-01.example.com",
insecure: true,
});
const esx_01 = new vsphere.Host("esx-01", {
hostname: "esx-01.example.com",
username: "root",
password: "password",
license: "00000-00000-00000-00000-00000",
thumbprint: thumbprint.then(thumbprint => thumbprint.id),
datacenter: datacenter.then(datacenter => datacenter.id),
});
import pulumi
import pulumi_vsphere as vsphere
datacenter = vsphere.get_datacenter(name="dc-01")
thumbprint = vsphere.get_host_thumbprint(address="esx-01.example.com",
insecure=True)
esx_01 = vsphere.Host("esx-01",
hostname="esx-01.example.com",
username="root",
password="password",
license="00000-00000-00000-00000-00000",
thumbprint=thumbprint.id,
datacenter=datacenter.id)
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 {
datacenter, err := vsphere.LookupDatacenter(ctx, &vsphere.LookupDatacenterArgs{
Name: pulumi.StringRef("dc-01"),
}, nil)
if err != nil {
return err
}
thumbprint, err := vsphere.GetHostThumbprint(ctx, &vsphere.GetHostThumbprintArgs{
Address: "esx-01.example.com",
Insecure: pulumi.BoolRef(true),
}, nil)
if err != nil {
return err
}
_, err = vsphere.NewHost(ctx, "esx-01", &vsphere.HostArgs{
Hostname: pulumi.String("esx-01.example.com"),
Username: pulumi.String("root"),
Password: pulumi.String("password"),
License: pulumi.String("00000-00000-00000-00000-00000"),
Thumbprint: pulumi.String(thumbprint.Id),
Datacenter: pulumi.String(datacenter.Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using VSphere = Pulumi.VSphere;
return await Deployment.RunAsync(() =>
{
var datacenter = VSphere.GetDatacenter.Invoke(new()
{
Name = "dc-01",
});
var thumbprint = VSphere.GetHostThumbprint.Invoke(new()
{
Address = "esx-01.example.com",
Insecure = true,
});
var esx_01 = new VSphere.Host("esx-01", new()
{
Hostname = "esx-01.example.com",
Username = "root",
Password = "password",
License = "00000-00000-00000-00000-00000",
Thumbprint = thumbprint.Apply(getHostThumbprintResult => getHostThumbprintResult.Id),
Datacenter = datacenter.Apply(getDatacenterResult => getDatacenterResult.Id),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vsphere.VsphereFunctions;
import com.pulumi.vsphere.inputs.GetDatacenterArgs;
import com.pulumi.vsphere.inputs.GetHostThumbprintArgs;
import com.pulumi.vsphere.Host;
import com.pulumi.vsphere.HostArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var datacenter = VsphereFunctions.getDatacenter(GetDatacenterArgs.builder()
.name("dc-01")
.build());
final var thumbprint = VsphereFunctions.getHostThumbprint(GetHostThumbprintArgs.builder()
.address("esx-01.example.com")
.insecure(true)
.build());
var esx_01 = new Host("esx-01", HostArgs.builder()
.hostname("esx-01.example.com")
.username("root")
.password("password")
.license("00000-00000-00000-00000-00000")
.thumbprint(thumbprint.applyValue(getHostThumbprintResult -> getHostThumbprintResult.id()))
.datacenter(datacenter.applyValue(getDatacenterResult -> getDatacenterResult.id()))
.build());
}
}
resources:
esx-01:
type: vsphere:Host
properties:
hostname: esx-01.example.com
username: root
password: password
license: 00000-00000-00000-00000-00000
thumbprint: ${thumbprint.id}
datacenter: ${datacenter.id}
variables:
datacenter:
fn::invoke:
Function: vsphere:getDatacenter
Arguments:
name: dc-01
thumbprint:
fn::invoke:
Function: vsphere:getHostThumbprint
Arguments:
address: esx-01.example.com
insecure: true
Create host in a compute cluster
import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";
const datacenter = vsphere.getDatacenter({
name: "dc-01",
});
const cluster = datacenter.then(datacenter => vsphere.getComputeCluster({
name: "cluster-01",
datacenterId: datacenter.id,
}));
const thumbprint = vsphere.getHostThumbprint({
address: "esx-01.example.com",
insecure: true,
});
const esx_01 = new vsphere.Host("esx-01", {
hostname: "esx-01.example.com",
username: "root",
password: "password",
license: "00000-00000-00000-00000-00000",
thumbprint: thumbprint.then(thumbprint => thumbprint.id),
cluster: cluster.then(cluster => cluster.id),
});
import pulumi
import pulumi_vsphere as vsphere
datacenter = vsphere.get_datacenter(name="dc-01")
cluster = vsphere.get_compute_cluster(name="cluster-01",
datacenter_id=datacenter.id)
thumbprint = vsphere.get_host_thumbprint(address="esx-01.example.com",
insecure=True)
esx_01 = vsphere.Host("esx-01",
hostname="esx-01.example.com",
username="root",
password="password",
license="00000-00000-00000-00000-00000",
thumbprint=thumbprint.id,
cluster=cluster.id)
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 {
datacenter, err := vsphere.LookupDatacenter(ctx, &vsphere.LookupDatacenterArgs{
Name: pulumi.StringRef("dc-01"),
}, nil)
if err != nil {
return err
}
cluster, err := vsphere.LookupComputeCluster(ctx, &vsphere.LookupComputeClusterArgs{
Name: "cluster-01",
DatacenterId: pulumi.StringRef(datacenter.Id),
}, nil)
if err != nil {
return err
}
thumbprint, err := vsphere.GetHostThumbprint(ctx, &vsphere.GetHostThumbprintArgs{
Address: "esx-01.example.com",
Insecure: pulumi.BoolRef(true),
}, nil)
if err != nil {
return err
}
_, err = vsphere.NewHost(ctx, "esx-01", &vsphere.HostArgs{
Hostname: pulumi.String("esx-01.example.com"),
Username: pulumi.String("root"),
Password: pulumi.String("password"),
License: pulumi.String("00000-00000-00000-00000-00000"),
Thumbprint: pulumi.String(thumbprint.Id),
Cluster: pulumi.String(cluster.Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using VSphere = Pulumi.VSphere;
return await Deployment.RunAsync(() =>
{
var datacenter = VSphere.GetDatacenter.Invoke(new()
{
Name = "dc-01",
});
var cluster = VSphere.GetComputeCluster.Invoke(new()
{
Name = "cluster-01",
DatacenterId = datacenter.Apply(getDatacenterResult => getDatacenterResult.Id),
});
var thumbprint = VSphere.GetHostThumbprint.Invoke(new()
{
Address = "esx-01.example.com",
Insecure = true,
});
var esx_01 = new VSphere.Host("esx-01", new()
{
Hostname = "esx-01.example.com",
Username = "root",
Password = "password",
License = "00000-00000-00000-00000-00000",
Thumbprint = thumbprint.Apply(getHostThumbprintResult => getHostThumbprintResult.Id),
Cluster = cluster.Apply(getComputeClusterResult => getComputeClusterResult.Id),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vsphere.VsphereFunctions;
import com.pulumi.vsphere.inputs.GetDatacenterArgs;
import com.pulumi.vsphere.inputs.GetComputeClusterArgs;
import com.pulumi.vsphere.inputs.GetHostThumbprintArgs;
import com.pulumi.vsphere.Host;
import com.pulumi.vsphere.HostArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var datacenter = VsphereFunctions.getDatacenter(GetDatacenterArgs.builder()
.name("dc-01")
.build());
final var cluster = VsphereFunctions.getComputeCluster(GetComputeClusterArgs.builder()
.name("cluster-01")
.datacenterId(datacenter.applyValue(getDatacenterResult -> getDatacenterResult.id()))
.build());
final var thumbprint = VsphereFunctions.getHostThumbprint(GetHostThumbprintArgs.builder()
.address("esx-01.example.com")
.insecure(true)
.build());
var esx_01 = new Host("esx-01", HostArgs.builder()
.hostname("esx-01.example.com")
.username("root")
.password("password")
.license("00000-00000-00000-00000-00000")
.thumbprint(thumbprint.applyValue(getHostThumbprintResult -> getHostThumbprintResult.id()))
.cluster(cluster.applyValue(getComputeClusterResult -> getComputeClusterResult.id()))
.build());
}
}
resources:
esx-01:
type: vsphere:Host
properties:
hostname: esx-01.example.com
username: root
password: password
license: 00000-00000-00000-00000-00000
thumbprint: ${thumbprint.id}
cluster: ${cluster.id}
variables:
datacenter:
fn::invoke:
Function: vsphere:getDatacenter
Arguments:
name: dc-01
cluster:
fn::invoke:
Function: vsphere:getComputeCluster
Arguments:
name: cluster-01
datacenterId: ${datacenter.id}
thumbprint:
fn::invoke:
Function: vsphere:getHostThumbprint
Arguments:
address: esx-01.example.com
insecure: true
Create Host Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Host(name: string, args: HostArgs, opts?: CustomResourceOptions);
@overload
def Host(resource_name: str,
args: HostArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Host(resource_name: str,
opts: Optional[ResourceOptions] = None,
hostname: Optional[str] = None,
username: Optional[str] = None,
password: Optional[str] = None,
custom_attributes: Optional[Mapping[str, str]] = None,
datacenter: Optional[str] = None,
force: Optional[bool] = None,
cluster: Optional[str] = None,
license: Optional[str] = None,
lockdown: Optional[str] = None,
maintenance: Optional[bool] = None,
connected: Optional[bool] = None,
tags: Optional[Sequence[str]] = None,
thumbprint: Optional[str] = None,
cluster_managed: Optional[bool] = None)
func NewHost(ctx *Context, name string, args HostArgs, opts ...ResourceOption) (*Host, error)
public Host(string name, HostArgs args, CustomResourceOptions? opts = null)
type: vsphere:Host
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 HostArgs
- 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 HostArgs
- 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 HostArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args HostArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args HostArgs
- 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 hostResource = new VSphere.Host("hostResource", new()
{
Hostname = "string",
Username = "string",
Password = "string",
CustomAttributes =
{
{ "string", "string" },
},
Datacenter = "string",
Force = false,
Cluster = "string",
License = "string",
Lockdown = "string",
Maintenance = false,
Connected = false,
Tags = new[]
{
"string",
},
Thumbprint = "string",
ClusterManaged = false,
});
example, err := vsphere.NewHost(ctx, "hostResource", &vsphere.HostArgs{
Hostname: pulumi.String("string"),
Username: pulumi.String("string"),
Password: pulumi.String("string"),
CustomAttributes: pulumi.StringMap{
"string": pulumi.String("string"),
},
Datacenter: pulumi.String("string"),
Force: pulumi.Bool(false),
Cluster: pulumi.String("string"),
License: pulumi.String("string"),
Lockdown: pulumi.String("string"),
Maintenance: pulumi.Bool(false),
Connected: pulumi.Bool(false),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
Thumbprint: pulumi.String("string"),
ClusterManaged: pulumi.Bool(false),
})
var hostResource = new Host("hostResource", HostArgs.builder()
.hostname("string")
.username("string")
.password("string")
.customAttributes(Map.of("string", "string"))
.datacenter("string")
.force(false)
.cluster("string")
.license("string")
.lockdown("string")
.maintenance(false)
.connected(false)
.tags("string")
.thumbprint("string")
.clusterManaged(false)
.build());
host_resource = vsphere.Host("hostResource",
hostname="string",
username="string",
password="string",
custom_attributes={
"string": "string",
},
datacenter="string",
force=False,
cluster="string",
license="string",
lockdown="string",
maintenance=False,
connected=False,
tags=["string"],
thumbprint="string",
cluster_managed=False)
const hostResource = new vsphere.Host("hostResource", {
hostname: "string",
username: "string",
password: "string",
customAttributes: {
string: "string",
},
datacenter: "string",
force: false,
cluster: "string",
license: "string",
lockdown: "string",
maintenance: false,
connected: false,
tags: ["string"],
thumbprint: "string",
clusterManaged: false,
});
type: vsphere:Host
properties:
cluster: string
clusterManaged: false
connected: false
customAttributes:
string: string
datacenter: string
force: false
hostname: string
license: string
lockdown: string
maintenance: false
password: string
tags:
- string
thumbprint: string
username: string
Host 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 Host resource accepts the following input properties:
- Hostname string
- FQDN or IP address of the host to be added.
- Password string
- Password that will be used by vSphere to authenticate to the host.
- Username string
- Username that will be used by vSphere to authenticate to the host.
- Cluster string
- The ID of the Compute Cluster this host should
be added to. This should not be set if
datacenter
is set. Conflicts with:cluster_managed
. - Cluster
Managed bool - Can be set to
true
if compute cluster membership will be managed through thecompute_cluster
resource rather than thehost
resource. Conflicts with:cluster
. - Connected bool
- If set to false then the host will be disconnected.
Default is
false
. - Custom
Attributes Dictionary<string, string> A map of custom attribute IDs and string values to apply to the resource. Please refer to the
vsphere_custom_attributes
resource for more information on applying tags to resources.NOTE: Custom attributes are not supported on direct ESXi host connections and require vCenter Server.
- Datacenter string
- The ID of the datacenter this host should
be added to. This should not be set if
cluster
is set. - Force bool
- If set to
true
then it will force the host to be added, even if the host is already connected to a different vCenter Server instance. Default isfalse
. - License string
- The license key that will be applied to the host. The license key is expected to be present in vSphere.
- Lockdown string
- Set the lockdown state of the host. Valid options are
disabled
,normal
, andstrict
. Default isdisabled
. - Maintenance bool
- Set the management state of the host.
Default is
false
. - List<string>
The IDs of any tags to attach to this resource. Please refer to the
vsphere.Tag
resource for more information on applying tags to resources.NOTE: Tagging support is not supported on direct ESXi host connections and require vCenter Server.
- Thumbprint string
- Host's certificate SHA-1 thumbprint. If not set the
CA that signed the host's certificate should be trusted. If the CA is not
trusted and no thumbprint is set then the operation will fail. See data source
[
vsphere.getHostThumbprint
][docs-host-thumbprint-data-source].
- Hostname string
- FQDN or IP address of the host to be added.
- Password string
- Password that will be used by vSphere to authenticate to the host.
- Username string
- Username that will be used by vSphere to authenticate to the host.
- Cluster string
- The ID of the Compute Cluster this host should
be added to. This should not be set if
datacenter
is set. Conflicts with:cluster_managed
. - Cluster
Managed bool - Can be set to
true
if compute cluster membership will be managed through thecompute_cluster
resource rather than thehost
resource. Conflicts with:cluster
. - Connected bool
- If set to false then the host will be disconnected.
Default is
false
. - Custom
Attributes map[string]string A map of custom attribute IDs and string values to apply to the resource. Please refer to the
vsphere_custom_attributes
resource for more information on applying tags to resources.NOTE: Custom attributes are not supported on direct ESXi host connections and require vCenter Server.
- Datacenter string
- The ID of the datacenter this host should
be added to. This should not be set if
cluster
is set. - Force bool
- If set to
true
then it will force the host to be added, even if the host is already connected to a different vCenter Server instance. Default isfalse
. - License string
- The license key that will be applied to the host. The license key is expected to be present in vSphere.
- Lockdown string
- Set the lockdown state of the host. Valid options are
disabled
,normal
, andstrict
. Default isdisabled
. - Maintenance bool
- Set the management state of the host.
Default is
false
. - []string
The IDs of any tags to attach to this resource. Please refer to the
vsphere.Tag
resource for more information on applying tags to resources.NOTE: Tagging support is not supported on direct ESXi host connections and require vCenter Server.
- Thumbprint string
- Host's certificate SHA-1 thumbprint. If not set the
CA that signed the host's certificate should be trusted. If the CA is not
trusted and no thumbprint is set then the operation will fail. See data source
[
vsphere.getHostThumbprint
][docs-host-thumbprint-data-source].
- hostname String
- FQDN or IP address of the host to be added.
- password String
- Password that will be used by vSphere to authenticate to the host.
- username String
- Username that will be used by vSphere to authenticate to the host.
- cluster String
- The ID of the Compute Cluster this host should
be added to. This should not be set if
datacenter
is set. Conflicts with:cluster_managed
. - cluster
Managed Boolean - Can be set to
true
if compute cluster membership will be managed through thecompute_cluster
resource rather than thehost
resource. Conflicts with:cluster
. - connected Boolean
- If set to false then the host will be disconnected.
Default is
false
. - custom
Attributes Map<String,String> A map of custom attribute IDs and string values to apply to the resource. Please refer to the
vsphere_custom_attributes
resource for more information on applying tags to resources.NOTE: Custom attributes are not supported on direct ESXi host connections and require vCenter Server.
- datacenter String
- The ID of the datacenter this host should
be added to. This should not be set if
cluster
is set. - force Boolean
- If set to
true
then it will force the host to be added, even if the host is already connected to a different vCenter Server instance. Default isfalse
. - license String
- The license key that will be applied to the host. The license key is expected to be present in vSphere.
- lockdown String
- Set the lockdown state of the host. Valid options are
disabled
,normal
, andstrict
. Default isdisabled
. - maintenance Boolean
- Set the management state of the host.
Default is
false
. - List<String>
The IDs of any tags to attach to this resource. Please refer to the
vsphere.Tag
resource for more information on applying tags to resources.NOTE: Tagging support is not supported on direct ESXi host connections and require vCenter Server.
- thumbprint String
- Host's certificate SHA-1 thumbprint. If not set the
CA that signed the host's certificate should be trusted. If the CA is not
trusted and no thumbprint is set then the operation will fail. See data source
[
vsphere.getHostThumbprint
][docs-host-thumbprint-data-source].
- hostname string
- FQDN or IP address of the host to be added.
- password string
- Password that will be used by vSphere to authenticate to the host.
- username string
- Username that will be used by vSphere to authenticate to the host.
- cluster string
- The ID of the Compute Cluster this host should
be added to. This should not be set if
datacenter
is set. Conflicts with:cluster_managed
. - cluster
Managed boolean - Can be set to
true
if compute cluster membership will be managed through thecompute_cluster
resource rather than thehost
resource. Conflicts with:cluster
. - connected boolean
- If set to false then the host will be disconnected.
Default is
false
. - custom
Attributes {[key: string]: string} A map of custom attribute IDs and string values to apply to the resource. Please refer to the
vsphere_custom_attributes
resource for more information on applying tags to resources.NOTE: Custom attributes are not supported on direct ESXi host connections and require vCenter Server.
- datacenter string
- The ID of the datacenter this host should
be added to. This should not be set if
cluster
is set. - force boolean
- If set to
true
then it will force the host to be added, even if the host is already connected to a different vCenter Server instance. Default isfalse
. - license string
- The license key that will be applied to the host. The license key is expected to be present in vSphere.
- lockdown string
- Set the lockdown state of the host. Valid options are
disabled
,normal
, andstrict
. Default isdisabled
. - maintenance boolean
- Set the management state of the host.
Default is
false
. - string[]
The IDs of any tags to attach to this resource. Please refer to the
vsphere.Tag
resource for more information on applying tags to resources.NOTE: Tagging support is not supported on direct ESXi host connections and require vCenter Server.
- thumbprint string
- Host's certificate SHA-1 thumbprint. If not set the
CA that signed the host's certificate should be trusted. If the CA is not
trusted and no thumbprint is set then the operation will fail. See data source
[
vsphere.getHostThumbprint
][docs-host-thumbprint-data-source].
- hostname str
- FQDN or IP address of the host to be added.
- password str
- Password that will be used by vSphere to authenticate to the host.
- username str
- Username that will be used by vSphere to authenticate to the host.
- cluster str
- The ID of the Compute Cluster this host should
be added to. This should not be set if
datacenter
is set. Conflicts with:cluster_managed
. - cluster_
managed bool - Can be set to
true
if compute cluster membership will be managed through thecompute_cluster
resource rather than thehost
resource. Conflicts with:cluster
. - connected bool
- If set to false then the host will be disconnected.
Default is
false
. - custom_
attributes Mapping[str, str] A map of custom attribute IDs and string values to apply to the resource. Please refer to the
vsphere_custom_attributes
resource for more information on applying tags to resources.NOTE: Custom attributes are not supported on direct ESXi host connections and require vCenter Server.
- datacenter str
- The ID of the datacenter this host should
be added to. This should not be set if
cluster
is set. - force bool
- If set to
true
then it will force the host to be added, even if the host is already connected to a different vCenter Server instance. Default isfalse
. - license str
- The license key that will be applied to the host. The license key is expected to be present in vSphere.
- lockdown str
- Set the lockdown state of the host. Valid options are
disabled
,normal
, andstrict
. Default isdisabled
. - maintenance bool
- Set the management state of the host.
Default is
false
. - Sequence[str]
The IDs of any tags to attach to this resource. Please refer to the
vsphere.Tag
resource for more information on applying tags to resources.NOTE: Tagging support is not supported on direct ESXi host connections and require vCenter Server.
- thumbprint str
- Host's certificate SHA-1 thumbprint. If not set the
CA that signed the host's certificate should be trusted. If the CA is not
trusted and no thumbprint is set then the operation will fail. See data source
[
vsphere.getHostThumbprint
][docs-host-thumbprint-data-source].
- hostname String
- FQDN or IP address of the host to be added.
- password String
- Password that will be used by vSphere to authenticate to the host.
- username String
- Username that will be used by vSphere to authenticate to the host.
- cluster String
- The ID of the Compute Cluster this host should
be added to. This should not be set if
datacenter
is set. Conflicts with:cluster_managed
. - cluster
Managed Boolean - Can be set to
true
if compute cluster membership will be managed through thecompute_cluster
resource rather than thehost
resource. Conflicts with:cluster
. - connected Boolean
- If set to false then the host will be disconnected.
Default is
false
. - custom
Attributes Map<String> A map of custom attribute IDs and string values to apply to the resource. Please refer to the
vsphere_custom_attributes
resource for more information on applying tags to resources.NOTE: Custom attributes are not supported on direct ESXi host connections and require vCenter Server.
- datacenter String
- The ID of the datacenter this host should
be added to. This should not be set if
cluster
is set. - force Boolean
- If set to
true
then it will force the host to be added, even if the host is already connected to a different vCenter Server instance. Default isfalse
. - license String
- The license key that will be applied to the host. The license key is expected to be present in vSphere.
- lockdown String
- Set the lockdown state of the host. Valid options are
disabled
,normal
, andstrict
. Default isdisabled
. - maintenance Boolean
- Set the management state of the host.
Default is
false
. - List<String>
The IDs of any tags to attach to this resource. Please refer to the
vsphere.Tag
resource for more information on applying tags to resources.NOTE: Tagging support is not supported on direct ESXi host connections and require vCenter Server.
- thumbprint String
- Host's certificate SHA-1 thumbprint. If not set the
CA that signed the host's certificate should be trusted. If the CA is not
trusted and no thumbprint is set then the operation will fail. See data source
[
vsphere.getHostThumbprint
][docs-host-thumbprint-data-source].
Outputs
All input properties are implicitly available as output properties. Additionally, the Host 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 Host Resource
Get an existing Host 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?: HostState, opts?: CustomResourceOptions): Host
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cluster: Optional[str] = None,
cluster_managed: Optional[bool] = None,
connected: Optional[bool] = None,
custom_attributes: Optional[Mapping[str, str]] = None,
datacenter: Optional[str] = None,
force: Optional[bool] = None,
hostname: Optional[str] = None,
license: Optional[str] = None,
lockdown: Optional[str] = None,
maintenance: Optional[bool] = None,
password: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
thumbprint: Optional[str] = None,
username: Optional[str] = None) -> Host
func GetHost(ctx *Context, name string, id IDInput, state *HostState, opts ...ResourceOption) (*Host, error)
public static Host Get(string name, Input<string> id, HostState? state, CustomResourceOptions? opts = null)
public static Host get(String name, Output<String> id, HostState 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.
- Cluster string
- The ID of the Compute Cluster this host should
be added to. This should not be set if
datacenter
is set. Conflicts with:cluster_managed
. - Cluster
Managed bool - Can be set to
true
if compute cluster membership will be managed through thecompute_cluster
resource rather than thehost
resource. Conflicts with:cluster
. - Connected bool
- If set to false then the host will be disconnected.
Default is
false
. - Custom
Attributes Dictionary<string, string> A map of custom attribute IDs and string values to apply to the resource. Please refer to the
vsphere_custom_attributes
resource for more information on applying tags to resources.NOTE: Custom attributes are not supported on direct ESXi host connections and require vCenter Server.
- Datacenter string
- The ID of the datacenter this host should
be added to. This should not be set if
cluster
is set. - Force bool
- If set to
true
then it will force the host to be added, even if the host is already connected to a different vCenter Server instance. Default isfalse
. - Hostname string
- FQDN or IP address of the host to be added.
- License string
- The license key that will be applied to the host. The license key is expected to be present in vSphere.
- Lockdown string
- Set the lockdown state of the host. Valid options are
disabled
,normal
, andstrict
. Default isdisabled
. - Maintenance bool
- Set the management state of the host.
Default is
false
. - Password string
- Password that will be used by vSphere to authenticate to the host.
- List<string>
The IDs of any tags to attach to this resource. Please refer to the
vsphere.Tag
resource for more information on applying tags to resources.NOTE: Tagging support is not supported on direct ESXi host connections and require vCenter Server.
- Thumbprint string
- Host's certificate SHA-1 thumbprint. If not set the
CA that signed the host's certificate should be trusted. If the CA is not
trusted and no thumbprint is set then the operation will fail. See data source
[
vsphere.getHostThumbprint
][docs-host-thumbprint-data-source]. - Username string
- Username that will be used by vSphere to authenticate to the host.
- Cluster string
- The ID of the Compute Cluster this host should
be added to. This should not be set if
datacenter
is set. Conflicts with:cluster_managed
. - Cluster
Managed bool - Can be set to
true
if compute cluster membership will be managed through thecompute_cluster
resource rather than thehost
resource. Conflicts with:cluster
. - Connected bool
- If set to false then the host will be disconnected.
Default is
false
. - Custom
Attributes map[string]string A map of custom attribute IDs and string values to apply to the resource. Please refer to the
vsphere_custom_attributes
resource for more information on applying tags to resources.NOTE: Custom attributes are not supported on direct ESXi host connections and require vCenter Server.
- Datacenter string
- The ID of the datacenter this host should
be added to. This should not be set if
cluster
is set. - Force bool
- If set to
true
then it will force the host to be added, even if the host is already connected to a different vCenter Server instance. Default isfalse
. - Hostname string
- FQDN or IP address of the host to be added.
- License string
- The license key that will be applied to the host. The license key is expected to be present in vSphere.
- Lockdown string
- Set the lockdown state of the host. Valid options are
disabled
,normal
, andstrict
. Default isdisabled
. - Maintenance bool
- Set the management state of the host.
Default is
false
. - Password string
- Password that will be used by vSphere to authenticate to the host.
- []string
The IDs of any tags to attach to this resource. Please refer to the
vsphere.Tag
resource for more information on applying tags to resources.NOTE: Tagging support is not supported on direct ESXi host connections and require vCenter Server.
- Thumbprint string
- Host's certificate SHA-1 thumbprint. If not set the
CA that signed the host's certificate should be trusted. If the CA is not
trusted and no thumbprint is set then the operation will fail. See data source
[
vsphere.getHostThumbprint
][docs-host-thumbprint-data-source]. - Username string
- Username that will be used by vSphere to authenticate to the host.
- cluster String
- The ID of the Compute Cluster this host should
be added to. This should not be set if
datacenter
is set. Conflicts with:cluster_managed
. - cluster
Managed Boolean - Can be set to
true
if compute cluster membership will be managed through thecompute_cluster
resource rather than thehost
resource. Conflicts with:cluster
. - connected Boolean
- If set to false then the host will be disconnected.
Default is
false
. - custom
Attributes Map<String,String> A map of custom attribute IDs and string values to apply to the resource. Please refer to the
vsphere_custom_attributes
resource for more information on applying tags to resources.NOTE: Custom attributes are not supported on direct ESXi host connections and require vCenter Server.
- datacenter String
- The ID of the datacenter this host should
be added to. This should not be set if
cluster
is set. - force Boolean
- If set to
true
then it will force the host to be added, even if the host is already connected to a different vCenter Server instance. Default isfalse
. - hostname String
- FQDN or IP address of the host to be added.
- license String
- The license key that will be applied to the host. The license key is expected to be present in vSphere.
- lockdown String
- Set the lockdown state of the host. Valid options are
disabled
,normal
, andstrict
. Default isdisabled
. - maintenance Boolean
- Set the management state of the host.
Default is
false
. - password String
- Password that will be used by vSphere to authenticate to the host.
- List<String>
The IDs of any tags to attach to this resource. Please refer to the
vsphere.Tag
resource for more information on applying tags to resources.NOTE: Tagging support is not supported on direct ESXi host connections and require vCenter Server.
- thumbprint String
- Host's certificate SHA-1 thumbprint. If not set the
CA that signed the host's certificate should be trusted. If the CA is not
trusted and no thumbprint is set then the operation will fail. See data source
[
vsphere.getHostThumbprint
][docs-host-thumbprint-data-source]. - username String
- Username that will be used by vSphere to authenticate to the host.
- cluster string
- The ID of the Compute Cluster this host should
be added to. This should not be set if
datacenter
is set. Conflicts with:cluster_managed
. - cluster
Managed boolean - Can be set to
true
if compute cluster membership will be managed through thecompute_cluster
resource rather than thehost
resource. Conflicts with:cluster
. - connected boolean
- If set to false then the host will be disconnected.
Default is
false
. - custom
Attributes {[key: string]: string} A map of custom attribute IDs and string values to apply to the resource. Please refer to the
vsphere_custom_attributes
resource for more information on applying tags to resources.NOTE: Custom attributes are not supported on direct ESXi host connections and require vCenter Server.
- datacenter string
- The ID of the datacenter this host should
be added to. This should not be set if
cluster
is set. - force boolean
- If set to
true
then it will force the host to be added, even if the host is already connected to a different vCenter Server instance. Default isfalse
. - hostname string
- FQDN or IP address of the host to be added.
- license string
- The license key that will be applied to the host. The license key is expected to be present in vSphere.
- lockdown string
- Set the lockdown state of the host. Valid options are
disabled
,normal
, andstrict
. Default isdisabled
. - maintenance boolean
- Set the management state of the host.
Default is
false
. - password string
- Password that will be used by vSphere to authenticate to the host.
- string[]
The IDs of any tags to attach to this resource. Please refer to the
vsphere.Tag
resource for more information on applying tags to resources.NOTE: Tagging support is not supported on direct ESXi host connections and require vCenter Server.
- thumbprint string
- Host's certificate SHA-1 thumbprint. If not set the
CA that signed the host's certificate should be trusted. If the CA is not
trusted and no thumbprint is set then the operation will fail. See data source
[
vsphere.getHostThumbprint
][docs-host-thumbprint-data-source]. - username string
- Username that will be used by vSphere to authenticate to the host.
- cluster str
- The ID of the Compute Cluster this host should
be added to. This should not be set if
datacenter
is set. Conflicts with:cluster_managed
. - cluster_
managed bool - Can be set to
true
if compute cluster membership will be managed through thecompute_cluster
resource rather than thehost
resource. Conflicts with:cluster
. - connected bool
- If set to false then the host will be disconnected.
Default is
false
. - custom_
attributes Mapping[str, str] A map of custom attribute IDs and string values to apply to the resource. Please refer to the
vsphere_custom_attributes
resource for more information on applying tags to resources.NOTE: Custom attributes are not supported on direct ESXi host connections and require vCenter Server.
- datacenter str
- The ID of the datacenter this host should
be added to. This should not be set if
cluster
is set. - force bool
- If set to
true
then it will force the host to be added, even if the host is already connected to a different vCenter Server instance. Default isfalse
. - hostname str
- FQDN or IP address of the host to be added.
- license str
- The license key that will be applied to the host. The license key is expected to be present in vSphere.
- lockdown str
- Set the lockdown state of the host. Valid options are
disabled
,normal
, andstrict
. Default isdisabled
. - maintenance bool
- Set the management state of the host.
Default is
false
. - password str
- Password that will be used by vSphere to authenticate to the host.
- Sequence[str]
The IDs of any tags to attach to this resource. Please refer to the
vsphere.Tag
resource for more information on applying tags to resources.NOTE: Tagging support is not supported on direct ESXi host connections and require vCenter Server.
- thumbprint str
- Host's certificate SHA-1 thumbprint. If not set the
CA that signed the host's certificate should be trusted. If the CA is not
trusted and no thumbprint is set then the operation will fail. See data source
[
vsphere.getHostThumbprint
][docs-host-thumbprint-data-source]. - username str
- Username that will be used by vSphere to authenticate to the host.
- cluster String
- The ID of the Compute Cluster this host should
be added to. This should not be set if
datacenter
is set. Conflicts with:cluster_managed
. - cluster
Managed Boolean - Can be set to
true
if compute cluster membership will be managed through thecompute_cluster
resource rather than thehost
resource. Conflicts with:cluster
. - connected Boolean
- If set to false then the host will be disconnected.
Default is
false
. - custom
Attributes Map<String> A map of custom attribute IDs and string values to apply to the resource. Please refer to the
vsphere_custom_attributes
resource for more information on applying tags to resources.NOTE: Custom attributes are not supported on direct ESXi host connections and require vCenter Server.
- datacenter String
- The ID of the datacenter this host should
be added to. This should not be set if
cluster
is set. - force Boolean
- If set to
true
then it will force the host to be added, even if the host is already connected to a different vCenter Server instance. Default isfalse
. - hostname String
- FQDN or IP address of the host to be added.
- license String
- The license key that will be applied to the host. The license key is expected to be present in vSphere.
- lockdown String
- Set the lockdown state of the host. Valid options are
disabled
,normal
, andstrict
. Default isdisabled
. - maintenance Boolean
- Set the management state of the host.
Default is
false
. - password String
- Password that will be used by vSphere to authenticate to the host.
- List<String>
The IDs of any tags to attach to this resource. Please refer to the
vsphere.Tag
resource for more information on applying tags to resources.NOTE: Tagging support is not supported on direct ESXi host connections and require vCenter Server.
- thumbprint String
- Host's certificate SHA-1 thumbprint. If not set the
CA that signed the host's certificate should be trusted. If the CA is not
trusted and no thumbprint is set then the operation will fail. See data source
[
vsphere.getHostThumbprint
][docs-host-thumbprint-data-source]. - username String
- Username that will be used by vSphere to authenticate to the host.
Import
ing
An existing host can be imported into this resource by supplying the host’s ID. An example is below:
terraform import vsphere_host.esx-01 host-123
The above would import the host with ID host-123
.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- vSphere pulumi/pulumi-vsphere
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vsphere
Terraform Provider.