published on Friday, Mar 27, 2026 by Pulumi
published on Friday, Mar 27, 2026 by Pulumi
Resource for creating and managing Harness AutoStopping alerts. Alerts notify users via email or Slack when events such as warmup failures, cooldown failures, or rule lifecycle changes occur.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as harness from "@pulumi/harness";
const specific_rule_alert = new harness.autostopping.Alert("specific-rule-alert", {
name: "demo-alert",
recipients: {
emails: [
"user1@example.com",
"user2@example.com",
],
slacks: [
"slack-web-hook-1",
"slack-web-hook-2",
],
},
events: [
"autostopping_rule_created",
"autostopping_rule_updated",
"autostopping_rule_deleted",
"autostopping_warmup_failed",
"autostopping_cooldown_failed",
],
ruleIdLists: [1234],
});
const all_rule_alert = new harness.autostopping.Alert("all-rule-alert", {
name: "demo-alert",
recipients: {
emails: [
"user1@example.com",
"user2@example.com",
],
slacks: [
"slack-web-hook-1",
"slack-web-hook-2",
],
},
events: [
"autostopping_rule_created",
"autostopping_rule_updated",
"autostopping_rule_deleted",
"autostopping_warmup_failed",
"autostopping_cooldown_failed",
],
applicableToAllRules: true,
});
import pulumi
import pulumi_harness as harness
specific_rule_alert = harness.autostopping.Alert("specific-rule-alert",
name="demo-alert",
recipients={
"emails": [
"user1@example.com",
"user2@example.com",
],
"slacks": [
"slack-web-hook-1",
"slack-web-hook-2",
],
},
events=[
"autostopping_rule_created",
"autostopping_rule_updated",
"autostopping_rule_deleted",
"autostopping_warmup_failed",
"autostopping_cooldown_failed",
],
rule_id_lists=[1234])
all_rule_alert = harness.autostopping.Alert("all-rule-alert",
name="demo-alert",
recipients={
"emails": [
"user1@example.com",
"user2@example.com",
],
"slacks": [
"slack-web-hook-1",
"slack-web-hook-2",
],
},
events=[
"autostopping_rule_created",
"autostopping_rule_updated",
"autostopping_rule_deleted",
"autostopping_warmup_failed",
"autostopping_cooldown_failed",
],
applicable_to_all_rules=True)
package main
import (
"github.com/pulumi/pulumi-harness/sdk/go/harness/autostopping"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := autostopping.NewAlert(ctx, "specific-rule-alert", &autostopping.AlertArgs{
Name: pulumi.String("demo-alert"),
Recipients: &autostopping.AlertRecipientsArgs{
Emails: pulumi.StringArray{
pulumi.String("user1@example.com"),
pulumi.String("user2@example.com"),
},
Slacks: pulumi.StringArray{
pulumi.String("slack-web-hook-1"),
pulumi.String("slack-web-hook-2"),
},
},
Events: pulumi.StringArray{
pulumi.String("autostopping_rule_created"),
pulumi.String("autostopping_rule_updated"),
pulumi.String("autostopping_rule_deleted"),
pulumi.String("autostopping_warmup_failed"),
pulumi.String("autostopping_cooldown_failed"),
},
RuleIdLists: pulumi.IntArray{
pulumi.Int(1234),
},
})
if err != nil {
return err
}
_, err = autostopping.NewAlert(ctx, "all-rule-alert", &autostopping.AlertArgs{
Name: pulumi.String("demo-alert"),
Recipients: &autostopping.AlertRecipientsArgs{
Emails: pulumi.StringArray{
pulumi.String("user1@example.com"),
pulumi.String("user2@example.com"),
},
Slacks: pulumi.StringArray{
pulumi.String("slack-web-hook-1"),
pulumi.String("slack-web-hook-2"),
},
},
Events: pulumi.StringArray{
pulumi.String("autostopping_rule_created"),
pulumi.String("autostopping_rule_updated"),
pulumi.String("autostopping_rule_deleted"),
pulumi.String("autostopping_warmup_failed"),
pulumi.String("autostopping_cooldown_failed"),
},
ApplicableToAllRules: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Harness = Pulumi.Harness;
return await Deployment.RunAsync(() =>
{
var specific_rule_alert = new Harness.Autostopping.Alert("specific-rule-alert", new()
{
Name = "demo-alert",
Recipients = new Harness.Autostopping.Inputs.AlertRecipientsArgs
{
Emails = new[]
{
"user1@example.com",
"user2@example.com",
},
Slacks = new[]
{
"slack-web-hook-1",
"slack-web-hook-2",
},
},
Events = new[]
{
"autostopping_rule_created",
"autostopping_rule_updated",
"autostopping_rule_deleted",
"autostopping_warmup_failed",
"autostopping_cooldown_failed",
},
RuleIdLists = new[]
{
1234,
},
});
var all_rule_alert = new Harness.Autostopping.Alert("all-rule-alert", new()
{
Name = "demo-alert",
Recipients = new Harness.Autostopping.Inputs.AlertRecipientsArgs
{
Emails = new[]
{
"user1@example.com",
"user2@example.com",
},
Slacks = new[]
{
"slack-web-hook-1",
"slack-web-hook-2",
},
},
Events = new[]
{
"autostopping_rule_created",
"autostopping_rule_updated",
"autostopping_rule_deleted",
"autostopping_warmup_failed",
"autostopping_cooldown_failed",
},
ApplicableToAllRules = true,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.harness.autostopping.Alert;
import com.pulumi.harness.autostopping.AlertArgs;
import com.pulumi.harness.autostopping.inputs.AlertRecipientsArgs;
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 specific_rule_alert = new Alert("specific-rule-alert", AlertArgs.builder()
.name("demo-alert")
.recipients(AlertRecipientsArgs.builder()
.emails(
"user1@example.com",
"user2@example.com")
.slacks(
"slack-web-hook-1",
"slack-web-hook-2")
.build())
.events(
"autostopping_rule_created",
"autostopping_rule_updated",
"autostopping_rule_deleted",
"autostopping_warmup_failed",
"autostopping_cooldown_failed")
.ruleIdLists(1234)
.build());
var all_rule_alert = new Alert("all-rule-alert", AlertArgs.builder()
.name("demo-alert")
.recipients(AlertRecipientsArgs.builder()
.emails(
"user1@example.com",
"user2@example.com")
.slacks(
"slack-web-hook-1",
"slack-web-hook-2")
.build())
.events(
"autostopping_rule_created",
"autostopping_rule_updated",
"autostopping_rule_deleted",
"autostopping_warmup_failed",
"autostopping_cooldown_failed")
.applicableToAllRules(true)
.build());
}
}
resources:
specific-rule-alert:
type: harness:autostopping:Alert
properties:
name: demo-alert
recipients:
emails:
- user1@example.com
- user2@example.com
slacks:
- slack-web-hook-1
- slack-web-hook-2
events:
- autostopping_rule_created
- autostopping_rule_updated
- autostopping_rule_deleted
- autostopping_warmup_failed
- autostopping_cooldown_failed
ruleIdLists:
- 1234
all-rule-alert:
type: harness:autostopping:Alert
properties:
name: demo-alert
recipients:
emails:
- user1@example.com
- user2@example.com
slacks:
- slack-web-hook-1
- slack-web-hook-2
events:
- autostopping_rule_created
- autostopping_rule_updated
- autostopping_rule_deleted
- autostopping_warmup_failed
- autostopping_cooldown_failed
applicableToAllRules: true
Create Alert Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Alert(name: string, args: AlertArgs, opts?: CustomResourceOptions);@overload
def Alert(resource_name: str,
args: AlertArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Alert(resource_name: str,
opts: Optional[ResourceOptions] = None,
events: Optional[Sequence[str]] = None,
recipients: Optional[AlertRecipientsArgs] = None,
applicable_to_all_rules: Optional[bool] = None,
enabled: Optional[bool] = None,
name: Optional[str] = None,
rule_id_lists: Optional[Sequence[int]] = None)func NewAlert(ctx *Context, name string, args AlertArgs, opts ...ResourceOption) (*Alert, error)public Alert(string name, AlertArgs args, CustomResourceOptions? opts = null)type: harness:autostopping:Alert
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 AlertArgs
- 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 AlertArgs
- 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 AlertArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AlertArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AlertArgs
- 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 alertResource = new Harness.Autostopping.Alert("alertResource", new()
{
Events = new[]
{
"string",
},
Recipients = new Harness.Autostopping.Inputs.AlertRecipientsArgs
{
Emails = new[]
{
"string",
},
Slacks = new[]
{
"string",
},
},
ApplicableToAllRules = false,
Enabled = false,
Name = "string",
RuleIdLists = new[]
{
0,
},
});
example, err := autostopping.NewAlert(ctx, "alertResource", &autostopping.AlertArgs{
Events: pulumi.StringArray{
pulumi.String("string"),
},
Recipients: &autostopping.AlertRecipientsArgs{
Emails: pulumi.StringArray{
pulumi.String("string"),
},
Slacks: pulumi.StringArray{
pulumi.String("string"),
},
},
ApplicableToAllRules: pulumi.Bool(false),
Enabled: pulumi.Bool(false),
Name: pulumi.String("string"),
RuleIdLists: pulumi.IntArray{
pulumi.Int(0),
},
})
var alertResource = new Alert("alertResource", AlertArgs.builder()
.events("string")
.recipients(AlertRecipientsArgs.builder()
.emails("string")
.slacks("string")
.build())
.applicableToAllRules(false)
.enabled(false)
.name("string")
.ruleIdLists(0)
.build());
alert_resource = harness.autostopping.Alert("alertResource",
events=["string"],
recipients={
"emails": ["string"],
"slacks": ["string"],
},
applicable_to_all_rules=False,
enabled=False,
name="string",
rule_id_lists=[0])
const alertResource = new harness.autostopping.Alert("alertResource", {
events: ["string"],
recipients: {
emails: ["string"],
slacks: ["string"],
},
applicableToAllRules: false,
enabled: false,
name: "string",
ruleIdLists: [0],
});
type: harness:autostopping:Alert
properties:
applicableToAllRules: false
enabled: false
events:
- string
name: string
recipients:
emails:
- string
slacks:
- string
ruleIdLists:
- 0
Alert 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 Alert resource accepts the following input properties:
- Events List<string>
- List of event types that trigger the alert (e.g. autostoppingrulecreated, autostoppingwarmupfailed, autostoppingcooldownfailed).
- Recipients
Alert
Recipients - Notification recipients. At least one of
emailorslackis required (with at least one value). - Applicable
To boolAll Rules - When true, the alert applies to all AutoStopping rules in the account (leave
rule_id_listempty). Mutually exclusive withrule_id_list. - Enabled bool
- Whether the alert is enabled.
- Name string
- Name of the alert.
- Rule
Id List<int>Lists - List of AutoStopping rule IDs to apply the alert to. Required when
applicable_to_all_rulesis false. Mutually exclusive withapplicable_to_all_rules= true.
- Events []string
- List of event types that trigger the alert (e.g. autostoppingrulecreated, autostoppingwarmupfailed, autostoppingcooldownfailed).
- Recipients
Alert
Recipients Args - Notification recipients. At least one of
emailorslackis required (with at least one value). - Applicable
To boolAll Rules - When true, the alert applies to all AutoStopping rules in the account (leave
rule_id_listempty). Mutually exclusive withrule_id_list. - Enabled bool
- Whether the alert is enabled.
- Name string
- Name of the alert.
- Rule
Id []intLists - List of AutoStopping rule IDs to apply the alert to. Required when
applicable_to_all_rulesis false. Mutually exclusive withapplicable_to_all_rules= true.
- events List<String>
- List of event types that trigger the alert (e.g. autostoppingrulecreated, autostoppingwarmupfailed, autostoppingcooldownfailed).
- recipients
Alert
Recipients - Notification recipients. At least one of
emailorslackis required (with at least one value). - applicable
To BooleanAll Rules - When true, the alert applies to all AutoStopping rules in the account (leave
rule_id_listempty). Mutually exclusive withrule_id_list. - enabled Boolean
- Whether the alert is enabled.
- name String
- Name of the alert.
- rule
Id List<Integer>Lists - List of AutoStopping rule IDs to apply the alert to. Required when
applicable_to_all_rulesis false. Mutually exclusive withapplicable_to_all_rules= true.
- events string[]
- List of event types that trigger the alert (e.g. autostoppingrulecreated, autostoppingwarmupfailed, autostoppingcooldownfailed).
- recipients
Alert
Recipients - Notification recipients. At least one of
emailorslackis required (with at least one value). - applicable
To booleanAll Rules - When true, the alert applies to all AutoStopping rules in the account (leave
rule_id_listempty). Mutually exclusive withrule_id_list. - enabled boolean
- Whether the alert is enabled.
- name string
- Name of the alert.
- rule
Id number[]Lists - List of AutoStopping rule IDs to apply the alert to. Required when
applicable_to_all_rulesis false. Mutually exclusive withapplicable_to_all_rules= true.
- events Sequence[str]
- List of event types that trigger the alert (e.g. autostoppingrulecreated, autostoppingwarmupfailed, autostoppingcooldownfailed).
- recipients
Alert
Recipients Args - Notification recipients. At least one of
emailorslackis required (with at least one value). - applicable_
to_ boolall_ rules - When true, the alert applies to all AutoStopping rules in the account (leave
rule_id_listempty). Mutually exclusive withrule_id_list. - enabled bool
- Whether the alert is enabled.
- name str
- Name of the alert.
- rule_
id_ Sequence[int]lists - List of AutoStopping rule IDs to apply the alert to. Required when
applicable_to_all_rulesis false. Mutually exclusive withapplicable_to_all_rules= true.
- events List<String>
- List of event types that trigger the alert (e.g. autostoppingrulecreated, autostoppingwarmupfailed, autostoppingcooldownfailed).
- recipients Property Map
- Notification recipients. At least one of
emailorslackis required (with at least one value). - applicable
To BooleanAll Rules - When true, the alert applies to all AutoStopping rules in the account (leave
rule_id_listempty). Mutually exclusive withrule_id_list. - enabled Boolean
- Whether the alert is enabled.
- name String
- Name of the alert.
- rule
Id List<Number>Lists - List of AutoStopping rule IDs to apply the alert to. Required when
applicable_to_all_rulesis false. Mutually exclusive withapplicable_to_all_rules= true.
Outputs
All input properties are implicitly available as output properties. Additionally, the Alert 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 Alert Resource
Get an existing Alert 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?: AlertState, opts?: CustomResourceOptions): Alert@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
applicable_to_all_rules: Optional[bool] = None,
enabled: Optional[bool] = None,
events: Optional[Sequence[str]] = None,
name: Optional[str] = None,
recipients: Optional[AlertRecipientsArgs] = None,
rule_id_lists: Optional[Sequence[int]] = None) -> Alertfunc GetAlert(ctx *Context, name string, id IDInput, state *AlertState, opts ...ResourceOption) (*Alert, error)public static Alert Get(string name, Input<string> id, AlertState? state, CustomResourceOptions? opts = null)public static Alert get(String name, Output<String> id, AlertState state, CustomResourceOptions options)resources: _: type: harness:autostopping:Alert get: 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.
- Applicable
To boolAll Rules - When true, the alert applies to all AutoStopping rules in the account (leave
rule_id_listempty). Mutually exclusive withrule_id_list. - Enabled bool
- Whether the alert is enabled.
- Events List<string>
- List of event types that trigger the alert (e.g. autostoppingrulecreated, autostoppingwarmupfailed, autostoppingcooldownfailed).
- Name string
- Name of the alert.
- Recipients
Alert
Recipients - Notification recipients. At least one of
emailorslackis required (with at least one value). - Rule
Id List<int>Lists - List of AutoStopping rule IDs to apply the alert to. Required when
applicable_to_all_rulesis false. Mutually exclusive withapplicable_to_all_rules= true.
- Applicable
To boolAll Rules - When true, the alert applies to all AutoStopping rules in the account (leave
rule_id_listempty). Mutually exclusive withrule_id_list. - Enabled bool
- Whether the alert is enabled.
- Events []string
- List of event types that trigger the alert (e.g. autostoppingrulecreated, autostoppingwarmupfailed, autostoppingcooldownfailed).
- Name string
- Name of the alert.
- Recipients
Alert
Recipients Args - Notification recipients. At least one of
emailorslackis required (with at least one value). - Rule
Id []intLists - List of AutoStopping rule IDs to apply the alert to. Required when
applicable_to_all_rulesis false. Mutually exclusive withapplicable_to_all_rules= true.
- applicable
To BooleanAll Rules - When true, the alert applies to all AutoStopping rules in the account (leave
rule_id_listempty). Mutually exclusive withrule_id_list. - enabled Boolean
- Whether the alert is enabled.
- events List<String>
- List of event types that trigger the alert (e.g. autostoppingrulecreated, autostoppingwarmupfailed, autostoppingcooldownfailed).
- name String
- Name of the alert.
- recipients
Alert
Recipients - Notification recipients. At least one of
emailorslackis required (with at least one value). - rule
Id List<Integer>Lists - List of AutoStopping rule IDs to apply the alert to. Required when
applicable_to_all_rulesis false. Mutually exclusive withapplicable_to_all_rules= true.
- applicable
To booleanAll Rules - When true, the alert applies to all AutoStopping rules in the account (leave
rule_id_listempty). Mutually exclusive withrule_id_list. - enabled boolean
- Whether the alert is enabled.
- events string[]
- List of event types that trigger the alert (e.g. autostoppingrulecreated, autostoppingwarmupfailed, autostoppingcooldownfailed).
- name string
- Name of the alert.
- recipients
Alert
Recipients - Notification recipients. At least one of
emailorslackis required (with at least one value). - rule
Id number[]Lists - List of AutoStopping rule IDs to apply the alert to. Required when
applicable_to_all_rulesis false. Mutually exclusive withapplicable_to_all_rules= true.
- applicable_
to_ boolall_ rules - When true, the alert applies to all AutoStopping rules in the account (leave
rule_id_listempty). Mutually exclusive withrule_id_list. - enabled bool
- Whether the alert is enabled.
- events Sequence[str]
- List of event types that trigger the alert (e.g. autostoppingrulecreated, autostoppingwarmupfailed, autostoppingcooldownfailed).
- name str
- Name of the alert.
- recipients
Alert
Recipients Args - Notification recipients. At least one of
emailorslackis required (with at least one value). - rule_
id_ Sequence[int]lists - List of AutoStopping rule IDs to apply the alert to. Required when
applicable_to_all_rulesis false. Mutually exclusive withapplicable_to_all_rules= true.
- applicable
To BooleanAll Rules - When true, the alert applies to all AutoStopping rules in the account (leave
rule_id_listempty). Mutually exclusive withrule_id_list. - enabled Boolean
- Whether the alert is enabled.
- events List<String>
- List of event types that trigger the alert (e.g. autostoppingrulecreated, autostoppingwarmupfailed, autostoppingcooldownfailed).
- name String
- Name of the alert.
- recipients Property Map
- Notification recipients. At least one of
emailorslackis required (with at least one value). - rule
Id List<Number>Lists - List of AutoStopping rule IDs to apply the alert to. Required when
applicable_to_all_rulesis false. Mutually exclusive withapplicable_to_all_rules= true.
Supporting Types
AlertRecipients, AlertRecipientsArgs
Package Details
- Repository
- harness pulumi/pulumi-harness
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
harnessTerraform Provider.
published on Friday, Mar 27, 2026 by Pulumi
