1. Packages
  2. Packages
  3. Vsphere Provider
  4. API Docs
  5. Alarm
Viewing docs for vSphere v4.17.0
published on Thursday, Jun 25, 2026 by Pulumi
vsphere logo
Viewing docs for vSphere v4.17.0
published on Thursday, Jun 25, 2026 by Pulumi

    Provides a VMware vSphere alarm resource. This can be used deployed on all kinds of vSphere inventory objects.

    Example Usage

    S

    Create warning alarm with an email action on a datacenter when on a host is disconnected:

    import * as pulumi from "@pulumi/pulumi";
    import * as vsphere from "@pulumi/vsphere";
    
    const hostDisconnectedWarning = new vsphere.Alarm("host_disconnected_warning", {
        name: "Host disconnected",
        description: "Triggers a warning when a host is disconnected",
        entityType: "Datacenter",
        entityId: datacenter.id,
        stateExpressions: [{
            operator: "isEqual",
            statePath: "runtime.connectionState",
            objectType: "HostSystem",
            yellow: "disconnected",
        }],
        emailActions: [{
            to: "foo@example.com",
            subject: "Host disconnected",
            startState: "green",
            finalState: "yellow",
        }],
    });
    
    import pulumi
    import pulumi_vsphere as vsphere
    
    host_disconnected_warning = vsphere.Alarm("host_disconnected_warning",
        name="Host disconnected",
        description="Triggers a warning when a host is disconnected",
        entity_type="Datacenter",
        entity_id=datacenter["id"],
        state_expressions=[{
            "operator": "isEqual",
            "state_path": "runtime.connectionState",
            "object_type": "HostSystem",
            "yellow": "disconnected",
        }],
        email_actions=[{
            "to": "foo@example.com",
            "subject": "Host disconnected",
            "start_state": "green",
            "final_state": "yellow",
        }])
    
    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 {
    		_, err := vsphere.NewAlarm(ctx, "host_disconnected_warning", &vsphere.AlarmArgs{
    			Name:        pulumi.String("Host disconnected"),
    			Description: pulumi.String("Triggers a warning when a host is disconnected"),
    			EntityType:  pulumi.String("Datacenter"),
    			EntityId:    pulumi.Any(datacenter.Id),
    			StateExpressions: vsphere.AlarmStateExpressionArray{
    				&vsphere.AlarmStateExpressionArgs{
    					Operator:   pulumi.String("isEqual"),
    					StatePath:  pulumi.String("runtime.connectionState"),
    					ObjectType: pulumi.String("HostSystem"),
    					Yellow:     pulumi.String("disconnected"),
    				},
    			},
    			EmailActions: vsphere.AlarmEmailActionArray{
    				&vsphere.AlarmEmailActionArgs{
    					To:         pulumi.String("foo@example.com"),
    					Subject:    pulumi.String("Host disconnected"),
    					StartState: pulumi.String("green"),
    					FinalState: pulumi.String("yellow"),
    				},
    			},
    		})
    		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 hostDisconnectedWarning = new VSphere.Alarm("host_disconnected_warning", new()
        {
            Name = "Host disconnected",
            Description = "Triggers a warning when a host is disconnected",
            EntityType = "Datacenter",
            EntityId = datacenter.Id,
            StateExpressions = new[]
            {
                new VSphere.Inputs.AlarmStateExpressionArgs
                {
                    Operator = "isEqual",
                    StatePath = "runtime.connectionState",
                    ObjectType = "HostSystem",
                    Yellow = "disconnected",
                },
            },
            EmailActions = new[]
            {
                new VSphere.Inputs.AlarmEmailActionArgs
                {
                    To = "foo@example.com",
                    Subject = "Host disconnected",
                    StartState = "green",
                    FinalState = "yellow",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vsphere.Alarm;
    import com.pulumi.vsphere.AlarmArgs;
    import com.pulumi.vsphere.inputs.AlarmStateExpressionArgs;
    import com.pulumi.vsphere.inputs.AlarmEmailActionArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 hostDisconnectedWarning = new Alarm("hostDisconnectedWarning", AlarmArgs.builder()
                .name("Host disconnected")
                .description("Triggers a warning when a host is disconnected")
                .entityType("Datacenter")
                .entityId(datacenter.id())
                .stateExpressions(AlarmStateExpressionArgs.builder()
                    .operator("isEqual")
                    .statePath("runtime.connectionState")
                    .objectType("HostSystem")
                    .yellow("disconnected")
                    .build())
                .emailActions(AlarmEmailActionArgs.builder()
                    .to("foo@example.com")
                    .subject("Host disconnected")
                    .startState("green")
                    .finalState("yellow")
                    .build())
                .build());
    
        }
    }
    
    resources:
      hostDisconnectedWarning:
        type: vsphere:Alarm
        name: host_disconnected_warning
        properties:
          name: Host disconnected
          description: Triggers a warning when a host is disconnected
          entityType: Datacenter
          entityId: ${datacenter.id}
          stateExpressions:
            - operator: isEqual
              statePath: runtime.connectionState
              objectType: HostSystem
              yellow: disconnected
          emailActions:
            - to: foo@example.com
              subject: Host disconnected
              startState: green
              finalState: yellow
    
    pulumi {
      required_providers {
        vsphere = {
          source = "pulumi/vsphere"
        }
      }
    }
    
    resource "vsphere_alarm" "host_disconnected_warning" {
      name        = "Host disconnected"
      description = "Triggers a warning when a host is disconnected"
      entity_type = "Datacenter"
      entity_id   = datacenter.id
      state_expressions {
        operator    = "isEqual"
        state_path  = "runtime.connectionState"
        object_type = "HostSystem"
        yellow      = "disconnected"
      }
      email_actions {
        to          = "foo@example.com"
        subject     = "Host disconnected"
        start_state = "green"
        final_state = "yellow"
      }
    }
    

    Create critical alarm when a host CPU usage is above 95% for 5min:

    import * as pulumi from "@pulumi/pulumi";
    import * as vsphere from "@pulumi/vsphere";
    
    const hostDisconnectedWarning = new vsphere.Alarm("host_disconnected_warning", {
        name: "Host CPU usage",
        description: "Triggers a critical when a host CPU usage is too high",
        entityType: "Datacenter",
        entityId: datacenter.id,
        metricExpressions: [{
            metricCounterId: 2,
            operator: "isAbove",
            objectType: "HostSystem",
            red: 9500,
            redInterval: 300,
        }],
    });
    
    import pulumi
    import pulumi_vsphere as vsphere
    
    host_disconnected_warning = vsphere.Alarm("host_disconnected_warning",
        name="Host CPU usage",
        description="Triggers a critical when a host CPU usage is too high",
        entity_type="Datacenter",
        entity_id=datacenter["id"],
        metric_expressions=[{
            "metric_counter_id": 2,
            "operator": "isAbove",
            "object_type": "HostSystem",
            "red": 9500,
            "red_interval": 300,
        }])
    
    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 {
    		_, err := vsphere.NewAlarm(ctx, "host_disconnected_warning", &vsphere.AlarmArgs{
    			Name:        pulumi.String("Host CPU usage"),
    			Description: pulumi.String("Triggers a critical when a host CPU usage is too high"),
    			EntityType:  pulumi.String("Datacenter"),
    			EntityId:    pulumi.Any(datacenter.Id),
    			MetricExpressions: vsphere.AlarmMetricExpressionArray{
    				&vsphere.AlarmMetricExpressionArgs{
    					MetricCounterId: pulumi.Int(2),
    					Operator:        pulumi.String("isAbove"),
    					ObjectType:      pulumi.String("HostSystem"),
    					Red:             pulumi.Int(9500),
    					RedInterval:     pulumi.Int(300),
    				},
    			},
    		})
    		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 hostDisconnectedWarning = new VSphere.Alarm("host_disconnected_warning", new()
        {
            Name = "Host CPU usage",
            Description = "Triggers a critical when a host CPU usage is too high",
            EntityType = "Datacenter",
            EntityId = datacenter.Id,
            MetricExpressions = new[]
            {
                new VSphere.Inputs.AlarmMetricExpressionArgs
                {
                    MetricCounterId = 2,
                    Operator = "isAbove",
                    ObjectType = "HostSystem",
                    Red = 9500,
                    RedInterval = 300,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vsphere.Alarm;
    import com.pulumi.vsphere.AlarmArgs;
    import com.pulumi.vsphere.inputs.AlarmMetricExpressionArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 hostDisconnectedWarning = new Alarm("hostDisconnectedWarning", AlarmArgs.builder()
                .name("Host CPU usage")
                .description("Triggers a critical when a host CPU usage is too high")
                .entityType("Datacenter")
                .entityId(datacenter.id())
                .metricExpressions(AlarmMetricExpressionArgs.builder()
                    .metricCounterId(2)
                    .operator("isAbove")
                    .objectType("HostSystem")
                    .red(9500)
                    .redInterval(300)
                    .build())
                .build());
    
        }
    }
    
    resources:
      hostDisconnectedWarning:
        type: vsphere:Alarm
        name: host_disconnected_warning
        properties:
          name: Host CPU usage
          description: Triggers a critical when a host CPU usage is too high
          entityType: Datacenter
          entityId: ${datacenter.id}
          metricExpressions:
            - metricCounterId: 2
              operator: isAbove
              objectType: HostSystem
              red: 9500
              redInterval: 300
    
    pulumi {
      required_providers {
        vsphere = {
          source = "pulumi/vsphere"
        }
      }
    }
    
    resource "vsphere_alarm" "host_disconnected_warning" {
      name        = "Host CPU usage"
      description = "Triggers a critical when a host CPU usage is too high"
      entity_type = "Datacenter"
      entity_id   = datacenter.id
      metric_expressions {
        metric_counter_id = 2
        operator          = "isAbove"
        object_type       = "HostSystem"
        red               = 9500
        red_interval      = 300
      }
    }
    

    Create alarm to set a host in maintenance when a lacp down event occurs, and remove the maintenance when the lacp is up again:

    import * as pulumi from "@pulumi/pulumi";
    import * as vsphere from "@pulumi/vsphere";
    
    const lacpDownOnHost = new vsphere.Alarm("lacp_down_on_host", {
        name: "LACP down on host",
        description: "Set the host is maintenance if lacp goes down",
        entityType: "Datacenter",
        entityId: datacenter.id,
        eventExpressions: [
            {
                eventTypeId: "esx.problem.net.lacp.lag.transition.down",
                objectType: "HostSystem",
                status: "red",
            },
            {
                eventTypeId: "esx.problem.net.lacp.lag.transition.up",
                objectType: "HostSystem",
                status: "green",
            },
        ],
        advancedActions: [
            {
                startState: "green",
                finalState: "red",
                name: "EnterMaintenanceMode_Task",
            },
            {
                startState: "red",
                finalState: "green",
                name: "ExitMaintenanceMode_Task",
            },
        ],
    });
    
    import pulumi
    import pulumi_vsphere as vsphere
    
    lacp_down_on_host = vsphere.Alarm("lacp_down_on_host",
        name="LACP down on host",
        description="Set the host is maintenance if lacp goes down",
        entity_type="Datacenter",
        entity_id=datacenter["id"],
        event_expressions=[
            {
                "event_type_id": "esx.problem.net.lacp.lag.transition.down",
                "object_type": "HostSystem",
                "status": "red",
            },
            {
                "event_type_id": "esx.problem.net.lacp.lag.transition.up",
                "object_type": "HostSystem",
                "status": "green",
            },
        ],
        advanced_actions=[
            {
                "start_state": "green",
                "final_state": "red",
                "name": "EnterMaintenanceMode_Task",
            },
            {
                "start_state": "red",
                "final_state": "green",
                "name": "ExitMaintenanceMode_Task",
            },
        ])
    
    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 {
    		_, err := vsphere.NewAlarm(ctx, "lacp_down_on_host", &vsphere.AlarmArgs{
    			Name:        pulumi.String("LACP down on host"),
    			Description: pulumi.String("Set the host is maintenance if lacp goes down"),
    			EntityType:  pulumi.String("Datacenter"),
    			EntityId:    pulumi.Any(datacenter.Id),
    			EventExpressions: vsphere.AlarmEventExpressionArray{
    				&vsphere.AlarmEventExpressionArgs{
    					EventTypeId: pulumi.String("esx.problem.net.lacp.lag.transition.down"),
    					ObjectType:  pulumi.String("HostSystem"),
    					Status:      pulumi.String("red"),
    				},
    				&vsphere.AlarmEventExpressionArgs{
    					EventTypeId: pulumi.String("esx.problem.net.lacp.lag.transition.up"),
    					ObjectType:  pulumi.String("HostSystem"),
    					Status:      pulumi.String("green"),
    				},
    			},
    			AdvancedActions: vsphere.AlarmAdvancedActionArray{
    				&vsphere.AlarmAdvancedActionArgs{
    					StartState: pulumi.String("green"),
    					FinalState: pulumi.String("red"),
    					Name:       pulumi.String("EnterMaintenanceMode_Task"),
    				},
    				&vsphere.AlarmAdvancedActionArgs{
    					StartState: pulumi.String("red"),
    					FinalState: pulumi.String("green"),
    					Name:       pulumi.String("ExitMaintenanceMode_Task"),
    				},
    			},
    		})
    		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 lacpDownOnHost = new VSphere.Alarm("lacp_down_on_host", new()
        {
            Name = "LACP down on host",
            Description = "Set the host is maintenance if lacp goes down",
            EntityType = "Datacenter",
            EntityId = datacenter.Id,
            EventExpressions = new[]
            {
                new VSphere.Inputs.AlarmEventExpressionArgs
                {
                    EventTypeId = "esx.problem.net.lacp.lag.transition.down",
                    ObjectType = "HostSystem",
                    Status = "red",
                },
                new VSphere.Inputs.AlarmEventExpressionArgs
                {
                    EventTypeId = "esx.problem.net.lacp.lag.transition.up",
                    ObjectType = "HostSystem",
                    Status = "green",
                },
            },
            AdvancedActions = new[]
            {
                new VSphere.Inputs.AlarmAdvancedActionArgs
                {
                    StartState = "green",
                    FinalState = "red",
                    Name = "EnterMaintenanceMode_Task",
                },
                new VSphere.Inputs.AlarmAdvancedActionArgs
                {
                    StartState = "red",
                    FinalState = "green",
                    Name = "ExitMaintenanceMode_Task",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vsphere.Alarm;
    import com.pulumi.vsphere.AlarmArgs;
    import com.pulumi.vsphere.inputs.AlarmEventExpressionArgs;
    import com.pulumi.vsphere.inputs.AlarmAdvancedActionArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 lacpDownOnHost = new Alarm("lacpDownOnHost", AlarmArgs.builder()
                .name("LACP down on host")
                .description("Set the host is maintenance if lacp goes down")
                .entityType("Datacenter")
                .entityId(datacenter.id())
                .eventExpressions(            
                    AlarmEventExpressionArgs.builder()
                        .eventTypeId("esx.problem.net.lacp.lag.transition.down")
                        .objectType("HostSystem")
                        .status("red")
                        .build(),
                    AlarmEventExpressionArgs.builder()
                        .eventTypeId("esx.problem.net.lacp.lag.transition.up")
                        .objectType("HostSystem")
                        .status("green")
                        .build())
                .advancedActions(            
                    AlarmAdvancedActionArgs.builder()
                        .startState("green")
                        .finalState("red")
                        .name("EnterMaintenanceMode_Task")
                        .build(),
                    AlarmAdvancedActionArgs.builder()
                        .startState("red")
                        .finalState("green")
                        .name("ExitMaintenanceMode_Task")
                        .build())
                .build());
    
        }
    }
    
    resources:
      lacpDownOnHost:
        type: vsphere:Alarm
        name: lacp_down_on_host
        properties:
          name: LACP down on host
          description: Set the host is maintenance if lacp goes down
          entityType: Datacenter
          entityId: ${datacenter.id}
          eventExpressions:
            - eventTypeId: esx.problem.net.lacp.lag.transition.down
              objectType: HostSystem
              status: red
            - eventTypeId: esx.problem.net.lacp.lag.transition.up
              objectType: HostSystem
              status: green
          advancedActions:
            - startState: green
              finalState: red
              name: EnterMaintenanceMode_Task
            - startState: red
              finalState: green
              name: ExitMaintenanceMode_Task
    
    pulumi {
      required_providers {
        vsphere = {
          source = "pulumi/vsphere"
        }
      }
    }
    
    resource "vsphere_alarm" "lacp_down_on_host" {
      name        = "LACP down on host"
      description = "Set the host is maintenance if lacp goes down"
      entity_type = "Datacenter"
      entity_id   = datacenter.id
      event_expressions {
        event_type_id = "esx.problem.net.lacp.lag.transition.down"
        object_type   = "HostSystem"
        status        = "red"
      }
      event_expressions {
        event_type_id = "esx.problem.net.lacp.lag.transition.up"
        object_type   = "HostSystem"
        status        = "green"
      }
      advanced_actions {
        start_state = "green"
        final_state = "red"
        name        = "EnterMaintenanceMode_Task"
      }
      advanced_actions {
        start_state = "red"
        final_state = "green"
        name        = "ExitMaintenanceMode_Task"
      }
    }
    

    Create Alarm Resource

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

    Constructor syntax

    new Alarm(name: string, args: AlarmArgs, opts?: CustomResourceOptions);
    @overload
    def Alarm(resource_name: str,
              args: AlarmArgs,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Alarm(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              description: Optional[str] = None,
              entity_id: Optional[str] = None,
              entity_type: Optional[str] = None,
              advanced_actions: Optional[Sequence[AlarmAdvancedActionArgs]] = None,
              email_actions: Optional[Sequence[AlarmEmailActionArgs]] = None,
              enabled: Optional[bool] = None,
              event_expressions: Optional[Sequence[AlarmEventExpressionArgs]] = None,
              expression_operator: Optional[str] = None,
              metric_expressions: Optional[Sequence[AlarmMetricExpressionArgs]] = None,
              name: Optional[str] = None,
              snmp_actions: Optional[Sequence[AlarmSnmpActionArgs]] = None,
              state_expressions: Optional[Sequence[AlarmStateExpressionArgs]] = None)
    func NewAlarm(ctx *Context, name string, args AlarmArgs, opts ...ResourceOption) (*Alarm, error)
    public Alarm(string name, AlarmArgs args, CustomResourceOptions? opts = null)
    public Alarm(String name, AlarmArgs args)
    public Alarm(String name, AlarmArgs args, CustomResourceOptions options)
    
    type: vsphere:Alarm
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "vsphere_alarm" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args AlarmArgs
    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 AlarmArgs
    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 AlarmArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AlarmArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AlarmArgs
    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 alarmResource = new VSphere.Alarm("alarmResource", new()
    {
        Description = "string",
        EntityId = "string",
        EntityType = "string",
        AdvancedActions = new[]
        {
            new VSphere.Inputs.AlarmAdvancedActionArgs
            {
                FinalState = "string",
                StartState = "string",
                Name = "string",
                Repeat = false,
            },
        },
        EmailActions = new[]
        {
            new VSphere.Inputs.AlarmEmailActionArgs
            {
                FinalState = "string",
                StartState = "string",
                Body = "string",
                Cc = "string",
                Repeat = false,
                Subject = "string",
                To = "string",
            },
        },
        Enabled = false,
        EventExpressions = new[]
        {
            new VSphere.Inputs.AlarmEventExpressionArgs
            {
                EventTypeId = "string",
                ObjectType = "string",
                Status = "string",
                Comparisons = new[]
                {
                    new VSphere.Inputs.AlarmEventExpressionComparisonArgs
                    {
                        AttributeName = "string",
                        Operator = "string",
                        Value = "string",
                    },
                },
                EventType = "string",
            },
        },
        ExpressionOperator = "string",
        MetricExpressions = new[]
        {
            new VSphere.Inputs.AlarmMetricExpressionArgs
            {
                MetricCounterId = 0,
                ObjectType = "string",
                Operator = "string",
                MetricInstance = "string",
                Red = 0,
                RedInterval = 0,
                Yellow = 0,
                YellowInterval = 0,
            },
        },
        Name = "string",
        SnmpActions = new[]
        {
            new VSphere.Inputs.AlarmSnmpActionArgs
            {
                FinalState = "string",
                StartState = "string",
                Repeat = false,
            },
        },
        StateExpressions = new[]
        {
            new VSphere.Inputs.AlarmStateExpressionArgs
            {
                ObjectType = "string",
                Operator = "string",
                StatePath = "string",
                Red = "string",
                Yellow = "string",
            },
        },
    });
    
    example, err := vsphere.NewAlarm(ctx, "alarmResource", &vsphere.AlarmArgs{
    	Description: pulumi.String("string"),
    	EntityId:    pulumi.String("string"),
    	EntityType:  pulumi.String("string"),
    	AdvancedActions: vsphere.AlarmAdvancedActionArray{
    		&vsphere.AlarmAdvancedActionArgs{
    			FinalState: pulumi.String("string"),
    			StartState: pulumi.String("string"),
    			Name:       pulumi.String("string"),
    			Repeat:     pulumi.Bool(false),
    		},
    	},
    	EmailActions: vsphere.AlarmEmailActionArray{
    		&vsphere.AlarmEmailActionArgs{
    			FinalState: pulumi.String("string"),
    			StartState: pulumi.String("string"),
    			Body:       pulumi.String("string"),
    			Cc:         pulumi.String("string"),
    			Repeat:     pulumi.Bool(false),
    			Subject:    pulumi.String("string"),
    			To:         pulumi.String("string"),
    		},
    	},
    	Enabled: pulumi.Bool(false),
    	EventExpressions: vsphere.AlarmEventExpressionArray{
    		&vsphere.AlarmEventExpressionArgs{
    			EventTypeId: pulumi.String("string"),
    			ObjectType:  pulumi.String("string"),
    			Status:      pulumi.String("string"),
    			Comparisons: vsphere.AlarmEventExpressionComparisonArray{
    				&vsphere.AlarmEventExpressionComparisonArgs{
    					AttributeName: pulumi.String("string"),
    					Operator:      pulumi.String("string"),
    					Value:         pulumi.String("string"),
    				},
    			},
    			EventType: pulumi.String("string"),
    		},
    	},
    	ExpressionOperator: pulumi.String("string"),
    	MetricExpressions: vsphere.AlarmMetricExpressionArray{
    		&vsphere.AlarmMetricExpressionArgs{
    			MetricCounterId: pulumi.Int(0),
    			ObjectType:      pulumi.String("string"),
    			Operator:        pulumi.String("string"),
    			MetricInstance:  pulumi.String("string"),
    			Red:             pulumi.Int(0),
    			RedInterval:     pulumi.Int(0),
    			Yellow:          pulumi.Int(0),
    			YellowInterval:  pulumi.Int(0),
    		},
    	},
    	Name: pulumi.String("string"),
    	SnmpActions: vsphere.AlarmSnmpActionArray{
    		&vsphere.AlarmSnmpActionArgs{
    			FinalState: pulumi.String("string"),
    			StartState: pulumi.String("string"),
    			Repeat:     pulumi.Bool(false),
    		},
    	},
    	StateExpressions: vsphere.AlarmStateExpressionArray{
    		&vsphere.AlarmStateExpressionArgs{
    			ObjectType: pulumi.String("string"),
    			Operator:   pulumi.String("string"),
    			StatePath:  pulumi.String("string"),
    			Red:        pulumi.String("string"),
    			Yellow:     pulumi.String("string"),
    		},
    	},
    })
    
    resource "vsphere_alarm" "alarmResource" {
      description = "string"
      entity_id   = "string"
      entity_type = "string"
      advanced_actions {
        final_state = "string"
        start_state = "string"
        name        = "string"
        repeat      = false
      }
      email_actions {
        final_state = "string"
        start_state = "string"
        body        = "string"
        cc          = "string"
        repeat      = false
        subject     = "string"
        to          = "string"
      }
      enabled = false
      event_expressions {
        event_type_id = "string"
        object_type   = "string"
        status        = "string"
        comparisons {
          attribute_name = "string"
          operator       = "string"
          value          = "string"
        }
        event_type = "string"
      }
      expression_operator = "string"
      metric_expressions {
        metric_counter_id = 0
        object_type       = "string"
        operator          = "string"
        metric_instance   = "string"
        red               = 0
        red_interval      = 0
        yellow            = 0
        yellow_interval   = 0
      }
      name = "string"
      snmp_actions {
        final_state = "string"
        start_state = "string"
        repeat      = false
      }
      state_expressions {
        object_type = "string"
        operator    = "string"
        state_path  = "string"
        red         = "string"
        yellow      = "string"
      }
    }
    
    var alarmResource = new Alarm("alarmResource", AlarmArgs.builder()
        .description("string")
        .entityId("string")
        .entityType("string")
        .advancedActions(AlarmAdvancedActionArgs.builder()
            .finalState("string")
            .startState("string")
            .name("string")
            .repeat(false)
            .build())
        .emailActions(AlarmEmailActionArgs.builder()
            .finalState("string")
            .startState("string")
            .body("string")
            .cc("string")
            .repeat(false)
            .subject("string")
            .to("string")
            .build())
        .enabled(false)
        .eventExpressions(AlarmEventExpressionArgs.builder()
            .eventTypeId("string")
            .objectType("string")
            .status("string")
            .comparisons(AlarmEventExpressionComparisonArgs.builder()
                .attributeName("string")
                .operator("string")
                .value("string")
                .build())
            .eventType("string")
            .build())
        .expressionOperator("string")
        .metricExpressions(AlarmMetricExpressionArgs.builder()
            .metricCounterId(0)
            .objectType("string")
            .operator("string")
            .metricInstance("string")
            .red(0)
            .redInterval(0)
            .yellow(0)
            .yellowInterval(0)
            .build())
        .name("string")
        .snmpActions(AlarmSnmpActionArgs.builder()
            .finalState("string")
            .startState("string")
            .repeat(false)
            .build())
        .stateExpressions(AlarmStateExpressionArgs.builder()
            .objectType("string")
            .operator("string")
            .statePath("string")
            .red("string")
            .yellow("string")
            .build())
        .build());
    
    alarm_resource = vsphere.Alarm("alarmResource",
        description="string",
        entity_id="string",
        entity_type="string",
        advanced_actions=[{
            "final_state": "string",
            "start_state": "string",
            "name": "string",
            "repeat": False,
        }],
        email_actions=[{
            "final_state": "string",
            "start_state": "string",
            "body": "string",
            "cc": "string",
            "repeat": False,
            "subject": "string",
            "to": "string",
        }],
        enabled=False,
        event_expressions=[{
            "event_type_id": "string",
            "object_type": "string",
            "status": "string",
            "comparisons": [{
                "attribute_name": "string",
                "operator": "string",
                "value": "string",
            }],
            "event_type": "string",
        }],
        expression_operator="string",
        metric_expressions=[{
            "metric_counter_id": 0,
            "object_type": "string",
            "operator": "string",
            "metric_instance": "string",
            "red": 0,
            "red_interval": 0,
            "yellow": 0,
            "yellow_interval": 0,
        }],
        name="string",
        snmp_actions=[{
            "final_state": "string",
            "start_state": "string",
            "repeat": False,
        }],
        state_expressions=[{
            "object_type": "string",
            "operator": "string",
            "state_path": "string",
            "red": "string",
            "yellow": "string",
        }])
    
    const alarmResource = new vsphere.Alarm("alarmResource", {
        description: "string",
        entityId: "string",
        entityType: "string",
        advancedActions: [{
            finalState: "string",
            startState: "string",
            name: "string",
            repeat: false,
        }],
        emailActions: [{
            finalState: "string",
            startState: "string",
            body: "string",
            cc: "string",
            repeat: false,
            subject: "string",
            to: "string",
        }],
        enabled: false,
        eventExpressions: [{
            eventTypeId: "string",
            objectType: "string",
            status: "string",
            comparisons: [{
                attributeName: "string",
                operator: "string",
                value: "string",
            }],
            eventType: "string",
        }],
        expressionOperator: "string",
        metricExpressions: [{
            metricCounterId: 0,
            objectType: "string",
            operator: "string",
            metricInstance: "string",
            red: 0,
            redInterval: 0,
            yellow: 0,
            yellowInterval: 0,
        }],
        name: "string",
        snmpActions: [{
            finalState: "string",
            startState: "string",
            repeat: false,
        }],
        stateExpressions: [{
            objectType: "string",
            operator: "string",
            statePath: "string",
            red: "string",
            yellow: "string",
        }],
    });
    
    type: vsphere:Alarm
    properties:
        advancedActions:
            - finalState: string
              name: string
              repeat: false
              startState: string
        description: string
        emailActions:
            - body: string
              cc: string
              finalState: string
              repeat: false
              startState: string
              subject: string
              to: string
        enabled: false
        entityId: string
        entityType: string
        eventExpressions:
            - comparisons:
                - attributeName: string
                  operator: string
                  value: string
              eventType: string
              eventTypeId: string
              objectType: string
              status: string
        expressionOperator: string
        metricExpressions:
            - metricCounterId: 0
              metricInstance: string
              objectType: string
              operator: string
              red: 0
              redInterval: 0
              yellow: 0
              yellowInterval: 0
        name: string
        snmpActions:
            - finalState: string
              repeat: false
              startState: string
        stateExpressions:
            - objectType: string
              operator: string
              red: string
              statePath: string
              yellow: string
    

    Alarm 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 Alarm resource accepts the following input properties:

    Description string
    The alarm description.
    EntityId string
    The [managed object reference ID][docs-about-morefs] of the entity the alarm will be created in.
    EntityType string
    The type of the entity the alarm will be created in.
    AdvancedActions List<Pulumi.VSphere.Inputs.AlarmAdvancedAction>
    Advanced alarm action to trigger depending on the alarm state, such as entering maintenance mode.
    EmailActions List<Pulumi.VSphere.Inputs.AlarmEmailAction>
    Email alarm action to trigger depending on the alarm state.
    Enabled bool
    Whether or not the alarm is enabled.
    EventExpressions List<Pulumi.VSphere.Inputs.AlarmEventExpression>
    Alarm trigger expressions based on events.
    ExpressionOperator string
    The logical link between expressions.
    MetricExpressions List<Pulumi.VSphere.Inputs.AlarmMetricExpression>
    Alarm trigger expressions based on metric values.
    Name string
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    SnmpActions List<Pulumi.VSphere.Inputs.AlarmSnmpAction>
    Snmp alarm action to trigger depending on the alarm state.
    StateExpressions List<Pulumi.VSphere.Inputs.AlarmStateExpression>
    Alarm trigger expressions based on object state changes.
    Description string
    The alarm description.
    EntityId string
    The [managed object reference ID][docs-about-morefs] of the entity the alarm will be created in.
    EntityType string
    The type of the entity the alarm will be created in.
    AdvancedActions []AlarmAdvancedActionArgs
    Advanced alarm action to trigger depending on the alarm state, such as entering maintenance mode.
    EmailActions []AlarmEmailActionArgs
    Email alarm action to trigger depending on the alarm state.
    Enabled bool
    Whether or not the alarm is enabled.
    EventExpressions []AlarmEventExpressionArgs
    Alarm trigger expressions based on events.
    ExpressionOperator string
    The logical link between expressions.
    MetricExpressions []AlarmMetricExpressionArgs
    Alarm trigger expressions based on metric values.
    Name string
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    SnmpActions []AlarmSnmpActionArgs
    Snmp alarm action to trigger depending on the alarm state.
    StateExpressions []AlarmStateExpressionArgs
    Alarm trigger expressions based on object state changes.
    description string
    The alarm description.
    entity_id string
    The [managed object reference ID][docs-about-morefs] of the entity the alarm will be created in.
    entity_type string
    The type of the entity the alarm will be created in.
    advanced_actions list(object)
    Advanced alarm action to trigger depending on the alarm state, such as entering maintenance mode.
    email_actions list(object)
    Email alarm action to trigger depending on the alarm state.
    enabled bool
    Whether or not the alarm is enabled.
    event_expressions list(object)
    Alarm trigger expressions based on events.
    expression_operator string
    The logical link between expressions.
    metric_expressions list(object)
    Alarm trigger expressions based on metric values.
    name string
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    snmp_actions list(object)
    Snmp alarm action to trigger depending on the alarm state.
    state_expressions list(object)
    Alarm trigger expressions based on object state changes.
    description String
    The alarm description.
    entityId String
    The [managed object reference ID][docs-about-morefs] of the entity the alarm will be created in.
    entityType String
    The type of the entity the alarm will be created in.
    advancedActions List<AlarmAdvancedAction>
    Advanced alarm action to trigger depending on the alarm state, such as entering maintenance mode.
    emailActions List<AlarmEmailAction>
    Email alarm action to trigger depending on the alarm state.
    enabled Boolean
    Whether or not the alarm is enabled.
    eventExpressions List<AlarmEventExpression>
    Alarm trigger expressions based on events.
    expressionOperator String
    The logical link between expressions.
    metricExpressions List<AlarmMetricExpression>
    Alarm trigger expressions based on metric values.
    name String
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    snmpActions List<AlarmSnmpAction>
    Snmp alarm action to trigger depending on the alarm state.
    stateExpressions List<AlarmStateExpression>
    Alarm trigger expressions based on object state changes.
    description string
    The alarm description.
    entityId string
    The [managed object reference ID][docs-about-morefs] of the entity the alarm will be created in.
    entityType string
    The type of the entity the alarm will be created in.
    advancedActions AlarmAdvancedAction[]
    Advanced alarm action to trigger depending on the alarm state, such as entering maintenance mode.
    emailActions AlarmEmailAction[]
    Email alarm action to trigger depending on the alarm state.
    enabled boolean
    Whether or not the alarm is enabled.
    eventExpressions AlarmEventExpression[]
    Alarm trigger expressions based on events.
    expressionOperator string
    The logical link between expressions.
    metricExpressions AlarmMetricExpression[]
    Alarm trigger expressions based on metric values.
    name string
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    snmpActions AlarmSnmpAction[]
    Snmp alarm action to trigger depending on the alarm state.
    stateExpressions AlarmStateExpression[]
    Alarm trigger expressions based on object state changes.
    description str
    The alarm description.
    entity_id str
    The [managed object reference ID][docs-about-morefs] of the entity the alarm will be created in.
    entity_type str
    The type of the entity the alarm will be created in.
    advanced_actions Sequence[AlarmAdvancedActionArgs]
    Advanced alarm action to trigger depending on the alarm state, such as entering maintenance mode.
    email_actions Sequence[AlarmEmailActionArgs]
    Email alarm action to trigger depending on the alarm state.
    enabled bool
    Whether or not the alarm is enabled.
    event_expressions Sequence[AlarmEventExpressionArgs]
    Alarm trigger expressions based on events.
    expression_operator str
    The logical link between expressions.
    metric_expressions Sequence[AlarmMetricExpressionArgs]
    Alarm trigger expressions based on metric values.
    name str
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    snmp_actions Sequence[AlarmSnmpActionArgs]
    Snmp alarm action to trigger depending on the alarm state.
    state_expressions Sequence[AlarmStateExpressionArgs]
    Alarm trigger expressions based on object state changes.
    description String
    The alarm description.
    entityId String
    The [managed object reference ID][docs-about-morefs] of the entity the alarm will be created in.
    entityType String
    The type of the entity the alarm will be created in.
    advancedActions List<Property Map>
    Advanced alarm action to trigger depending on the alarm state, such as entering maintenance mode.
    emailActions List<Property Map>
    Email alarm action to trigger depending on the alarm state.
    enabled Boolean
    Whether or not the alarm is enabled.
    eventExpressions List<Property Map>
    Alarm trigger expressions based on events.
    expressionOperator String
    The logical link between expressions.
    metricExpressions List<Property Map>
    Alarm trigger expressions based on metric values.
    name String
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    snmpActions List<Property Map>
    Snmp alarm action to trigger depending on the alarm state.
    stateExpressions List<Property Map>
    Alarm trigger expressions based on object state changes.

    Outputs

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

    Get an existing Alarm 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?: AlarmState, opts?: CustomResourceOptions): Alarm
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            advanced_actions: Optional[Sequence[AlarmAdvancedActionArgs]] = None,
            description: Optional[str] = None,
            email_actions: Optional[Sequence[AlarmEmailActionArgs]] = None,
            enabled: Optional[bool] = None,
            entity_id: Optional[str] = None,
            entity_type: Optional[str] = None,
            event_expressions: Optional[Sequence[AlarmEventExpressionArgs]] = None,
            expression_operator: Optional[str] = None,
            metric_expressions: Optional[Sequence[AlarmMetricExpressionArgs]] = None,
            name: Optional[str] = None,
            snmp_actions: Optional[Sequence[AlarmSnmpActionArgs]] = None,
            state_expressions: Optional[Sequence[AlarmStateExpressionArgs]] = None) -> Alarm
    func GetAlarm(ctx *Context, name string, id IDInput, state *AlarmState, opts ...ResourceOption) (*Alarm, error)
    public static Alarm Get(string name, Input<string> id, AlarmState? state, CustomResourceOptions? opts = null)
    public static Alarm get(String name, Output<String> id, AlarmState state, CustomResourceOptions options)
    resources:  _:    type: vsphere:Alarm    get:      id: ${id}
    import {
      to = vsphere_alarm.example
      id = "${id}"
    }
    
    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.
    The following state arguments are supported:
    AdvancedActions List<Pulumi.VSphere.Inputs.AlarmAdvancedAction>
    Advanced alarm action to trigger depending on the alarm state, such as entering maintenance mode.
    Description string
    The alarm description.
    EmailActions List<Pulumi.VSphere.Inputs.AlarmEmailAction>
    Email alarm action to trigger depending on the alarm state.
    Enabled bool
    Whether or not the alarm is enabled.
    EntityId string
    The [managed object reference ID][docs-about-morefs] of the entity the alarm will be created in.
    EntityType string
    The type of the entity the alarm will be created in.
    EventExpressions List<Pulumi.VSphere.Inputs.AlarmEventExpression>
    Alarm trigger expressions based on events.
    ExpressionOperator string
    The logical link between expressions.
    MetricExpressions List<Pulumi.VSphere.Inputs.AlarmMetricExpression>
    Alarm trigger expressions based on metric values.
    Name string
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    SnmpActions List<Pulumi.VSphere.Inputs.AlarmSnmpAction>
    Snmp alarm action to trigger depending on the alarm state.
    StateExpressions List<Pulumi.VSphere.Inputs.AlarmStateExpression>
    Alarm trigger expressions based on object state changes.
    AdvancedActions []AlarmAdvancedActionArgs
    Advanced alarm action to trigger depending on the alarm state, such as entering maintenance mode.
    Description string
    The alarm description.
    EmailActions []AlarmEmailActionArgs
    Email alarm action to trigger depending on the alarm state.
    Enabled bool
    Whether or not the alarm is enabled.
    EntityId string
    The [managed object reference ID][docs-about-morefs] of the entity the alarm will be created in.
    EntityType string
    The type of the entity the alarm will be created in.
    EventExpressions []AlarmEventExpressionArgs
    Alarm trigger expressions based on events.
    ExpressionOperator string
    The logical link between expressions.
    MetricExpressions []AlarmMetricExpressionArgs
    Alarm trigger expressions based on metric values.
    Name string
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    SnmpActions []AlarmSnmpActionArgs
    Snmp alarm action to trigger depending on the alarm state.
    StateExpressions []AlarmStateExpressionArgs
    Alarm trigger expressions based on object state changes.
    advanced_actions list(object)
    Advanced alarm action to trigger depending on the alarm state, such as entering maintenance mode.
    description string
    The alarm description.
    email_actions list(object)
    Email alarm action to trigger depending on the alarm state.
    enabled bool
    Whether or not the alarm is enabled.
    entity_id string
    The [managed object reference ID][docs-about-morefs] of the entity the alarm will be created in.
    entity_type string
    The type of the entity the alarm will be created in.
    event_expressions list(object)
    Alarm trigger expressions based on events.
    expression_operator string
    The logical link between expressions.
    metric_expressions list(object)
    Alarm trigger expressions based on metric values.
    name string
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    snmp_actions list(object)
    Snmp alarm action to trigger depending on the alarm state.
    state_expressions list(object)
    Alarm trigger expressions based on object state changes.
    advancedActions List<AlarmAdvancedAction>
    Advanced alarm action to trigger depending on the alarm state, such as entering maintenance mode.
    description String
    The alarm description.
    emailActions List<AlarmEmailAction>
    Email alarm action to trigger depending on the alarm state.
    enabled Boolean
    Whether or not the alarm is enabled.
    entityId String
    The [managed object reference ID][docs-about-morefs] of the entity the alarm will be created in.
    entityType String
    The type of the entity the alarm will be created in.
    eventExpressions List<AlarmEventExpression>
    Alarm trigger expressions based on events.
    expressionOperator String
    The logical link between expressions.
    metricExpressions List<AlarmMetricExpression>
    Alarm trigger expressions based on metric values.
    name String
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    snmpActions List<AlarmSnmpAction>
    Snmp alarm action to trigger depending on the alarm state.
    stateExpressions List<AlarmStateExpression>
    Alarm trigger expressions based on object state changes.
    advancedActions AlarmAdvancedAction[]
    Advanced alarm action to trigger depending on the alarm state, such as entering maintenance mode.
    description string
    The alarm description.
    emailActions AlarmEmailAction[]
    Email alarm action to trigger depending on the alarm state.
    enabled boolean
    Whether or not the alarm is enabled.
    entityId string
    The [managed object reference ID][docs-about-morefs] of the entity the alarm will be created in.
    entityType string
    The type of the entity the alarm will be created in.
    eventExpressions AlarmEventExpression[]
    Alarm trigger expressions based on events.
    expressionOperator string
    The logical link between expressions.
    metricExpressions AlarmMetricExpression[]
    Alarm trigger expressions based on metric values.
    name string
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    snmpActions AlarmSnmpAction[]
    Snmp alarm action to trigger depending on the alarm state.
    stateExpressions AlarmStateExpression[]
    Alarm trigger expressions based on object state changes.
    advanced_actions Sequence[AlarmAdvancedActionArgs]
    Advanced alarm action to trigger depending on the alarm state, such as entering maintenance mode.
    description str
    The alarm description.
    email_actions Sequence[AlarmEmailActionArgs]
    Email alarm action to trigger depending on the alarm state.
    enabled bool
    Whether or not the alarm is enabled.
    entity_id str
    The [managed object reference ID][docs-about-morefs] of the entity the alarm will be created in.
    entity_type str
    The type of the entity the alarm will be created in.
    event_expressions Sequence[AlarmEventExpressionArgs]
    Alarm trigger expressions based on events.
    expression_operator str
    The logical link between expressions.
    metric_expressions Sequence[AlarmMetricExpressionArgs]
    Alarm trigger expressions based on metric values.
    name str
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    snmp_actions Sequence[AlarmSnmpActionArgs]
    Snmp alarm action to trigger depending on the alarm state.
    state_expressions Sequence[AlarmStateExpressionArgs]
    Alarm trigger expressions based on object state changes.
    advancedActions List<Property Map>
    Advanced alarm action to trigger depending on the alarm state, such as entering maintenance mode.
    description String
    The alarm description.
    emailActions List<Property Map>
    Email alarm action to trigger depending on the alarm state.
    enabled Boolean
    Whether or not the alarm is enabled.
    entityId String
    The [managed object reference ID][docs-about-morefs] of the entity the alarm will be created in.
    entityType String
    The type of the entity the alarm will be created in.
    eventExpressions List<Property Map>
    Alarm trigger expressions based on events.
    expressionOperator String
    The logical link between expressions.
    metricExpressions List<Property Map>
    Alarm trigger expressions based on metric values.
    name String
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    snmpActions List<Property Map>
    Snmp alarm action to trigger depending on the alarm state.
    stateExpressions List<Property Map>
    Alarm trigger expressions based on object state changes.

    Supporting Types

    AlarmAdvancedAction, AlarmAdvancedActionArgs

    FinalState string
    Triggers the action only for this final state.
    StartState string
    Triggers the action only for this initial state.
    Name string
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    Repeat bool
    Whether or not the action should be repeated.
    FinalState string
    Triggers the action only for this final state.
    StartState string
    Triggers the action only for this initial state.
    Name string
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    Repeat bool
    Whether or not the action should be repeated.
    final_state string
    Triggers the action only for this final state.
    start_state string
    Triggers the action only for this initial state.
    name string
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    repeat bool
    Whether or not the action should be repeated.
    finalState String
    Triggers the action only for this final state.
    startState String
    Triggers the action only for this initial state.
    name String
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    repeat Boolean
    Whether or not the action should be repeated.
    finalState string
    Triggers the action only for this final state.
    startState string
    Triggers the action only for this initial state.
    name string
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    repeat boolean
    Whether or not the action should be repeated.
    final_state str
    Triggers the action only for this final state.
    start_state str
    Triggers the action only for this initial state.
    name str
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    repeat bool
    Whether or not the action should be repeated.
    finalState String
    Triggers the action only for this final state.
    startState String
    Triggers the action only for this initial state.
    name String
    The name of the alarm. This name needs to be unique within the vCenter. Forces a new resource if changed.
    repeat Boolean
    Whether or not the action should be repeated.

    AlarmEmailAction, AlarmEmailActionArgs

    FinalState string
    Triggers the action only for this final state.
    StartState string
    Triggers the action only for this initial state.
    Body string
    Email body.
    Cc string
    Email destination cc.
    Repeat bool
    Whether or not the action should be repeated.
    Subject string
    Email subject.
    To string
    Email destination.
    FinalState string
    Triggers the action only for this final state.
    StartState string
    Triggers the action only for this initial state.
    Body string
    Email body.
    Cc string
    Email destination cc.
    Repeat bool
    Whether or not the action should be repeated.
    Subject string
    Email subject.
    To string
    Email destination.
    final_state string
    Triggers the action only for this final state.
    start_state string
    Triggers the action only for this initial state.
    body string
    Email body.
    cc string
    Email destination cc.
    repeat bool
    Whether or not the action should be repeated.
    subject string
    Email subject.
    to string
    Email destination.
    finalState String
    Triggers the action only for this final state.
    startState String
    Triggers the action only for this initial state.
    body String
    Email body.
    cc String
    Email destination cc.
    repeat Boolean
    Whether or not the action should be repeated.
    subject String
    Email subject.
    to String
    Email destination.
    finalState string
    Triggers the action only for this final state.
    startState string
    Triggers the action only for this initial state.
    body string
    Email body.
    cc string
    Email destination cc.
    repeat boolean
    Whether or not the action should be repeated.
    subject string
    Email subject.
    to string
    Email destination.
    final_state str
    Triggers the action only for this final state.
    start_state str
    Triggers the action only for this initial state.
    body str
    Email body.
    cc str
    Email destination cc.
    repeat bool
    Whether or not the action should be repeated.
    subject str
    Email subject.
    to str
    Email destination.
    finalState String
    Triggers the action only for this final state.
    startState String
    Triggers the action only for this initial state.
    body String
    Email body.
    cc String
    Email destination cc.
    repeat Boolean
    Whether or not the action should be repeated.
    subject String
    Email subject.
    to String
    Email destination.

    AlarmEventExpression, AlarmEventExpressionArgs

    EventTypeId string
    Name of the event (vim.event).
    ObjectType string
    Type of object where the event applies on.
    Status string
    Alarm status once triggered.
    Comparisons List<Pulumi.VSphere.Inputs.AlarmEventExpressionComparison>
    Additional check that allows adding threshold on the given object attribute.
    EventType string
    Type of Event (vim.event.Event).
    EventTypeId string
    Name of the event (vim.event).
    ObjectType string
    Type of object where the event applies on.
    Status string
    Alarm status once triggered.
    Comparisons []AlarmEventExpressionComparison
    Additional check that allows adding threshold on the given object attribute.
    EventType string
    Type of Event (vim.event.Event).
    event_type_id string
    Name of the event (vim.event).
    object_type string
    Type of object where the event applies on.
    status string
    Alarm status once triggered.
    comparisons list(object)
    Additional check that allows adding threshold on the given object attribute.
    event_type string
    Type of Event (vim.event.Event).
    eventTypeId String
    Name of the event (vim.event).
    objectType String
    Type of object where the event applies on.
    status String
    Alarm status once triggered.
    comparisons List<AlarmEventExpressionComparison>
    Additional check that allows adding threshold on the given object attribute.
    eventType String
    Type of Event (vim.event.Event).
    eventTypeId string
    Name of the event (vim.event).
    objectType string
    Type of object where the event applies on.
    status string
    Alarm status once triggered.
    comparisons AlarmEventExpressionComparison[]
    Additional check that allows adding threshold on the given object attribute.
    eventType string
    Type of Event (vim.event.Event).
    event_type_id str
    Name of the event (vim.event).
    object_type str
    Type of object where the event applies on.
    status str
    Alarm status once triggered.
    comparisons Sequence[AlarmEventExpressionComparison]
    Additional check that allows adding threshold on the given object attribute.
    event_type str
    Type of Event (vim.event.Event).
    eventTypeId String
    Name of the event (vim.event).
    objectType String
    Type of object where the event applies on.
    status String
    Alarm status once triggered.
    comparisons List<Property Map>
    Additional check that allows adding threshold on the given object attribute.
    eventType String
    Type of Event (vim.event.Event).

    AlarmEventExpressionComparison, AlarmEventExpressionComparisonArgs

    AttributeName string
    Name of the attribute to compare.
    Operator string
    Comparison operator.
    Value string
    Value to compare.
    AttributeName string
    Name of the attribute to compare.
    Operator string
    Comparison operator.
    Value string
    Value to compare.
    attribute_name string
    Name of the attribute to compare.
    operator string
    Comparison operator.
    value string
    Value to compare.
    attributeName String
    Name of the attribute to compare.
    operator String
    Comparison operator.
    value String
    Value to compare.
    attributeName string
    Name of the attribute to compare.
    operator string
    Comparison operator.
    value string
    Value to compare.
    attribute_name str
    Name of the attribute to compare.
    operator str
    Comparison operator.
    value str
    Value to compare.
    attributeName String
    Name of the attribute to compare.
    operator String
    Comparison operator.
    value String
    Value to compare.

    AlarmMetricExpression, AlarmMetricExpressionArgs

    MetricCounterId int
    ID of the metric.
    ObjectType string
    Type of object of the metric, ie: HostSystem.
    Operator string
    Whether the metric is below or above the given threshold.
    MetricInstance string
    Red int
    Critical threshold, for percentage, 9900 is 99%.
    RedInterval int
    Amount of seconds the threshold must be crossed to trigger the critical alarm.
    Yellow int
    Warning threshold, for percentage, 9900 is 99%.
    YellowInterval int
    Amount of seconds the threshold must be crossed to trigger the warning alarm.
    MetricCounterId int
    ID of the metric.
    ObjectType string
    Type of object of the metric, ie: HostSystem.
    Operator string
    Whether the metric is below or above the given threshold.
    MetricInstance string
    Red int
    Critical threshold, for percentage, 9900 is 99%.
    RedInterval int
    Amount of seconds the threshold must be crossed to trigger the critical alarm.
    Yellow int
    Warning threshold, for percentage, 9900 is 99%.
    YellowInterval int
    Amount of seconds the threshold must be crossed to trigger the warning alarm.
    metric_counter_id number
    ID of the metric.
    object_type string
    Type of object of the metric, ie: HostSystem.
    operator string
    Whether the metric is below or above the given threshold.
    metric_instance string
    red number
    Critical threshold, for percentage, 9900 is 99%.
    red_interval number
    Amount of seconds the threshold must be crossed to trigger the critical alarm.
    yellow number
    Warning threshold, for percentage, 9900 is 99%.
    yellow_interval number
    Amount of seconds the threshold must be crossed to trigger the warning alarm.
    metricCounterId Integer
    ID of the metric.
    objectType String
    Type of object of the metric, ie: HostSystem.
    operator String
    Whether the metric is below or above the given threshold.
    metricInstance String
    red Integer
    Critical threshold, for percentage, 9900 is 99%.
    redInterval Integer
    Amount of seconds the threshold must be crossed to trigger the critical alarm.
    yellow Integer
    Warning threshold, for percentage, 9900 is 99%.
    yellowInterval Integer
    Amount of seconds the threshold must be crossed to trigger the warning alarm.
    metricCounterId number
    ID of the metric.
    objectType string
    Type of object of the metric, ie: HostSystem.
    operator string
    Whether the metric is below or above the given threshold.
    metricInstance string
    red number
    Critical threshold, for percentage, 9900 is 99%.
    redInterval number
    Amount of seconds the threshold must be crossed to trigger the critical alarm.
    yellow number
    Warning threshold, for percentage, 9900 is 99%.
    yellowInterval number
    Amount of seconds the threshold must be crossed to trigger the warning alarm.
    metric_counter_id int
    ID of the metric.
    object_type str
    Type of object of the metric, ie: HostSystem.
    operator str
    Whether the metric is below or above the given threshold.
    metric_instance str
    red int
    Critical threshold, for percentage, 9900 is 99%.
    red_interval int
    Amount of seconds the threshold must be crossed to trigger the critical alarm.
    yellow int
    Warning threshold, for percentage, 9900 is 99%.
    yellow_interval int
    Amount of seconds the threshold must be crossed to trigger the warning alarm.
    metricCounterId Number
    ID of the metric.
    objectType String
    Type of object of the metric, ie: HostSystem.
    operator String
    Whether the metric is below or above the given threshold.
    metricInstance String
    red Number
    Critical threshold, for percentage, 9900 is 99%.
    redInterval Number
    Amount of seconds the threshold must be crossed to trigger the critical alarm.
    yellow Number
    Warning threshold, for percentage, 9900 is 99%.
    yellowInterval Number
    Amount of seconds the threshold must be crossed to trigger the warning alarm.

    AlarmSnmpAction, AlarmSnmpActionArgs

    FinalState string
    Triggers the action only for this final state.
    StartState string
    Triggers the action only for this initial state.
    Repeat bool
    Whether or not the action should be repeated.
    FinalState string
    Triggers the action only for this final state.
    StartState string
    Triggers the action only for this initial state.
    Repeat bool
    Whether or not the action should be repeated.
    final_state string
    Triggers the action only for this final state.
    start_state string
    Triggers the action only for this initial state.
    repeat bool
    Whether or not the action should be repeated.
    finalState String
    Triggers the action only for this final state.
    startState String
    Triggers the action only for this initial state.
    repeat Boolean
    Whether or not the action should be repeated.
    finalState string
    Triggers the action only for this final state.
    startState string
    Triggers the action only for this initial state.
    repeat boolean
    Whether or not the action should be repeated.
    final_state str
    Triggers the action only for this final state.
    start_state str
    Triggers the action only for this initial state.
    repeat bool
    Whether or not the action should be repeated.
    finalState String
    Triggers the action only for this final state.
    startState String
    Triggers the action only for this initial state.
    repeat Boolean
    Whether or not the action should be repeated.

    AlarmStateExpression, AlarmStateExpressionArgs

    ObjectType string
    Type of object where the event applies on, ie: HostSystem.
    Operator string
    Check if state is equal or unequal.
    StatePath string
    State path: ie. runtime.connectionState.
    Red string
    State value to trigger critical alarm.
    Yellow string
    State value to trigger warning alarm.
    ObjectType string
    Type of object where the event applies on, ie: HostSystem.
    Operator string
    Check if state is equal or unequal.
    StatePath string
    State path: ie. runtime.connectionState.
    Red string
    State value to trigger critical alarm.
    Yellow string
    State value to trigger warning alarm.
    object_type string
    Type of object where the event applies on, ie: HostSystem.
    operator string
    Check if state is equal or unequal.
    state_path string
    State path: ie. runtime.connectionState.
    red string
    State value to trigger critical alarm.
    yellow string
    State value to trigger warning alarm.
    objectType String
    Type of object where the event applies on, ie: HostSystem.
    operator String
    Check if state is equal or unequal.
    statePath String
    State path: ie. runtime.connectionState.
    red String
    State value to trigger critical alarm.
    yellow String
    State value to trigger warning alarm.
    objectType string
    Type of object where the event applies on, ie: HostSystem.
    operator string
    Check if state is equal or unequal.
    statePath string
    State path: ie. runtime.connectionState.
    red string
    State value to trigger critical alarm.
    yellow string
    State value to trigger warning alarm.
    object_type str
    Type of object where the event applies on, ie: HostSystem.
    operator str
    Check if state is equal or unequal.
    state_path str
    State path: ie. runtime.connectionState.
    red str
    State value to trigger critical alarm.
    yellow str
    State value to trigger warning alarm.
    objectType String
    Type of object where the event applies on, ie: HostSystem.
    operator String
    Check if state is equal or unequal.
    statePath String
    State path: ie. runtime.connectionState.
    red String
    State value to trigger critical alarm.
    yellow String
    State value to trigger warning alarm.

    Import

    Importing vSphere alarm is not managed.

    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.
    vsphere logo
    Viewing docs for vSphere v4.17.0
    published on Thursday, Jun 25, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial