sysdig.MonitorInhibitionRule
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as sysdig from "@pulumi/sysdig";
const sample = new sysdig.MonitorInhibitionRule("sample", {
description: "Example description",
enabled: true,
equals: ["kube_cluster_name"],
sourceMatchers: [
{
labelName: "alertname",
operator: "EQUALS",
value: "networkAlert",
},
{
labelName: "device_type",
operator: "EQUALS",
value: "firewall",
},
],
targetMatchers: [{
labelName: "device_type",
operator: "REGEXP_MATCHES",
value: ".*server.*",
}],
});
import pulumi
import pulumi_sysdig as sysdig
sample = sysdig.MonitorInhibitionRule("sample",
description="Example description",
enabled=True,
equals=["kube_cluster_name"],
source_matchers=[
{
"label_name": "alertname",
"operator": "EQUALS",
"value": "networkAlert",
},
{
"label_name": "device_type",
"operator": "EQUALS",
"value": "firewall",
},
],
target_matchers=[{
"label_name": "device_type",
"operator": "REGEXP_MATCHES",
"value": ".*server.*",
}])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/sysdig/sysdig"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sysdig.NewMonitorInhibitionRule(ctx, "sample", &sysdig.MonitorInhibitionRuleArgs{
Description: pulumi.String("Example description"),
Enabled: pulumi.Bool(true),
Equals: pulumi.StringArray{
pulumi.String("kube_cluster_name"),
},
SourceMatchers: sysdig.MonitorInhibitionRuleSourceMatcherArray{
&sysdig.MonitorInhibitionRuleSourceMatcherArgs{
LabelName: pulumi.String("alertname"),
Operator: pulumi.String("EQUALS"),
Value: pulumi.String("networkAlert"),
},
&sysdig.MonitorInhibitionRuleSourceMatcherArgs{
LabelName: pulumi.String("device_type"),
Operator: pulumi.String("EQUALS"),
Value: pulumi.String("firewall"),
},
},
TargetMatchers: sysdig.MonitorInhibitionRuleTargetMatcherArray{
&sysdig.MonitorInhibitionRuleTargetMatcherArgs{
LabelName: pulumi.String("device_type"),
Operator: pulumi.String("REGEXP_MATCHES"),
Value: pulumi.String(".*server.*"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Sysdig = Pulumi.Sysdig;
return await Deployment.RunAsync(() =>
{
var sample = new Sysdig.MonitorInhibitionRule("sample", new()
{
Description = "Example description",
Enabled = true,
Equals = new[]
{
"kube_cluster_name",
},
SourceMatchers = new[]
{
new Sysdig.Inputs.MonitorInhibitionRuleSourceMatcherArgs
{
LabelName = "alertname",
Operator = "EQUALS",
Value = "networkAlert",
},
new Sysdig.Inputs.MonitorInhibitionRuleSourceMatcherArgs
{
LabelName = "device_type",
Operator = "EQUALS",
Value = "firewall",
},
},
TargetMatchers = new[]
{
new Sysdig.Inputs.MonitorInhibitionRuleTargetMatcherArgs
{
LabelName = "device_type",
Operator = "REGEXP_MATCHES",
Value = ".*server.*",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.sysdig.MonitorInhibitionRule;
import com.pulumi.sysdig.MonitorInhibitionRuleArgs;
import com.pulumi.sysdig.inputs.MonitorInhibitionRuleSourceMatcherArgs;
import com.pulumi.sysdig.inputs.MonitorInhibitionRuleTargetMatcherArgs;
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 sample = new MonitorInhibitionRule("sample", MonitorInhibitionRuleArgs.builder()
.description("Example description")
.enabled(true)
.equals("kube_cluster_name")
.sourceMatchers(
MonitorInhibitionRuleSourceMatcherArgs.builder()
.labelName("alertname")
.operator("EQUALS")
.value("networkAlert")
.build(),
MonitorInhibitionRuleSourceMatcherArgs.builder()
.labelName("device_type")
.operator("EQUALS")
.value("firewall")
.build())
.targetMatchers(MonitorInhibitionRuleTargetMatcherArgs.builder()
.labelName("device_type")
.operator("REGEXP_MATCHES")
.value(".*server.*")
.build())
.build());
}
}
resources:
sample:
type: sysdig:MonitorInhibitionRule
properties:
description: Example description
enabled: true
equals:
- kube_cluster_name
sourceMatchers:
- labelName: alertname
operator: EQUALS
value: networkAlert
- labelName: device_type
operator: EQUALS
value: firewall
targetMatchers:
- labelName: device_type
operator: REGEXP_MATCHES
value: .*server.*
Create MonitorInhibitionRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MonitorInhibitionRule(name: string, args: MonitorInhibitionRuleArgs, opts?: CustomResourceOptions);
@overload
def MonitorInhibitionRule(resource_name: str,
args: MonitorInhibitionRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MonitorInhibitionRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
source_matchers: Optional[Sequence[MonitorInhibitionRuleSourceMatcherArgs]] = None,
target_matchers: Optional[Sequence[MonitorInhibitionRuleTargetMatcherArgs]] = None,
description: Optional[str] = None,
enabled: Optional[bool] = None,
equals: Optional[Sequence[str]] = None,
monitor_inhibition_rule_id: Optional[str] = None,
name: Optional[str] = None,
timeouts: Optional[MonitorInhibitionRuleTimeoutsArgs] = None)
func NewMonitorInhibitionRule(ctx *Context, name string, args MonitorInhibitionRuleArgs, opts ...ResourceOption) (*MonitorInhibitionRule, error)
public MonitorInhibitionRule(string name, MonitorInhibitionRuleArgs args, CustomResourceOptions? opts = null)
public MonitorInhibitionRule(String name, MonitorInhibitionRuleArgs args)
public MonitorInhibitionRule(String name, MonitorInhibitionRuleArgs args, CustomResourceOptions options)
type: sysdig:MonitorInhibitionRule
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 MonitorInhibitionRuleArgs
- 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 MonitorInhibitionRuleArgs
- 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 MonitorInhibitionRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MonitorInhibitionRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MonitorInhibitionRuleArgs
- 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 monitorInhibitionRuleResource = new Sysdig.MonitorInhibitionRule("monitorInhibitionRuleResource", new()
{
SourceMatchers = new[]
{
new Sysdig.Inputs.MonitorInhibitionRuleSourceMatcherArgs
{
LabelName = "string",
Operator = "string",
Value = "string",
},
},
TargetMatchers = new[]
{
new Sysdig.Inputs.MonitorInhibitionRuleTargetMatcherArgs
{
LabelName = "string",
Operator = "string",
Value = "string",
},
},
Description = "string",
Enabled = false,
Equals = new[]
{
"string",
},
MonitorInhibitionRuleId = "string",
Name = "string",
Timeouts = new Sysdig.Inputs.MonitorInhibitionRuleTimeoutsArgs
{
Create = "string",
Delete = "string",
Read = "string",
Update = "string",
},
});
example, err := sysdig.NewMonitorInhibitionRule(ctx, "monitorInhibitionRuleResource", &sysdig.MonitorInhibitionRuleArgs{
SourceMatchers: sysdig.MonitorInhibitionRuleSourceMatcherArray{
&sysdig.MonitorInhibitionRuleSourceMatcherArgs{
LabelName: pulumi.String("string"),
Operator: pulumi.String("string"),
Value: pulumi.String("string"),
},
},
TargetMatchers: sysdig.MonitorInhibitionRuleTargetMatcherArray{
&sysdig.MonitorInhibitionRuleTargetMatcherArgs{
LabelName: pulumi.String("string"),
Operator: pulumi.String("string"),
Value: pulumi.String("string"),
},
},
Description: pulumi.String("string"),
Enabled: pulumi.Bool(false),
Equals: pulumi.StringArray{
pulumi.String("string"),
},
MonitorInhibitionRuleId: pulumi.String("string"),
Name: pulumi.String("string"),
Timeouts: &sysdig.MonitorInhibitionRuleTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
Read: pulumi.String("string"),
Update: pulumi.String("string"),
},
})
var monitorInhibitionRuleResource = new MonitorInhibitionRule("monitorInhibitionRuleResource", MonitorInhibitionRuleArgs.builder()
.sourceMatchers(MonitorInhibitionRuleSourceMatcherArgs.builder()
.labelName("string")
.operator("string")
.value("string")
.build())
.targetMatchers(MonitorInhibitionRuleTargetMatcherArgs.builder()
.labelName("string")
.operator("string")
.value("string")
.build())
.description("string")
.enabled(false)
.equals("string")
.monitorInhibitionRuleId("string")
.name("string")
.timeouts(MonitorInhibitionRuleTimeoutsArgs.builder()
.create("string")
.delete("string")
.read("string")
.update("string")
.build())
.build());
monitor_inhibition_rule_resource = sysdig.MonitorInhibitionRule("monitorInhibitionRuleResource",
source_matchers=[{
"label_name": "string",
"operator": "string",
"value": "string",
}],
target_matchers=[{
"label_name": "string",
"operator": "string",
"value": "string",
}],
description="string",
enabled=False,
equals=["string"],
monitor_inhibition_rule_id="string",
name="string",
timeouts={
"create": "string",
"delete": "string",
"read": "string",
"update": "string",
})
const monitorInhibitionRuleResource = new sysdig.MonitorInhibitionRule("monitorInhibitionRuleResource", {
sourceMatchers: [{
labelName: "string",
operator: "string",
value: "string",
}],
targetMatchers: [{
labelName: "string",
operator: "string",
value: "string",
}],
description: "string",
enabled: false,
equals: ["string"],
monitorInhibitionRuleId: "string",
name: "string",
timeouts: {
create: "string",
"delete": "string",
read: "string",
update: "string",
},
});
type: sysdig:MonitorInhibitionRule
properties:
description: string
enabled: false
equals:
- string
monitorInhibitionRuleId: string
name: string
sourceMatchers:
- labelName: string
operator: string
value: string
targetMatchers:
- labelName: string
operator: string
value: string
timeouts:
create: string
delete: string
read: string
update: string
MonitorInhibitionRule 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 MonitorInhibitionRule resource accepts the following input properties:
- Source
Matchers List<MonitorInhibition Rule Source Matcher> - Target
Matchers List<MonitorInhibition Rule Target Matcher> - Description string
- The description of the Inhibition Rule.
- Enabled bool
- Whether to enable the Inhibition Rule. Default:
true
. - Equals List<string>
- List of label names that must have identical values in both the source and target alert occurrences for the inhibition rule to apply.
- Monitor
Inhibition stringRule Id - (Computed) The ID of the Inhibition Rule.
- Name string
- The name of the Inhibition Rule. If provided, it must be unique.
- Timeouts
Monitor
Inhibition Rule Timeouts
- Source
Matchers []MonitorInhibition Rule Source Matcher Args - Target
Matchers []MonitorInhibition Rule Target Matcher Args - Description string
- The description of the Inhibition Rule.
- Enabled bool
- Whether to enable the Inhibition Rule. Default:
true
. - Equals []string
- List of label names that must have identical values in both the source and target alert occurrences for the inhibition rule to apply.
- Monitor
Inhibition stringRule Id - (Computed) The ID of the Inhibition Rule.
- Name string
- The name of the Inhibition Rule. If provided, it must be unique.
- Timeouts
Monitor
Inhibition Rule Timeouts Args
- source
Matchers List<MonitorInhibition Rule Source Matcher> - target
Matchers List<MonitorInhibition Rule Target Matcher> - description String
- The description of the Inhibition Rule.
- enabled Boolean
- Whether to enable the Inhibition Rule. Default:
true
. - equals_ List<String>
- List of label names that must have identical values in both the source and target alert occurrences for the inhibition rule to apply.
- monitor
Inhibition StringRule Id - (Computed) The ID of the Inhibition Rule.
- name String
- The name of the Inhibition Rule. If provided, it must be unique.
- timeouts
Monitor
Inhibition Rule Timeouts
- source
Matchers MonitorInhibition Rule Source Matcher[] - target
Matchers MonitorInhibition Rule Target Matcher[] - description string
- The description of the Inhibition Rule.
- enabled boolean
- Whether to enable the Inhibition Rule. Default:
true
. - equals string[]
- List of label names that must have identical values in both the source and target alert occurrences for the inhibition rule to apply.
- monitor
Inhibition stringRule Id - (Computed) The ID of the Inhibition Rule.
- name string
- The name of the Inhibition Rule. If provided, it must be unique.
- timeouts
Monitor
Inhibition Rule Timeouts
- source_
matchers Sequence[MonitorInhibition Rule Source Matcher Args] - target_
matchers Sequence[MonitorInhibition Rule Target Matcher Args] - description str
- The description of the Inhibition Rule.
- enabled bool
- Whether to enable the Inhibition Rule. Default:
true
. - equals Sequence[str]
- List of label names that must have identical values in both the source and target alert occurrences for the inhibition rule to apply.
- monitor_
inhibition_ strrule_ id - (Computed) The ID of the Inhibition Rule.
- name str
- The name of the Inhibition Rule. If provided, it must be unique.
- timeouts
Monitor
Inhibition Rule Timeouts Args
- source
Matchers List<Property Map> - target
Matchers List<Property Map> - description String
- The description of the Inhibition Rule.
- enabled Boolean
- Whether to enable the Inhibition Rule. Default:
true
. - equals List<String>
- List of label names that must have identical values in both the source and target alert occurrences for the inhibition rule to apply.
- monitor
Inhibition StringRule Id - (Computed) The ID of the Inhibition Rule.
- name String
- The name of the Inhibition Rule. If provided, it must be unique.
- timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the MonitorInhibitionRule resource produces the following output properties:
Look up Existing MonitorInhibitionRule Resource
Get an existing MonitorInhibitionRule 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?: MonitorInhibitionRuleState, opts?: CustomResourceOptions): MonitorInhibitionRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
enabled: Optional[bool] = None,
equals: Optional[Sequence[str]] = None,
monitor_inhibition_rule_id: Optional[str] = None,
name: Optional[str] = None,
source_matchers: Optional[Sequence[MonitorInhibitionRuleSourceMatcherArgs]] = None,
target_matchers: Optional[Sequence[MonitorInhibitionRuleTargetMatcherArgs]] = None,
timeouts: Optional[MonitorInhibitionRuleTimeoutsArgs] = None,
version: Optional[float] = None) -> MonitorInhibitionRule
func GetMonitorInhibitionRule(ctx *Context, name string, id IDInput, state *MonitorInhibitionRuleState, opts ...ResourceOption) (*MonitorInhibitionRule, error)
public static MonitorInhibitionRule Get(string name, Input<string> id, MonitorInhibitionRuleState? state, CustomResourceOptions? opts = null)
public static MonitorInhibitionRule get(String name, Output<String> id, MonitorInhibitionRuleState state, CustomResourceOptions options)
resources: _: type: sysdig:MonitorInhibitionRule 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.
- Description string
- The description of the Inhibition Rule.
- Enabled bool
- Whether to enable the Inhibition Rule. Default:
true
. - Equals List<string>
- List of label names that must have identical values in both the source and target alert occurrences for the inhibition rule to apply.
- Monitor
Inhibition stringRule Id - (Computed) The ID of the Inhibition Rule.
- Name string
- The name of the Inhibition Rule. If provided, it must be unique.
- Source
Matchers List<MonitorInhibition Rule Source Matcher> - Target
Matchers List<MonitorInhibition Rule Target Matcher> - Timeouts
Monitor
Inhibition Rule Timeouts - Version double
- (Computed) The current version of the Inhibition Rule.
- Description string
- The description of the Inhibition Rule.
- Enabled bool
- Whether to enable the Inhibition Rule. Default:
true
. - Equals []string
- List of label names that must have identical values in both the source and target alert occurrences for the inhibition rule to apply.
- Monitor
Inhibition stringRule Id - (Computed) The ID of the Inhibition Rule.
- Name string
- The name of the Inhibition Rule. If provided, it must be unique.
- Source
Matchers []MonitorInhibition Rule Source Matcher Args - Target
Matchers []MonitorInhibition Rule Target Matcher Args - Timeouts
Monitor
Inhibition Rule Timeouts Args - Version float64
- (Computed) The current version of the Inhibition Rule.
- description String
- The description of the Inhibition Rule.
- enabled Boolean
- Whether to enable the Inhibition Rule. Default:
true
. - equals_ List<String>
- List of label names that must have identical values in both the source and target alert occurrences for the inhibition rule to apply.
- monitor
Inhibition StringRule Id - (Computed) The ID of the Inhibition Rule.
- name String
- The name of the Inhibition Rule. If provided, it must be unique.
- source
Matchers List<MonitorInhibition Rule Source Matcher> - target
Matchers List<MonitorInhibition Rule Target Matcher> - timeouts
Monitor
Inhibition Rule Timeouts - version Double
- (Computed) The current version of the Inhibition Rule.
- description string
- The description of the Inhibition Rule.
- enabled boolean
- Whether to enable the Inhibition Rule. Default:
true
. - equals string[]
- List of label names that must have identical values in both the source and target alert occurrences for the inhibition rule to apply.
- monitor
Inhibition stringRule Id - (Computed) The ID of the Inhibition Rule.
- name string
- The name of the Inhibition Rule. If provided, it must be unique.
- source
Matchers MonitorInhibition Rule Source Matcher[] - target
Matchers MonitorInhibition Rule Target Matcher[] - timeouts
Monitor
Inhibition Rule Timeouts - version number
- (Computed) The current version of the Inhibition Rule.
- description str
- The description of the Inhibition Rule.
- enabled bool
- Whether to enable the Inhibition Rule. Default:
true
. - equals Sequence[str]
- List of label names that must have identical values in both the source and target alert occurrences for the inhibition rule to apply.
- monitor_
inhibition_ strrule_ id - (Computed) The ID of the Inhibition Rule.
- name str
- The name of the Inhibition Rule. If provided, it must be unique.
- source_
matchers Sequence[MonitorInhibition Rule Source Matcher Args] - target_
matchers Sequence[MonitorInhibition Rule Target Matcher Args] - timeouts
Monitor
Inhibition Rule Timeouts Args - version float
- (Computed) The current version of the Inhibition Rule.
- description String
- The description of the Inhibition Rule.
- enabled Boolean
- Whether to enable the Inhibition Rule. Default:
true
. - equals List<String>
- List of label names that must have identical values in both the source and target alert occurrences for the inhibition rule to apply.
- monitor
Inhibition StringRule Id - (Computed) The ID of the Inhibition Rule.
- name String
- The name of the Inhibition Rule. If provided, it must be unique.
- source
Matchers List<Property Map> - target
Matchers List<Property Map> - timeouts Property Map
- version Number
- (Computed) The current version of the Inhibition Rule.
Supporting Types
MonitorInhibitionRuleSourceMatcher, MonitorInhibitionRuleSourceMatcherArgs
- label_
name str - Label to match.
- operator str
- Match operator. It can be
EQUALS
,NOT_EQUALS
,REGEXP_MATCHES
,NOT_REGEXP_MATCHES
. - value str
- Label value to match in case operator is of type equality, or a valid regular expression in case of operator is of type regex.
MonitorInhibitionRuleTargetMatcher, MonitorInhibitionRuleTargetMatcherArgs
- label_
name str - Label to match.
- operator str
- Match operator. It can be
EQUALS
,NOT_EQUALS
,REGEXP_MATCHES
,NOT_REGEXP_MATCHES
. - value str
- Label value to match in case
operator
is of type equality, or regular expression in case ofoperator
is of type regex.
MonitorInhibitionRuleTimeouts, MonitorInhibitionRuleTimeoutsArgs
Import
Inhibition Rules for Monitor can be imported using the ID, e.g.
$ pulumi import sysdig:index/monitorInhibitionRule:MonitorInhibitionRule example 12345
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- sysdig sysdiglabs/terraform-provider-sysdig
- License
- Notes
- This Pulumi package is based on the
sysdig
Terraform Provider.