1. Packages
  2. Proxmox Virtual Environment (Proxmox VE)
  3. API Docs
  4. HA
  5. HAResource
Proxmox Virtual Environment (Proxmox VE) v7.0.0 published on Tuesday, Apr 1, 2025 by Daniel Muehlbachler-Pietrzykowski

proxmoxve.HA.HAResource

Explore with Pulumi AI

Manages Proxmox HA resources.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";

const example = new proxmoxve.ha.HAResource("example", {
    resourceId: "vm:123",
    state: "started",
    group: "example",
    comment: "Managed by Pulumi",
}, {
    dependsOn: [proxmox_virtual_environment_hagroup.example],
});
Copy
import pulumi
import pulumi_proxmoxve as proxmoxve

example = proxmoxve.ha.HAResource("example",
    resource_id="vm:123",
    state="started",
    group="example",
    comment="Managed by Pulumi",
    opts = pulumi.ResourceOptions(depends_on=[proxmox_virtual_environment_hagroup["example"]]))
Copy
package main

import (
	"github.com/muhlba91/pulumi-proxmoxve/sdk/v6/go/proxmoxve/ha"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ha.NewHAResource(ctx, "example", &ha.HAResourceArgs{
			ResourceId: pulumi.String("vm:123"),
			State:      pulumi.String("started"),
			Group:      pulumi.String("example"),
			Comment:    pulumi.String("Managed by Pulumi"),
		}, pulumi.DependsOn([]pulumi.Resource{
			proxmox_virtual_environment_hagroup.Example,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using ProxmoxVE = Pulumi.ProxmoxVE;

return await Deployment.RunAsync(() => 
{
    var example = new ProxmoxVE.HA.HAResource("example", new()
    {
        ResourceId = "vm:123",
        State = "started",
        Group = "example",
        Comment = "Managed by Pulumi",
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            proxmox_virtual_environment_hagroup.Example,
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.proxmoxve.HA.HAResource;
import com.pulumi.proxmoxve.HA.HAResourceArgs;
import com.pulumi.resources.CustomResourceOptions;
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) {
        var example = new HAResource("example", HAResourceArgs.builder()
            .resourceId("vm:123")
            .state("started")
            .group("example")
            .comment("Managed by Pulumi")
            .build(), CustomResourceOptions.builder()
                .dependsOn(proxmox_virtual_environment_hagroup.example())
                .build());

    }
}
Copy
resources:
  example:
    type: proxmoxve:HA:HAResource
    properties:
      resourceId: vm:123
      state: started
      group: example
      comment: Managed by Pulumi
    options:
      dependsOn:
        - ${proxmox_virtual_environment_hagroup.example}
Copy

Create HAResource Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new HAResource(name: string, args: HAResourceArgs, opts?: CustomResourceOptions);
@overload
def HAResource(resource_name: str,
               args: HAResourceArgs,
               opts: Optional[ResourceOptions] = None)

@overload
def HAResource(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               resource_id: Optional[str] = None,
               comment: Optional[str] = None,
               group: Optional[str] = None,
               max_relocate: Optional[int] = None,
               max_restart: Optional[int] = None,
               state: Optional[str] = None,
               type: Optional[str] = None)
func NewHAResource(ctx *Context, name string, args HAResourceArgs, opts ...ResourceOption) (*HAResource, error)
public HAResource(string name, HAResourceArgs args, CustomResourceOptions? opts = null)
public HAResource(String name, HAResourceArgs args)
public HAResource(String name, HAResourceArgs args, CustomResourceOptions options)
type: proxmoxve:HA:HAResource
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. HAResourceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. HAResourceArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. HAResourceArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. HAResourceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. HAResourceArgs
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 haresourceResource = new ProxmoxVE.HA.HAResource("haresourceResource", new()
{
    ResourceId = "string",
    Comment = "string",
    Group = "string",
    MaxRelocate = 0,
    MaxRestart = 0,
    State = "string",
    Type = "string",
});
Copy
example, err := HA.NewHAResource(ctx, "haresourceResource", &HA.HAResourceArgs{
	ResourceId:  pulumi.String("string"),
	Comment:     pulumi.String("string"),
	Group:       pulumi.String("string"),
	MaxRelocate: pulumi.Int(0),
	MaxRestart:  pulumi.Int(0),
	State:       pulumi.String("string"),
	Type:        pulumi.String("string"),
})
Copy
var haresourceResource = new HAResource("haresourceResource", HAResourceArgs.builder()
    .resourceId("string")
    .comment("string")
    .group("string")
    .maxRelocate(0)
    .maxRestart(0)
    .state("string")
    .type("string")
    .build());
Copy
haresource_resource = proxmoxve.ha.HAResource("haresourceResource",
    resource_id="string",
    comment="string",
    group="string",
    max_relocate=0,
    max_restart=0,
    state="string",
    type="string")
Copy
const haresourceResource = new proxmoxve.ha.HAResource("haresourceResource", {
    resourceId: "string",
    comment: "string",
    group: "string",
    maxRelocate: 0,
    maxRestart: 0,
    state: "string",
    type: "string",
});
Copy
type: proxmoxve:HA:HAResource
properties:
    comment: string
    group: string
    maxRelocate: 0
    maxRestart: 0
    resourceId: string
    state: string
    type: string
Copy

HAResource Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The HAResource resource accepts the following input properties:

ResourceId This property is required. string
The Proxmox HA resource identifier
Comment string
The comment associated with this resource.
Group string
The identifier of the High Availability group this resource is a member of.
MaxRelocate int
The maximal number of relocation attempts.
MaxRestart int
The maximal number of restart attempts.
State string
The desired state of the resource.
Type string
The type of HA resources to create. If unset, it will be deduced from the resource_id.
ResourceId This property is required. string
The Proxmox HA resource identifier
Comment string
The comment associated with this resource.
Group string
The identifier of the High Availability group this resource is a member of.
MaxRelocate int
The maximal number of relocation attempts.
MaxRestart int
The maximal number of restart attempts.
State string
The desired state of the resource.
Type string
The type of HA resources to create. If unset, it will be deduced from the resource_id.
resourceId This property is required. String
The Proxmox HA resource identifier
comment String
The comment associated with this resource.
group String
The identifier of the High Availability group this resource is a member of.
maxRelocate Integer
The maximal number of relocation attempts.
maxRestart Integer
The maximal number of restart attempts.
state String
The desired state of the resource.
type String
The type of HA resources to create. If unset, it will be deduced from the resource_id.
resourceId This property is required. string
The Proxmox HA resource identifier
comment string
The comment associated with this resource.
group string
The identifier of the High Availability group this resource is a member of.
maxRelocate number
The maximal number of relocation attempts.
maxRestart number
The maximal number of restart attempts.
state string
The desired state of the resource.
type string
The type of HA resources to create. If unset, it will be deduced from the resource_id.
resource_id This property is required. str
The Proxmox HA resource identifier
comment str
The comment associated with this resource.
group str
The identifier of the High Availability group this resource is a member of.
max_relocate int
The maximal number of relocation attempts.
max_restart int
The maximal number of restart attempts.
state str
The desired state of the resource.
type str
The type of HA resources to create. If unset, it will be deduced from the resource_id.
resourceId This property is required. String
The Proxmox HA resource identifier
comment String
The comment associated with this resource.
group String
The identifier of the High Availability group this resource is a member of.
maxRelocate Number
The maximal number of relocation attempts.
maxRestart Number
The maximal number of restart attempts.
state String
The desired state of the resource.
type String
The type of HA resources to create. If unset, it will be deduced from the resource_id.

Outputs

All input properties are implicitly available as output properties. Additionally, the HAResource 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 HAResource Resource

Get an existing HAResource 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?: HAResourceState, opts?: CustomResourceOptions): HAResource
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        comment: Optional[str] = None,
        group: Optional[str] = None,
        max_relocate: Optional[int] = None,
        max_restart: Optional[int] = None,
        resource_id: Optional[str] = None,
        state: Optional[str] = None,
        type: Optional[str] = None) -> HAResource
func GetHAResource(ctx *Context, name string, id IDInput, state *HAResourceState, opts ...ResourceOption) (*HAResource, error)
public static HAResource Get(string name, Input<string> id, HAResourceState? state, CustomResourceOptions? opts = null)
public static HAResource get(String name, Output<String> id, HAResourceState state, CustomResourceOptions options)
resources:  _:    type: proxmoxve:HA:HAResource    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
Comment string
The comment associated with this resource.
Group string
The identifier of the High Availability group this resource is a member of.
MaxRelocate int
The maximal number of relocation attempts.
MaxRestart int
The maximal number of restart attempts.
ResourceId string
The Proxmox HA resource identifier
State string
The desired state of the resource.
Type string
The type of HA resources to create. If unset, it will be deduced from the resource_id.
Comment string
The comment associated with this resource.
Group string
The identifier of the High Availability group this resource is a member of.
MaxRelocate int
The maximal number of relocation attempts.
MaxRestart int
The maximal number of restart attempts.
ResourceId string
The Proxmox HA resource identifier
State string
The desired state of the resource.
Type string
The type of HA resources to create. If unset, it will be deduced from the resource_id.
comment String
The comment associated with this resource.
group String
The identifier of the High Availability group this resource is a member of.
maxRelocate Integer
The maximal number of relocation attempts.
maxRestart Integer
The maximal number of restart attempts.
resourceId String
The Proxmox HA resource identifier
state String
The desired state of the resource.
type String
The type of HA resources to create. If unset, it will be deduced from the resource_id.
comment string
The comment associated with this resource.
group string
The identifier of the High Availability group this resource is a member of.
maxRelocate number
The maximal number of relocation attempts.
maxRestart number
The maximal number of restart attempts.
resourceId string
The Proxmox HA resource identifier
state string
The desired state of the resource.
type string
The type of HA resources to create. If unset, it will be deduced from the resource_id.
comment str
The comment associated with this resource.
group str
The identifier of the High Availability group this resource is a member of.
max_relocate int
The maximal number of relocation attempts.
max_restart int
The maximal number of restart attempts.
resource_id str
The Proxmox HA resource identifier
state str
The desired state of the resource.
type str
The type of HA resources to create. If unset, it will be deduced from the resource_id.
comment String
The comment associated with this resource.
group String
The identifier of the High Availability group this resource is a member of.
maxRelocate Number
The maximal number of relocation attempts.
maxRestart Number
The maximal number of restart attempts.
resourceId String
The Proxmox HA resource identifier
state String
The desired state of the resource.
type String
The type of HA resources to create. If unset, it will be deduced from the resource_id.

Import

#!/usr/bin/env sh

HA resources can be imported using their identifiers, e.g.:

$ pulumi import proxmoxve:HA/hAResource:HAResource example vm:123
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
proxmoxve muhlba91/pulumi-proxmoxve
License
Apache-2.0
Notes
This Pulumi package is based on the proxmox Terraform Provider.