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 Terraform",
}, {
dependsOn: [proxmox_virtual_environment_hagroup.example],
});
import pulumi
import pulumi_proxmoxve as proxmoxve
example = proxmoxve.ha.HAResource("example",
resource_id="vm:123",
state="started",
group="example",
comment="Managed by Terraform",
opts = pulumi.ResourceOptions(depends_on=[proxmox_virtual_environment_hagroup["example"]]))
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 Terraform"),
}, pulumi.DependsOn([]pulumi.Resource{
proxmox_virtual_environment_hagroup.Example,
}))
if err != nil {
return err
}
return nil
})
}
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 Terraform",
}, new CustomResourceOptions
{
DependsOn =
{
proxmox_virtual_environment_hagroup.Example,
},
});
});
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 Terraform")
.build(), CustomResourceOptions.builder()
.dependsOn(proxmox_virtual_environment_hagroup.example())
.build());
}
}
resources:
example:
type: proxmoxve:HA:HAResource
properties:
resourceId: vm:123
state: started
group: example
comment: Managed by Terraform
options:
dependson:
- ${proxmox_virtual_environment_hagroup.example}
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 string
- The unique name of the resource.
- args HAResourceArgs
- 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 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 string
- The unique name of the resource.
- args HAResourceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args HAResourceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
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"),
})
var haresourceResource = new HAResource("haresourceResource", HAResourceArgs.builder()
.resourceId("string")
.comment("string")
.group("string")
.maxRelocate(0)
.maxRestart(0)
.state("string")
.type("string")
.build());
haresource_resource = proxmoxve.ha.HAResource("haresourceResource",
resource_id="string",
comment="string",
group="string",
max_relocate=0,
max_restart=0,
state="string",
type="string")
const haresourceResource = new proxmoxve.ha.HAResource("haresourceResource", {
resourceId: "string",
comment: "string",
group: "string",
maxRelocate: 0,
maxRestart: 0,
state: "string",
type: "string",
});
type: proxmoxve:HA:HAResource
properties:
comment: string
group: string
maxRelocate: 0
maxRestart: 0
resourceId: string
state: string
type: string
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
The HAResource resource accepts the following input properties:
- Resource
Id 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.
- Max
Relocate int - The maximal number of relocation attempts.
- Max
Restart 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
.
- Resource
Id 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.
- Max
Relocate int - The maximal number of relocation attempts.
- Max
Restart 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
.
- resource
Id 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.
- max
Relocate Integer - The maximal number of relocation attempts.
- max
Restart 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
.
- resource
Id 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.
- max
Relocate number - The maximal number of relocation attempts.
- max
Restart 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 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
.
- resource
Id 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.
- max
Relocate Number - The maximal number of relocation attempts.
- max
Restart 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)
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.
- Comment string
- The comment associated with this resource.
- Group string
- 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 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.
- Max
Relocate int - The maximal number of relocation attempts.
- Max
Restart int - The maximal number of restart attempts.
- Resource
Id 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.
- max
Relocate Integer - The maximal number of relocation attempts.
- max
Restart Integer - The maximal number of restart attempts.
- resource
Id 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.
- max
Relocate number - The maximal number of relocation attempts.
- max
Restart number - The maximal number of restart attempts.
- resource
Id 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.
- max
Relocate Number - The maximal number of relocation attempts.
- max
Restart Number - The maximal number of restart attempts.
- resource
Id 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
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.