rancher2.ProjectAlertRule
Explore with Pulumi AI
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 foo = new rancher2.Project("foo", {
name: "foo",
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("foo", {
name: "foo",
description: "Terraform project alert group",
projectId: foo.id,
groupIntervalSeconds: 300,
repeatIntervalSeconds: 3600,
});
// Create a new Rancher2 Project Alert Rule
const fooProjectAlertRule = new rancher2.ProjectAlertRule("foo", {
projectId: fooProjectAlertGroup.projectId,
groupId: fooProjectAlertGroup.id,
name: "foo",
groupIntervalSeconds: 600,
repeatIntervalSeconds: 6000,
});
import pulumi
import pulumi_rancher2 as rancher2
# Create a new Rancher2 Project
foo = rancher2.Project("foo",
name="foo",
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("foo",
name="foo",
description="Terraform project alert group",
project_id=foo.id,
group_interval_seconds=300,
repeat_interval_seconds=3600)
# Create a new Rancher2 Project Alert Rule
foo_project_alert_rule = rancher2.ProjectAlertRule("foo",
project_id=foo_project_alert_group.project_id,
group_id=foo_project_alert_group.id,
name="foo",
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
foo, err := rancher2.NewProject(ctx, "foo", &rancher2.ProjectArgs{
Name: pulumi.String("foo"),
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, "foo", &rancher2.ProjectAlertGroupArgs{
Name: pulumi.String("foo"),
Description: pulumi.String("Terraform project alert group"),
ProjectId: foo.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, "foo", &rancher2.ProjectAlertRuleArgs{
ProjectId: fooProjectAlertGroup.ProjectId,
GroupId: fooProjectAlertGroup.ID(),
Name: pulumi.String("foo"),
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 foo = new Rancher2.Project("foo", new()
{
Name = "foo",
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("foo", new()
{
Name = "foo",
Description = "Terraform project alert group",
ProjectId = foo.Id,
GroupIntervalSeconds = 300,
RepeatIntervalSeconds = 3600,
});
// Create a new Rancher2 Project Alert Rule
var fooProjectAlertRule = new Rancher2.ProjectAlertRule("foo", new()
{
ProjectId = fooProjectAlertGroup.ProjectId,
GroupId = fooProjectAlertGroup.Id,
Name = "foo",
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) {
// Create a new Rancher2 Project
var foo = new Project("foo", ProjectArgs.builder()
.name("foo")
.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());
// Create a new Rancher2 Project Alert Group
var fooProjectAlertGroup = new ProjectAlertGroup("fooProjectAlertGroup", ProjectAlertGroupArgs.builder()
.name("foo")
.description("Terraform project alert group")
.projectId(foo.id())
.groupIntervalSeconds(300)
.repeatIntervalSeconds(3600)
.build());
// Create a new Rancher2 Project Alert Rule
var fooProjectAlertRule = new ProjectAlertRule("fooProjectAlertRule", ProjectAlertRuleArgs.builder()
.projectId(fooProjectAlertGroup.projectId())
.groupId(fooProjectAlertGroup.id())
.name("foo")
.groupIntervalSeconds(600)
.repeatIntervalSeconds(6000)
.build());
}
}
resources:
# Create a new Rancher2 Project
foo:
type: rancher2:Project
properties:
name: foo
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
name: foo
properties:
name: foo
description: Terraform project alert group
projectId: ${foo.id}
groupIntervalSeconds: 300
repeatIntervalSeconds: 3600
# Create a new Rancher2 Project Alert Rule
fooProjectAlertRule:
type: rancher2:ProjectAlertRule
name: foo
properties:
projectId: ${fooProjectAlertGroup.projectId}
groupId: ${fooProjectAlertGroup.id}
name: foo
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.
Constructor 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:
- Group
Id string - The project alert rule alert group ID (string)
- Project
Id string - The project id where create project alert rule (string)
- Annotations Dictionary<string, object>
- The project alert rule annotations (map)
- Group
Interval intSeconds - The project alert rule group interval seconds. Default:
180
(int) - Group
Wait intSeconds - 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)
- Metric
Rule ProjectAlert Rule Metric Rule - The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
- Name string
- The project alert rule name (string)
- Pod
Rule ProjectAlert Rule Pod Rule - The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
- Repeat
Interval intSeconds - The project alert rule wait seconds. Default:
3600
(int) - Severity string
- The project alert rule severity. Supported values :
"critical" | "info" | "warning"
. Default:critical
(string) - Workload
Rule ProjectAlert Rule Workload Rule - The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)
- Group
Id string - The project alert rule alert group ID (string)
- Project
Id string - The project id where create project alert rule (string)
- Annotations map[string]interface{}
- The project alert rule annotations (map)
- Group
Interval intSeconds - The project alert rule group interval seconds. Default:
180
(int) - Group
Wait intSeconds - 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)
- Metric
Rule ProjectAlert Rule Metric Rule Args - The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
- Name string
- The project alert rule name (string)
- Pod
Rule ProjectAlert Rule Pod Rule Args - The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
- Repeat
Interval intSeconds - The project alert rule wait seconds. Default:
3600
(int) - Severity string
- The project alert rule severity. Supported values :
"critical" | "info" | "warning"
. Default:critical
(string) - Workload
Rule ProjectAlert Rule Workload Rule Args - The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)
- group
Id String - The project alert rule alert group ID (string)
- project
Id String - The project id where create project alert rule (string)
- annotations Map<String,Object>
- The project alert rule annotations (map)
- group
Interval IntegerSeconds - The project alert rule group interval seconds. Default:
180
(int) - group
Wait IntegerSeconds - 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)
- metric
Rule ProjectAlert Rule Metric Rule - The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
- name String
- The project alert rule name (string)
- pod
Rule ProjectAlert Rule Pod Rule - The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
- repeat
Interval IntegerSeconds - The project alert rule wait seconds. Default:
3600
(int) - severity String
- The project alert rule severity. Supported values :
"critical" | "info" | "warning"
. Default:critical
(string) - workload
Rule ProjectAlert Rule Workload Rule - The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)
- group
Id string - The project alert rule alert group ID (string)
- project
Id string - The project id where create project alert rule (string)
- annotations {[key: string]: any}
- The project alert rule annotations (map)
- group
Interval numberSeconds - The project alert rule group interval seconds. Default:
180
(int) - group
Wait numberSeconds - 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)
- metric
Rule ProjectAlert Rule Metric Rule - The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
- name string
- The project alert rule name (string)
- pod
Rule ProjectAlert Rule Pod Rule - The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
- repeat
Interval numberSeconds - The project alert rule wait seconds. Default:
3600
(int) - severity string
- The project alert rule severity. Supported values :
"critical" | "info" | "warning"
. Default:critical
(string) - workload
Rule ProjectAlert Rule Workload Rule - 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_ intseconds - The project alert rule group interval seconds. Default:
180
(int) - group_
wait_ intseconds - 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 ProjectAlert Rule Metric Rule Args - The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
- name str
- The project alert rule name (string)
- pod_
rule ProjectAlert Rule Pod Rule Args - The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
- repeat_
interval_ intseconds - 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 ProjectAlert Rule Workload Rule Args - The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)
- group
Id String - The project alert rule alert group ID (string)
- project
Id String - The project id where create project alert rule (string)
- annotations Map<Any>
- The project alert rule annotations (map)
- group
Interval NumberSeconds - The project alert rule group interval seconds. Default:
180
(int) - group
Wait NumberSeconds - 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)
- metric
Rule Property Map - The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
- name String
- The project alert rule name (string)
- pod
Rule Property Map - The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
- repeat
Interval NumberSeconds - The project alert rule wait seconds. Default:
3600
(int) - severity String
- The project alert rule severity. Supported values :
"critical" | "info" | "warning"
. Default:critical
(string) - workload
Rule 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.
- Annotations Dictionary<string, object>
- The project alert rule annotations (map)
- Group
Id string - The project alert rule alert group ID (string)
- Group
Interval intSeconds - The project alert rule group interval seconds. Default:
180
(int) - Group
Wait intSeconds - 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)
- Metric
Rule ProjectAlert Rule Metric Rule - The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
- Name string
- The project alert rule name (string)
- Pod
Rule ProjectAlert Rule Pod Rule - The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
- Project
Id string - The project id where create project alert rule (string)
- Repeat
Interval intSeconds - The project alert rule wait seconds. Default:
3600
(int) - Severity string
- The project alert rule severity. Supported values :
"critical" | "info" | "warning"
. Default:critical
(string) - Workload
Rule ProjectAlert Rule Workload Rule - The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)
- Annotations map[string]interface{}
- The project alert rule annotations (map)
- Group
Id string - The project alert rule alert group ID (string)
- Group
Interval intSeconds - The project alert rule group interval seconds. Default:
180
(int) - Group
Wait intSeconds - 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)
- Metric
Rule ProjectAlert Rule Metric Rule Args - The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
- Name string
- The project alert rule name (string)
- Pod
Rule ProjectAlert Rule Pod Rule Args - The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
- Project
Id string - The project id where create project alert rule (string)
- Repeat
Interval intSeconds - The project alert rule wait seconds. Default:
3600
(int) - Severity string
- The project alert rule severity. Supported values :
"critical" | "info" | "warning"
. Default:critical
(string) - Workload
Rule ProjectAlert Rule Workload Rule Args - The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)
- annotations Map<String,Object>
- The project alert rule annotations (map)
- group
Id String - The project alert rule alert group ID (string)
- group
Interval IntegerSeconds - The project alert rule group interval seconds. Default:
180
(int) - group
Wait IntegerSeconds - 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)
- metric
Rule ProjectAlert Rule Metric Rule - The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
- name String
- The project alert rule name (string)
- pod
Rule ProjectAlert Rule Pod Rule - The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
- project
Id String - The project id where create project alert rule (string)
- repeat
Interval IntegerSeconds - The project alert rule wait seconds. Default:
3600
(int) - severity String
- The project alert rule severity. Supported values :
"critical" | "info" | "warning"
. Default:critical
(string) - workload
Rule ProjectAlert Rule Workload Rule - The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)
- annotations {[key: string]: any}
- The project alert rule annotations (map)
- group
Id string - The project alert rule alert group ID (string)
- group
Interval numberSeconds - The project alert rule group interval seconds. Default:
180
(int) - group
Wait numberSeconds - 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)
- metric
Rule ProjectAlert Rule Metric Rule - The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
- name string
- The project alert rule name (string)
- pod
Rule ProjectAlert Rule Pod Rule - The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
- project
Id string - The project id where create project alert rule (string)
- repeat
Interval numberSeconds - The project alert rule wait seconds. Default:
3600
(int) - severity string
- The project alert rule severity. Supported values :
"critical" | "info" | "warning"
. Default:critical
(string) - workload
Rule ProjectAlert Rule Workload Rule - 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_ intseconds - The project alert rule group interval seconds. Default:
180
(int) - group_
wait_ intseconds - 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 ProjectAlert Rule Metric Rule Args - The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
- name str
- The project alert rule name (string)
- pod_
rule ProjectAlert Rule Pod Rule Args - 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_ intseconds - 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 ProjectAlert Rule Workload Rule Args - The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)
- annotations Map<Any>
- The project alert rule annotations (map)
- group
Id String - The project alert rule alert group ID (string)
- group
Interval NumberSeconds - The project alert rule group interval seconds. Default:
180
(int) - group
Wait NumberSeconds - 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)
- metric
Rule Property Map - The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
- name String
- The project alert rule name (string)
- pod
Rule Property Map - The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1)
- project
Id String - The project id where create project alert rule (string)
- repeat
Interval NumberSeconds - The project alert rule wait seconds. Default:
3600
(int) - severity String
- The project alert rule severity. Supported values :
"critical" | "info" | "warning"
. Default:critical
(string) - workload
Rule 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
- Expression string
- Metric rule expression
- Threshold
Value double - Metric rule threshold value
- Comparison string
- Metric rule comparison
- Description string
- Metric rule description
- Duration string
- Metric rule duration
- Expression string
- Metric rule expression
- Threshold
Value float64 - Metric rule threshold value
- Comparison string
- Metric rule comparison
- Description string
- Metric rule description
- duration String
- Metric rule duration
- expression String
- Metric rule expression
- threshold
Value Double - Metric rule threshold value
- comparison String
- Metric rule comparison
- description String
- Metric rule description
- duration string
- Metric rule duration
- expression string
- Metric rule expression
- threshold
Value number - Metric rule threshold value
- comparison string
- Metric rule comparison
- description string
- Metric rule description
- duration str
- Metric rule duration
- expression str
- Metric rule expression
- threshold_
value float - Metric rule threshold value
- comparison str
- Metric rule comparison
- description str
- Metric rule description
- duration String
- Metric rule duration
- expression String
- Metric rule expression
- threshold
Value Number - Metric rule threshold value
- comparison String
- Metric rule comparison
- description String
- Metric rule description
ProjectAlertRulePodRule, ProjectAlertRulePodRuleArgs
- Pod
Id string - Pod ID
- Condition string
- Pod rule condition
- Restart
Interval intSeconds - Pod rule restart interval seconds
- Restart
Times int - Pod rule restart times
- Pod
Id string - Pod ID
- Condition string
- Pod rule condition
- Restart
Interval intSeconds - Pod rule restart interval seconds
- Restart
Times int - Pod rule restart times
- pod
Id String - Pod ID
- condition String
- Pod rule condition
- restart
Interval IntegerSeconds - Pod rule restart interval seconds
- restart
Times Integer - Pod rule restart times
- pod
Id string - Pod ID
- condition string
- Pod rule condition
- restart
Interval numberSeconds - Pod rule restart interval seconds
- restart
Times number - Pod rule restart times
- pod_
id str - Pod ID
- condition str
- Pod rule condition
- restart_
interval_ intseconds - Pod rule restart interval seconds
- restart_
times int - Pod rule restart times
- pod
Id String - Pod ID
- condition String
- Pod rule condition
- restart
Interval NumberSeconds - Pod rule restart interval seconds
- restart
Times Number - Pod rule restart times
ProjectAlertRuleWorkloadRule, ProjectAlertRuleWorkloadRuleArgs
- Available
Percentage int - Workload rule available percentage
- Selector Dictionary<string, object>
- Workload rule selector
- Workload
Id string - Workload ID
- Available
Percentage int - Workload rule available percentage
- Selector map[string]interface{}
- Workload rule selector
- Workload
Id string - Workload ID
- available
Percentage Integer - Workload rule available percentage
- selector Map<String,Object>
- Workload rule selector
- workload
Id String - Workload ID
- available
Percentage number - Workload rule available percentage
- selector {[key: string]: any}
- Workload rule selector
- workload
Id string - Workload ID
- available_
percentage int - Workload rule available percentage
- selector Mapping[str, Any]
- Workload rule selector
- workload_
id str - Workload ID
- available
Percentage Number - Workload rule available percentage
- selector Map<Any>
- Workload rule selector
- workload
Id String - Workload ID
Import
Project Alert Rule can be imported using the Rancher project alert rule ID
$ pulumi import rancher2:index/projectAlertRule:ProjectAlertRule foo <project_alert_rule_id>
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.