1. Packages
  2. Rancher2
  3. API Docs
  4. ProjectAlertRule
Rancher 2 v6.1.0 published on Tuesday, Mar 12, 2024 by Pulumi

rancher2.ProjectAlertRule

Explore with Pulumi AI

rancher2 logo
Rancher 2 v6.1.0 published on Tuesday, Mar 12, 2024 by Pulumi

    Provides a Rancher v2 Project Alert Rule resource. This can be used to create Project Alert Rule for Rancher v2 environments and retrieve their information.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as rancher2 from "@pulumi/rancher2";
    
    // Create a new Rancher2 Project
    const fooProject = new rancher2.Project("fooProject", {
        clusterId: "<cluster_id>",
        description: "Terraform project ",
        resourceQuota: {
            projectLimit: {
                limitsCpu: "2000m",
                limitsMemory: "2000Mi",
                requestsStorage: "2Gi",
            },
            namespaceDefaultLimit: {
                limitsCpu: "500m",
                limitsMemory: "500Mi",
                requestsStorage: "1Gi",
            },
        },
        containerResourceLimit: {
            limitsCpu: "20m",
            limitsMemory: "20Mi",
            requestsCpu: "1m",
            requestsMemory: "1Mi",
        },
    });
    // Create a new Rancher2 Project Alert Group
    const fooProjectAlertGroup = new rancher2.ProjectAlertGroup("fooProjectAlertGroup", {
        description: "Terraform project alert group",
        projectId: fooProject.id,
        groupIntervalSeconds: 300,
        repeatIntervalSeconds: 3600,
    });
    // Create a new Rancher2 Project Alert Rule
    const fooProjectAlertRule = new rancher2.ProjectAlertRule("fooProjectAlertRule", {
        projectId: fooProjectAlertGroup.projectId,
        groupId: fooProjectAlertGroup.id,
        groupIntervalSeconds: 600,
        repeatIntervalSeconds: 6000,
    });
    
    import pulumi
    import pulumi_rancher2 as rancher2
    
    # Create a new Rancher2 Project
    foo_project = rancher2.Project("fooProject",
        cluster_id="<cluster_id>",
        description="Terraform project ",
        resource_quota=rancher2.ProjectResourceQuotaArgs(
            project_limit=rancher2.ProjectResourceQuotaProjectLimitArgs(
                limits_cpu="2000m",
                limits_memory="2000Mi",
                requests_storage="2Gi",
            ),
            namespace_default_limit=rancher2.ProjectResourceQuotaNamespaceDefaultLimitArgs(
                limits_cpu="500m",
                limits_memory="500Mi",
                requests_storage="1Gi",
            ),
        ),
        container_resource_limit=rancher2.ProjectContainerResourceLimitArgs(
            limits_cpu="20m",
            limits_memory="20Mi",
            requests_cpu="1m",
            requests_memory="1Mi",
        ))
    # Create a new Rancher2 Project Alert Group
    foo_project_alert_group = rancher2.ProjectAlertGroup("fooProjectAlertGroup",
        description="Terraform project alert group",
        project_id=foo_project.id,
        group_interval_seconds=300,
        repeat_interval_seconds=3600)
    # Create a new Rancher2 Project Alert Rule
    foo_project_alert_rule = rancher2.ProjectAlertRule("fooProjectAlertRule",
        project_id=foo_project_alert_group.project_id,
        group_id=foo_project_alert_group.id,
        group_interval_seconds=600,
        repeat_interval_seconds=6000)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-rancher2/sdk/v6/go/rancher2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Create a new Rancher2 Project
    		fooProject, err := rancher2.NewProject(ctx, "fooProject", &rancher2.ProjectArgs{
    			ClusterId:   pulumi.String("<cluster_id>"),
    			Description: pulumi.String("Terraform project "),
    			ResourceQuota: &rancher2.ProjectResourceQuotaArgs{
    				ProjectLimit: &rancher2.ProjectResourceQuotaProjectLimitArgs{
    					LimitsCpu:       pulumi.String("2000m"),
    					LimitsMemory:    pulumi.String("2000Mi"),
    					RequestsStorage: pulumi.String("2Gi"),
    				},
    				NamespaceDefaultLimit: &rancher2.ProjectResourceQuotaNamespaceDefaultLimitArgs{
    					LimitsCpu:       pulumi.String("500m"),
    					LimitsMemory:    pulumi.String("500Mi"),
    					RequestsStorage: pulumi.String("1Gi"),
    				},
    			},
    			ContainerResourceLimit: &rancher2.ProjectContainerResourceLimitArgs{
    				LimitsCpu:      pulumi.String("20m"),
    				LimitsMemory:   pulumi.String("20Mi"),
    				RequestsCpu:    pulumi.String("1m"),
    				RequestsMemory: pulumi.String("1Mi"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// Create a new Rancher2 Project Alert Group
    		fooProjectAlertGroup, err := rancher2.NewProjectAlertGroup(ctx, "fooProjectAlertGroup", &rancher2.ProjectAlertGroupArgs{
    			Description:           pulumi.String("Terraform project alert group"),
    			ProjectId:             fooProject.ID(),
    			GroupIntervalSeconds:  pulumi.Int(300),
    			RepeatIntervalSeconds: pulumi.Int(3600),
    		})
    		if err != nil {
    			return err
    		}
    		// Create a new Rancher2 Project Alert Rule
    		_, err = rancher2.NewProjectAlertRule(ctx, "fooProjectAlertRule", &rancher2.ProjectAlertRuleArgs{
    			ProjectId:             fooProjectAlertGroup.ProjectId,
    			GroupId:               fooProjectAlertGroup.ID(),
    			GroupIntervalSeconds:  pulumi.Int(600),
    			RepeatIntervalSeconds: pulumi.Int(6000),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Rancher2 = Pulumi.Rancher2;
    
    return await Deployment.RunAsync(() => 
    {
        // Create a new Rancher2 Project
        var fooProject = new Rancher2.Project("fooProject", new()
        {
            ClusterId = "<cluster_id>",
            Description = "Terraform project ",
            ResourceQuota = new Rancher2.Inputs.ProjectResourceQuotaArgs
            {
                ProjectLimit = new Rancher2.Inputs.ProjectResourceQuotaProjectLimitArgs
                {
                    LimitsCpu = "2000m",
                    LimitsMemory = "2000Mi",
                    RequestsStorage = "2Gi",
                },
                NamespaceDefaultLimit = new Rancher2.Inputs.ProjectResourceQuotaNamespaceDefaultLimitArgs
                {
                    LimitsCpu = "500m",
                    LimitsMemory = "500Mi",
                    RequestsStorage = "1Gi",
                },
            },
            ContainerResourceLimit = new Rancher2.Inputs.ProjectContainerResourceLimitArgs
            {
                LimitsCpu = "20m",
                LimitsMemory = "20Mi",
                RequestsCpu = "1m",
                RequestsMemory = "1Mi",
            },
        });
    
        // Create a new Rancher2 Project Alert Group
        var fooProjectAlertGroup = new Rancher2.ProjectAlertGroup("fooProjectAlertGroup", new()
        {
            Description = "Terraform project alert group",
            ProjectId = fooProject.Id,
            GroupIntervalSeconds = 300,
            RepeatIntervalSeconds = 3600,
        });
    
        // Create a new Rancher2 Project Alert Rule
        var fooProjectAlertRule = new Rancher2.ProjectAlertRule("fooProjectAlertRule", new()
        {
            ProjectId = fooProjectAlertGroup.ProjectId,
            GroupId = fooProjectAlertGroup.Id,
            GroupIntervalSeconds = 600,
            RepeatIntervalSeconds = 6000,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.rancher2.Project;
    import com.pulumi.rancher2.ProjectArgs;
    import com.pulumi.rancher2.inputs.ProjectResourceQuotaArgs;
    import com.pulumi.rancher2.inputs.ProjectResourceQuotaProjectLimitArgs;
    import com.pulumi.rancher2.inputs.ProjectResourceQuotaNamespaceDefaultLimitArgs;
    import com.pulumi.rancher2.inputs.ProjectContainerResourceLimitArgs;
    import com.pulumi.rancher2.ProjectAlertGroup;
    import com.pulumi.rancher2.ProjectAlertGroupArgs;
    import com.pulumi.rancher2.ProjectAlertRule;
    import com.pulumi.rancher2.ProjectAlertRuleArgs;
    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 fooProject = new Project("fooProject", ProjectArgs.builder()        
                .clusterId("<cluster_id>")
                .description("Terraform project ")
                .resourceQuota(ProjectResourceQuotaArgs.builder()
                    .projectLimit(ProjectResourceQuotaProjectLimitArgs.builder()
                        .limitsCpu("2000m")
                        .limitsMemory("2000Mi")
                        .requestsStorage("2Gi")
                        .build())
                    .namespaceDefaultLimit(ProjectResourceQuotaNamespaceDefaultLimitArgs.builder()
                        .limitsCpu("500m")
                        .limitsMemory("500Mi")
                        .requestsStorage("1Gi")
                        .build())
                    .build())
                .containerResourceLimit(ProjectContainerResourceLimitArgs.builder()
                    .limitsCpu("20m")
                    .limitsMemory("20Mi")
                    .requestsCpu("1m")
                    .requestsMemory("1Mi")
                    .build())
                .build());
    
            var fooProjectAlertGroup = new ProjectAlertGroup("fooProjectAlertGroup", ProjectAlertGroupArgs.builder()        
                .description("Terraform project alert group")
                .projectId(fooProject.id())
                .groupIntervalSeconds(300)
                .repeatIntervalSeconds(3600)
                .build());
    
            var fooProjectAlertRule = new ProjectAlertRule("fooProjectAlertRule", ProjectAlertRuleArgs.builder()        
                .projectId(fooProjectAlertGroup.projectId())
                .groupId(fooProjectAlertGroup.id())
                .groupIntervalSeconds(600)
                .repeatIntervalSeconds(6000)
                .build());
    
        }
    }
    
    resources:
      # Create a new Rancher2 Project
      fooProject:
        type: rancher2:Project
        properties:
          clusterId: <cluster_id>
          description: 'Terraform project '
          resourceQuota:
            projectLimit:
              limitsCpu: 2000m
              limitsMemory: 2000Mi
              requestsStorage: 2Gi
            namespaceDefaultLimit:
              limitsCpu: 500m
              limitsMemory: 500Mi
              requestsStorage: 1Gi
          containerResourceLimit:
            limitsCpu: 20m
            limitsMemory: 20Mi
            requestsCpu: 1m
            requestsMemory: 1Mi
      # Create a new Rancher2 Project Alert Group
      fooProjectAlertGroup:
        type: rancher2:ProjectAlertGroup
        properties:
          description: Terraform project alert group
          projectId: ${fooProject.id}
          groupIntervalSeconds: 300
          repeatIntervalSeconds: 3600
      # Create a new Rancher2 Project Alert Rule
      fooProjectAlertRule:
        type: rancher2:ProjectAlertRule
        properties:
          projectId: ${fooProjectAlertGroup.projectId}
          groupId: ${fooProjectAlertGroup.id}
          groupIntervalSeconds: 600
          repeatIntervalSeconds: 6000
    

    Create ProjectAlertRule Resource

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

    Constructor syntax

    new ProjectAlertRule(name: string, args: ProjectAlertRuleArgs, opts?: CustomResourceOptions);
    @overload
    def ProjectAlertRule(resource_name: str,
                         args: ProjectAlertRuleArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def ProjectAlertRule(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         project_id: Optional[str] = None,
                         group_id: Optional[str] = None,
                         group_wait_seconds: Optional[int] = None,
                         annotations: Optional[Mapping[str, Any]] = None,
                         inherited: Optional[bool] = None,
                         labels: Optional[Mapping[str, Any]] = None,
                         metric_rule: Optional[ProjectAlertRuleMetricRuleArgs] = None,
                         name: Optional[str] = None,
                         pod_rule: Optional[ProjectAlertRulePodRuleArgs] = None,
                         group_interval_seconds: Optional[int] = None,
                         repeat_interval_seconds: Optional[int] = None,
                         severity: Optional[str] = None,
                         workload_rule: Optional[ProjectAlertRuleWorkloadRuleArgs] = None)
    func NewProjectAlertRule(ctx *Context, name string, args ProjectAlertRuleArgs, opts ...ResourceOption) (*ProjectAlertRule, error)
    public ProjectAlertRule(string name, ProjectAlertRuleArgs args, CustomResourceOptions? opts = null)
    public ProjectAlertRule(String name, ProjectAlertRuleArgs args)
    public ProjectAlertRule(String name, ProjectAlertRuleArgs args, CustomResourceOptions options)
    
    type: rancher2:ProjectAlertRule
    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 ProjectAlertRuleArgs
    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 ProjectAlertRuleArgs
    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 ProjectAlertRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ProjectAlertRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ProjectAlertRuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var projectAlertRuleResource = new Rancher2.ProjectAlertRule("projectAlertRuleResource", new()
    {
        ProjectId = "string",
        GroupId = "string",
        GroupWaitSeconds = 0,
        Annotations = 
        {
            { "string", "any" },
        },
        Inherited = false,
        Labels = 
        {
            { "string", "any" },
        },
        MetricRule = new Rancher2.Inputs.ProjectAlertRuleMetricRuleArgs
        {
            Duration = "string",
            Expression = "string",
            ThresholdValue = 0,
            Comparison = "string",
            Description = "string",
        },
        Name = "string",
        PodRule = new Rancher2.Inputs.ProjectAlertRulePodRuleArgs
        {
            PodId = "string",
            Condition = "string",
            RestartIntervalSeconds = 0,
            RestartTimes = 0,
        },
        GroupIntervalSeconds = 0,
        RepeatIntervalSeconds = 0,
        Severity = "string",
        WorkloadRule = new Rancher2.Inputs.ProjectAlertRuleWorkloadRuleArgs
        {
            AvailablePercentage = 0,
            Selector = 
            {
                { "string", "any" },
            },
            WorkloadId = "string",
        },
    });
    
    example, err := rancher2.NewProjectAlertRule(ctx, "projectAlertRuleResource", &rancher2.ProjectAlertRuleArgs{
    	ProjectId:        pulumi.String("string"),
    	GroupId:          pulumi.String("string"),
    	GroupWaitSeconds: pulumi.Int(0),
    	Annotations: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    	Inherited: pulumi.Bool(false),
    	Labels: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    	MetricRule: &rancher2.ProjectAlertRuleMetricRuleArgs{
    		Duration:       pulumi.String("string"),
    		Expression:     pulumi.String("string"),
    		ThresholdValue: pulumi.Float64(0),
    		Comparison:     pulumi.String("string"),
    		Description:    pulumi.String("string"),
    	},
    	Name: pulumi.String("string"),
    	PodRule: &rancher2.ProjectAlertRulePodRuleArgs{
    		PodId:                  pulumi.String("string"),
    		Condition:              pulumi.String("string"),
    		RestartIntervalSeconds: pulumi.Int(0),
    		RestartTimes:           pulumi.Int(0),
    	},
    	GroupIntervalSeconds:  pulumi.Int(0),
    	RepeatIntervalSeconds: pulumi.Int(0),
    	Severity:              pulumi.String("string"),
    	WorkloadRule: &rancher2.ProjectAlertRuleWorkloadRuleArgs{
    		AvailablePercentage: pulumi.Int(0),
    		Selector: pulumi.Map{
    			"string": pulumi.Any("any"),
    		},
    		WorkloadId: pulumi.String("string"),
    	},
    })
    
    var projectAlertRuleResource = new ProjectAlertRule("projectAlertRuleResource", ProjectAlertRuleArgs.builder()        
        .projectId("string")
        .groupId("string")
        .groupWaitSeconds(0)
        .annotations(Map.of("string", "any"))
        .inherited(false)
        .labels(Map.of("string", "any"))
        .metricRule(ProjectAlertRuleMetricRuleArgs.builder()
            .duration("string")
            .expression("string")
            .thresholdValue(0)
            .comparison("string")
            .description("string")
            .build())
        .name("string")
        .podRule(ProjectAlertRulePodRuleArgs.builder()
            .podId("string")
            .condition("string")
            .restartIntervalSeconds(0)
            .restartTimes(0)
            .build())
        .groupIntervalSeconds(0)
        .repeatIntervalSeconds(0)
        .severity("string")
        .workloadRule(ProjectAlertRuleWorkloadRuleArgs.builder()
            .availablePercentage(0)
            .selector(Map.of("string", "any"))
            .workloadId("string")
            .build())
        .build());
    
    project_alert_rule_resource = rancher2.ProjectAlertRule("projectAlertRuleResource",
        project_id="string",
        group_id="string",
        group_wait_seconds=0,
        annotations={
            "string": "any",
        },
        inherited=False,
        labels={
            "string": "any",
        },
        metric_rule=rancher2.ProjectAlertRuleMetricRuleArgs(
            duration="string",
            expression="string",
            threshold_value=0,
            comparison="string",
            description="string",
        ),
        name="string",
        pod_rule=rancher2.ProjectAlertRulePodRuleArgs(
            pod_id="string",
            condition="string",
            restart_interval_seconds=0,
            restart_times=0,
        ),
        group_interval_seconds=0,
        repeat_interval_seconds=0,
        severity="string",
        workload_rule=rancher2.ProjectAlertRuleWorkloadRuleArgs(
            available_percentage=0,
            selector={
                "string": "any",
            },
            workload_id="string",
        ))
    
    const projectAlertRuleResource = new rancher2.ProjectAlertRule("projectAlertRuleResource", {
        projectId: "string",
        groupId: "string",
        groupWaitSeconds: 0,
        annotations: {
            string: "any",
        },
        inherited: false,
        labels: {
            string: "any",
        },
        metricRule: {
            duration: "string",
            expression: "string",
            thresholdValue: 0,
            comparison: "string",
            description: "string",
        },
        name: "string",
        podRule: {
            podId: "string",
            condition: "string",
            restartIntervalSeconds: 0,
            restartTimes: 0,
        },
        groupIntervalSeconds: 0,
        repeatIntervalSeconds: 0,
        severity: "string",
        workloadRule: {
            availablePercentage: 0,
            selector: {
                string: "any",
            },
            workloadId: "string",
        },
    });
    
    type: rancher2:ProjectAlertRule
    properties:
        annotations:
            string: any
        groupId: string
        groupIntervalSeconds: 0
        groupWaitSeconds: 0
        inherited: false
        labels:
            string: any
        metricRule:
            comparison: string
            description: string
            duration: string
            expression: string
            thresholdValue: 0
        name: string
        podRule:
            condition: string
            podId: string
            restartIntervalSeconds: 0
            restartTimes: 0
        projectId: string
        repeatIntervalSeconds: 0
        severity: string
        workloadRule:
            availablePercentage: 0
            selector:
                string: any
            workloadId: string
    

    ProjectAlertRule Resource Properties

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

    Inputs

    The ProjectAlertRule resource accepts the following input properties:

    GroupId string
    The project alert rule alert group ID (string)
    ProjectId string
    The project id where create project alert rule (string)
    Annotations Dictionary<string, object>
    The project alert rule annotations (map)
    GroupIntervalSeconds int
    The project alert rule group interval seconds. Default: 180 (int)
    GroupWaitSeconds int
    The project alert rule group wait seconds. Default: 180 (int)
    Inherited bool
    The project alert rule inherited. Default: true (bool)
    Labels Dictionary<string, object>
    The project alert rule labels (map)
    MetricRule ProjectAlertRuleMetricRule
    The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
    Name string
    The project alert rule name (string)
    PodRule ProjectAlertRulePodRule
    The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
    RepeatIntervalSeconds int
    The project alert rule wait seconds. Default: 3600 (int)
    Severity string
    The project alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    WorkloadRule ProjectAlertRuleWorkloadRule
    The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)
    GroupId string
    The project alert rule alert group ID (string)
    ProjectId string
    The project id where create project alert rule (string)
    Annotations map[string]interface{}
    The project alert rule annotations (map)
    GroupIntervalSeconds int
    The project alert rule group interval seconds. Default: 180 (int)
    GroupWaitSeconds int
    The project alert rule group wait seconds. Default: 180 (int)
    Inherited bool
    The project alert rule inherited. Default: true (bool)
    Labels map[string]interface{}
    The project alert rule labels (map)
    MetricRule ProjectAlertRuleMetricRuleArgs
    The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
    Name string
    The project alert rule name (string)
    PodRule ProjectAlertRulePodRuleArgs
    The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
    RepeatIntervalSeconds int
    The project alert rule wait seconds. Default: 3600 (int)
    Severity string
    The project alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    WorkloadRule ProjectAlertRuleWorkloadRuleArgs
    The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)
    groupId String
    The project alert rule alert group ID (string)
    projectId String
    The project id where create project alert rule (string)
    annotations Map<String,Object>
    The project alert rule annotations (map)
    groupIntervalSeconds Integer
    The project alert rule group interval seconds. Default: 180 (int)
    groupWaitSeconds Integer
    The project alert rule group wait seconds. Default: 180 (int)
    inherited Boolean
    The project alert rule inherited. Default: true (bool)
    labels Map<String,Object>
    The project alert rule labels (map)
    metricRule ProjectAlertRuleMetricRule
    The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
    name String
    The project alert rule name (string)
    podRule ProjectAlertRulePodRule
    The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
    repeatIntervalSeconds Integer
    The project alert rule wait seconds. Default: 3600 (int)
    severity String
    The project alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    workloadRule ProjectAlertRuleWorkloadRule
    The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)
    groupId string
    The project alert rule alert group ID (string)
    projectId string
    The project id where create project alert rule (string)
    annotations {[key: string]: any}
    The project alert rule annotations (map)
    groupIntervalSeconds number
    The project alert rule group interval seconds. Default: 180 (int)
    groupWaitSeconds number
    The project alert rule group wait seconds. Default: 180 (int)
    inherited boolean
    The project alert rule inherited. Default: true (bool)
    labels {[key: string]: any}
    The project alert rule labels (map)
    metricRule ProjectAlertRuleMetricRule
    The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
    name string
    The project alert rule name (string)
    podRule ProjectAlertRulePodRule
    The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
    repeatIntervalSeconds number
    The project alert rule wait seconds. Default: 3600 (int)
    severity string
    The project alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    workloadRule ProjectAlertRuleWorkloadRule
    The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)
    group_id str
    The project alert rule alert group ID (string)
    project_id str
    The project id where create project alert rule (string)
    annotations Mapping[str, Any]
    The project alert rule annotations (map)
    group_interval_seconds int
    The project alert rule group interval seconds. Default: 180 (int)
    group_wait_seconds int
    The project alert rule group wait seconds. Default: 180 (int)
    inherited bool
    The project alert rule inherited. Default: true (bool)
    labels Mapping[str, Any]
    The project alert rule labels (map)
    metric_rule ProjectAlertRuleMetricRuleArgs
    The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
    name str
    The project alert rule name (string)
    pod_rule ProjectAlertRulePodRuleArgs
    The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
    repeat_interval_seconds int
    The project alert rule wait seconds. Default: 3600 (int)
    severity str
    The project alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    workload_rule ProjectAlertRuleWorkloadRuleArgs
    The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)
    groupId String
    The project alert rule alert group ID (string)
    projectId String
    The project id where create project alert rule (string)
    annotations Map<Any>
    The project alert rule annotations (map)
    groupIntervalSeconds Number
    The project alert rule group interval seconds. Default: 180 (int)
    groupWaitSeconds Number
    The project alert rule group wait seconds. Default: 180 (int)
    inherited Boolean
    The project alert rule inherited. Default: true (bool)
    labels Map<Any>
    The project alert rule labels (map)
    metricRule Property Map
    The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
    name String
    The project alert rule name (string)
    podRule Property Map
    The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
    repeatIntervalSeconds Number
    The project alert rule wait seconds. Default: 3600 (int)
    severity String
    The project alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    workloadRule Property Map
    The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)

    Outputs

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

    Get an existing ProjectAlertRule 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?: ProjectAlertRuleState, opts?: CustomResourceOptions): ProjectAlertRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            annotations: Optional[Mapping[str, Any]] = None,
            group_id: Optional[str] = None,
            group_interval_seconds: Optional[int] = None,
            group_wait_seconds: Optional[int] = None,
            inherited: Optional[bool] = None,
            labels: Optional[Mapping[str, Any]] = None,
            metric_rule: Optional[ProjectAlertRuleMetricRuleArgs] = None,
            name: Optional[str] = None,
            pod_rule: Optional[ProjectAlertRulePodRuleArgs] = None,
            project_id: Optional[str] = None,
            repeat_interval_seconds: Optional[int] = None,
            severity: Optional[str] = None,
            workload_rule: Optional[ProjectAlertRuleWorkloadRuleArgs] = None) -> ProjectAlertRule
    func GetProjectAlertRule(ctx *Context, name string, id IDInput, state *ProjectAlertRuleState, opts ...ResourceOption) (*ProjectAlertRule, error)
    public static ProjectAlertRule Get(string name, Input<string> id, ProjectAlertRuleState? state, CustomResourceOptions? opts = null)
    public static ProjectAlertRule get(String name, Output<String> id, ProjectAlertRuleState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Annotations Dictionary<string, object>
    The project alert rule annotations (map)
    GroupId string
    The project alert rule alert group ID (string)
    GroupIntervalSeconds int
    The project alert rule group interval seconds. Default: 180 (int)
    GroupWaitSeconds int
    The project alert rule group wait seconds. Default: 180 (int)
    Inherited bool
    The project alert rule inherited. Default: true (bool)
    Labels Dictionary<string, object>
    The project alert rule labels (map)
    MetricRule ProjectAlertRuleMetricRule
    The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
    Name string
    The project alert rule name (string)
    PodRule ProjectAlertRulePodRule
    The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
    ProjectId string
    The project id where create project alert rule (string)
    RepeatIntervalSeconds int
    The project alert rule wait seconds. Default: 3600 (int)
    Severity string
    The project alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    WorkloadRule ProjectAlertRuleWorkloadRule
    The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)
    Annotations map[string]interface{}
    The project alert rule annotations (map)
    GroupId string
    The project alert rule alert group ID (string)
    GroupIntervalSeconds int
    The project alert rule group interval seconds. Default: 180 (int)
    GroupWaitSeconds int
    The project alert rule group wait seconds. Default: 180 (int)
    Inherited bool
    The project alert rule inherited. Default: true (bool)
    Labels map[string]interface{}
    The project alert rule labels (map)
    MetricRule ProjectAlertRuleMetricRuleArgs
    The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
    Name string
    The project alert rule name (string)
    PodRule ProjectAlertRulePodRuleArgs
    The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
    ProjectId string
    The project id where create project alert rule (string)
    RepeatIntervalSeconds int
    The project alert rule wait seconds. Default: 3600 (int)
    Severity string
    The project alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    WorkloadRule ProjectAlertRuleWorkloadRuleArgs
    The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)
    annotations Map<String,Object>
    The project alert rule annotations (map)
    groupId String
    The project alert rule alert group ID (string)
    groupIntervalSeconds Integer
    The project alert rule group interval seconds. Default: 180 (int)
    groupWaitSeconds Integer
    The project alert rule group wait seconds. Default: 180 (int)
    inherited Boolean
    The project alert rule inherited. Default: true (bool)
    labels Map<String,Object>
    The project alert rule labels (map)
    metricRule ProjectAlertRuleMetricRule
    The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
    name String
    The project alert rule name (string)
    podRule ProjectAlertRulePodRule
    The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
    projectId String
    The project id where create project alert rule (string)
    repeatIntervalSeconds Integer
    The project alert rule wait seconds. Default: 3600 (int)
    severity String
    The project alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    workloadRule ProjectAlertRuleWorkloadRule
    The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)
    annotations {[key: string]: any}
    The project alert rule annotations (map)
    groupId string
    The project alert rule alert group ID (string)
    groupIntervalSeconds number
    The project alert rule group interval seconds. Default: 180 (int)
    groupWaitSeconds number
    The project alert rule group wait seconds. Default: 180 (int)
    inherited boolean
    The project alert rule inherited. Default: true (bool)
    labels {[key: string]: any}
    The project alert rule labels (map)
    metricRule ProjectAlertRuleMetricRule
    The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
    name string
    The project alert rule name (string)
    podRule ProjectAlertRulePodRule
    The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
    projectId string
    The project id where create project alert rule (string)
    repeatIntervalSeconds number
    The project alert rule wait seconds. Default: 3600 (int)
    severity string
    The project alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    workloadRule ProjectAlertRuleWorkloadRule
    The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)
    annotations Mapping[str, Any]
    The project alert rule annotations (map)
    group_id str
    The project alert rule alert group ID (string)
    group_interval_seconds int
    The project alert rule group interval seconds. Default: 180 (int)
    group_wait_seconds int
    The project alert rule group wait seconds. Default: 180 (int)
    inherited bool
    The project alert rule inherited. Default: true (bool)
    labels Mapping[str, Any]
    The project alert rule labels (map)
    metric_rule ProjectAlertRuleMetricRuleArgs
    The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
    name str
    The project alert rule name (string)
    pod_rule ProjectAlertRulePodRuleArgs
    The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
    project_id str
    The project id where create project alert rule (string)
    repeat_interval_seconds int
    The project alert rule wait seconds. Default: 3600 (int)
    severity str
    The project alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    workload_rule ProjectAlertRuleWorkloadRuleArgs
    The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)
    annotations Map<Any>
    The project alert rule annotations (map)
    groupId String
    The project alert rule alert group ID (string)
    groupIntervalSeconds Number
    The project alert rule group interval seconds. Default: 180 (int)
    groupWaitSeconds Number
    The project alert rule group wait seconds. Default: 180 (int)
    inherited Boolean
    The project alert rule inherited. Default: true (bool)
    labels Map<Any>
    The project alert rule labels (map)
    metricRule Property Map
    The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
    name String
    The project alert rule name (string)
    podRule Property Map
    The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
    projectId String
    The project id where create project alert rule (string)
    repeatIntervalSeconds Number
    The project alert rule wait seconds. Default: 3600 (int)
    severity String
    The project alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    workloadRule Property Map
    The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)

    Supporting Types

    ProjectAlertRuleMetricRule, ProjectAlertRuleMetricRuleArgs

    Duration string
    Metric rule duration (string)
    Expression string
    Metric rule expression (string)
    ThresholdValue double
    Metric rule threshold value (float64)
    Comparison string
    Metric rule comparison. Supported values : "equal" | "greater-or-equal" | "greater-than" | "less-or-equal" | "less-than" | "not-equal" | "has-value". Default: equal (string)
    Description string
    Metric rule description (string)
    Duration string
    Metric rule duration (string)
    Expression string
    Metric rule expression (string)
    ThresholdValue float64
    Metric rule threshold value (float64)
    Comparison string
    Metric rule comparison. Supported values : "equal" | "greater-or-equal" | "greater-than" | "less-or-equal" | "less-than" | "not-equal" | "has-value". Default: equal (string)
    Description string
    Metric rule description (string)
    duration String
    Metric rule duration (string)
    expression String
    Metric rule expression (string)
    thresholdValue Double
    Metric rule threshold value (float64)
    comparison String
    Metric rule comparison. Supported values : "equal" | "greater-or-equal" | "greater-than" | "less-or-equal" | "less-than" | "not-equal" | "has-value". Default: equal (string)
    description String
    Metric rule description (string)
    duration string
    Metric rule duration (string)
    expression string
    Metric rule expression (string)
    thresholdValue number
    Metric rule threshold value (float64)
    comparison string
    Metric rule comparison. Supported values : "equal" | "greater-or-equal" | "greater-than" | "less-or-equal" | "less-than" | "not-equal" | "has-value". Default: equal (string)
    description string
    Metric rule description (string)
    duration str
    Metric rule duration (string)
    expression str
    Metric rule expression (string)
    threshold_value float
    Metric rule threshold value (float64)
    comparison str
    Metric rule comparison. Supported values : "equal" | "greater-or-equal" | "greater-than" | "less-or-equal" | "less-than" | "not-equal" | "has-value". Default: equal (string)
    description str
    Metric rule description (string)
    duration String
    Metric rule duration (string)
    expression String
    Metric rule expression (string)
    thresholdValue Number
    Metric rule threshold value (float64)
    comparison String
    Metric rule comparison. Supported values : "equal" | "greater-or-equal" | "greater-than" | "less-or-equal" | "less-than" | "not-equal" | "has-value". Default: equal (string)
    description String
    Metric rule description (string)

    ProjectAlertRulePodRule, ProjectAlertRulePodRuleArgs

    PodId string
    Pod ID (string)
    Condition string
    Pod rule condition. Supported values : "notrunning" | "notscheduled" | "restarts". Default: notrunning (string)
    RestartIntervalSeconds int
    Pod rule restart interval seconds. Default: 300 (int)
    RestartTimes int
    Pod rule restart times. Default: 3 (int)
    PodId string
    Pod ID (string)
    Condition string
    Pod rule condition. Supported values : "notrunning" | "notscheduled" | "restarts". Default: notrunning (string)
    RestartIntervalSeconds int
    Pod rule restart interval seconds. Default: 300 (int)
    RestartTimes int
    Pod rule restart times. Default: 3 (int)
    podId String
    Pod ID (string)
    condition String
    Pod rule condition. Supported values : "notrunning" | "notscheduled" | "restarts". Default: notrunning (string)
    restartIntervalSeconds Integer
    Pod rule restart interval seconds. Default: 300 (int)
    restartTimes Integer
    Pod rule restart times. Default: 3 (int)
    podId string
    Pod ID (string)
    condition string
    Pod rule condition. Supported values : "notrunning" | "notscheduled" | "restarts". Default: notrunning (string)
    restartIntervalSeconds number
    Pod rule restart interval seconds. Default: 300 (int)
    restartTimes number
    Pod rule restart times. Default: 3 (int)
    pod_id str
    Pod ID (string)
    condition str
    Pod rule condition. Supported values : "notrunning" | "notscheduled" | "restarts". Default: notrunning (string)
    restart_interval_seconds int
    Pod rule restart interval seconds. Default: 300 (int)
    restart_times int
    Pod rule restart times. Default: 3 (int)
    podId String
    Pod ID (string)
    condition String
    Pod rule condition. Supported values : "notrunning" | "notscheduled" | "restarts". Default: notrunning (string)
    restartIntervalSeconds Number
    Pod rule restart interval seconds. Default: 300 (int)
    restartTimes Number
    Pod rule restart times. Default: 3 (int)

    ProjectAlertRuleWorkloadRule, ProjectAlertRuleWorkloadRuleArgs

    AvailablePercentage int
    Workload rule available percentage. Default: 70 (int)
    Selector Dictionary<string, object>
    Workload rule selector (map)
    WorkloadId string
    Workload ID (string)
    AvailablePercentage int
    Workload rule available percentage. Default: 70 (int)
    Selector map[string]interface{}
    Workload rule selector (map)
    WorkloadId string
    Workload ID (string)
    availablePercentage Integer
    Workload rule available percentage. Default: 70 (int)
    selector Map<String,Object>
    Workload rule selector (map)
    workloadId String
    Workload ID (string)
    availablePercentage number
    Workload rule available percentage. Default: 70 (int)
    selector {[key: string]: any}
    Workload rule selector (map)
    workloadId string
    Workload ID (string)
    available_percentage int
    Workload rule available percentage. Default: 70 (int)
    selector Mapping[str, Any]
    Workload rule selector (map)
    workload_id str
    Workload ID (string)
    availablePercentage Number
    Workload rule available percentage. Default: 70 (int)
    selector Map<Any>
    Workload rule selector (map)
    workloadId String
    Workload ID (string)

    Import

    Project Alert Rule can be imported using the Rancher project alert rule ID

    $ pulumi import rancher2:index/projectAlertRule:ProjectAlertRule foo &lt;project_alert_rule_id&gt;
    

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

    Package Details

    Repository
    Rancher2 pulumi/pulumi-rancher2
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the rancher2 Terraform Provider.
    rancher2 logo
    Rancher 2 v6.1.0 published on Tuesday, Mar 12, 2024 by Pulumi