1. Packages
  2. Datadog Provider
  3. API Docs
  4. CsmThreatsAgentRule
Datadog v4.33.2 published on Tuesday, Sep 24, 2024 by Pulumi

datadog.CsmThreatsAgentRule

Explore with Pulumi AI

datadog logo
Datadog v4.33.2 published on Tuesday, Sep 24, 2024 by Pulumi

    Provides a Datadog CSM Threats Agent Rule API resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as datadog from "@pulumi/datadog";
    
    const myAgentRule = new datadog.CsmThreatsAgentRule("my_agent_rule", {
        name: "my_agent_rule",
        enabled: true,
        description: "im a rule",
        expression: "open.file.name == \"etc/shadow/password\"",
    });
    
    import pulumi
    import pulumi_datadog as datadog
    
    my_agent_rule = datadog.CsmThreatsAgentRule("my_agent_rule",
        name="my_agent_rule",
        enabled=True,
        description="im a rule",
        expression="open.file.name == \"etc/shadow/password\"")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-datadog/sdk/v4/go/datadog"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := datadog.NewCsmThreatsAgentRule(ctx, "my_agent_rule", &datadog.CsmThreatsAgentRuleArgs{
    			Name:        pulumi.String("my_agent_rule"),
    			Enabled:     pulumi.Bool(true),
    			Description: pulumi.String("im a rule"),
    			Expression:  pulumi.String("open.file.name == \"etc/shadow/password\""),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Datadog = Pulumi.Datadog;
    
    return await Deployment.RunAsync(() => 
    {
        var myAgentRule = new Datadog.CsmThreatsAgentRule("my_agent_rule", new()
        {
            Name = "my_agent_rule",
            Enabled = true,
            Description = "im a rule",
            Expression = "open.file.name == \"etc/shadow/password\"",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.datadog.CsmThreatsAgentRule;
    import com.pulumi.datadog.CsmThreatsAgentRuleArgs;
    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 myAgentRule = new CsmThreatsAgentRule("myAgentRule", CsmThreatsAgentRuleArgs.builder()
                .name("my_agent_rule")
                .enabled(true)
                .description("im a rule")
                .expression("open.file.name == \"etc/shadow/password\"")
                .build());
    
        }
    }
    
    resources:
      myAgentRule:
        type: datadog:CsmThreatsAgentRule
        name: my_agent_rule
        properties:
          name: my_agent_rule
          enabled: true
          description: im a rule
          expression: open.file.name == "etc/shadow/password"
    

    Create CsmThreatsAgentRule Resource

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

    Constructor syntax

    new CsmThreatsAgentRule(name: string, args: CsmThreatsAgentRuleArgs, opts?: CustomResourceOptions);
    @overload
    def CsmThreatsAgentRule(resource_name: str,
                            args: CsmThreatsAgentRuleArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def CsmThreatsAgentRule(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            enabled: Optional[bool] = None,
                            expression: Optional[str] = None,
                            name: Optional[str] = None,
                            description: Optional[str] = None)
    func NewCsmThreatsAgentRule(ctx *Context, name string, args CsmThreatsAgentRuleArgs, opts ...ResourceOption) (*CsmThreatsAgentRule, error)
    public CsmThreatsAgentRule(string name, CsmThreatsAgentRuleArgs args, CustomResourceOptions? opts = null)
    public CsmThreatsAgentRule(String name, CsmThreatsAgentRuleArgs args)
    public CsmThreatsAgentRule(String name, CsmThreatsAgentRuleArgs args, CustomResourceOptions options)
    
    type: datadog:CsmThreatsAgentRule
    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 CsmThreatsAgentRuleArgs
    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 CsmThreatsAgentRuleArgs
    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 CsmThreatsAgentRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CsmThreatsAgentRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CsmThreatsAgentRuleArgs
    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 csmThreatsAgentRuleResource = new Datadog.CsmThreatsAgentRule("csmThreatsAgentRuleResource", new()
    {
        Enabled = false,
        Expression = "string",
        Name = "string",
        Description = "string",
    });
    
    example, err := datadog.NewCsmThreatsAgentRule(ctx, "csmThreatsAgentRuleResource", &datadog.CsmThreatsAgentRuleArgs{
    	Enabled:     pulumi.Bool(false),
    	Expression:  pulumi.String("string"),
    	Name:        pulumi.String("string"),
    	Description: pulumi.String("string"),
    })
    
    var csmThreatsAgentRuleResource = new CsmThreatsAgentRule("csmThreatsAgentRuleResource", CsmThreatsAgentRuleArgs.builder()
        .enabled(false)
        .expression("string")
        .name("string")
        .description("string")
        .build());
    
    csm_threats_agent_rule_resource = datadog.CsmThreatsAgentRule("csmThreatsAgentRuleResource",
        enabled=False,
        expression="string",
        name="string",
        description="string")
    
    const csmThreatsAgentRuleResource = new datadog.CsmThreatsAgentRule("csmThreatsAgentRuleResource", {
        enabled: false,
        expression: "string",
        name: "string",
        description: "string",
    });
    
    type: datadog:CsmThreatsAgentRule
    properties:
        description: string
        enabled: false
        expression: string
        name: string
    

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

    Enabled bool
    Indicates Whether the Agent rule is enabled.
    Expression string
    The SECL expression of the Agent rule
    Name string
    The name of the Agent rule.
    Description string
    A description for the Agent rule. Defaults to "".
    Enabled bool
    Indicates Whether the Agent rule is enabled.
    Expression string
    The SECL expression of the Agent rule
    Name string
    The name of the Agent rule.
    Description string
    A description for the Agent rule. Defaults to "".
    enabled Boolean
    Indicates Whether the Agent rule is enabled.
    expression String
    The SECL expression of the Agent rule
    name String
    The name of the Agent rule.
    description String
    A description for the Agent rule. Defaults to "".
    enabled boolean
    Indicates Whether the Agent rule is enabled.
    expression string
    The SECL expression of the Agent rule
    name string
    The name of the Agent rule.
    description string
    A description for the Agent rule. Defaults to "".
    enabled bool
    Indicates Whether the Agent rule is enabled.
    expression str
    The SECL expression of the Agent rule
    name str
    The name of the Agent rule.
    description str
    A description for the Agent rule. Defaults to "".
    enabled Boolean
    Indicates Whether the Agent rule is enabled.
    expression String
    The SECL expression of the Agent rule
    name String
    The name of the Agent rule.
    description String
    A description for the Agent rule. Defaults to "".

    Outputs

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

    Get an existing CsmThreatsAgentRule 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?: CsmThreatsAgentRuleState, opts?: CustomResourceOptions): CsmThreatsAgentRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            enabled: Optional[bool] = None,
            expression: Optional[str] = None,
            name: Optional[str] = None) -> CsmThreatsAgentRule
    func GetCsmThreatsAgentRule(ctx *Context, name string, id IDInput, state *CsmThreatsAgentRuleState, opts ...ResourceOption) (*CsmThreatsAgentRule, error)
    public static CsmThreatsAgentRule Get(string name, Input<string> id, CsmThreatsAgentRuleState? state, CustomResourceOptions? opts = null)
    public static CsmThreatsAgentRule get(String name, Output<String> id, CsmThreatsAgentRuleState 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:
    Description string
    A description for the Agent rule. Defaults to "".
    Enabled bool
    Indicates Whether the Agent rule is enabled.
    Expression string
    The SECL expression of the Agent rule
    Name string
    The name of the Agent rule.
    Description string
    A description for the Agent rule. Defaults to "".
    Enabled bool
    Indicates Whether the Agent rule is enabled.
    Expression string
    The SECL expression of the Agent rule
    Name string
    The name of the Agent rule.
    description String
    A description for the Agent rule. Defaults to "".
    enabled Boolean
    Indicates Whether the Agent rule is enabled.
    expression String
    The SECL expression of the Agent rule
    name String
    The name of the Agent rule.
    description string
    A description for the Agent rule. Defaults to "".
    enabled boolean
    Indicates Whether the Agent rule is enabled.
    expression string
    The SECL expression of the Agent rule
    name string
    The name of the Agent rule.
    description str
    A description for the Agent rule. Defaults to "".
    enabled bool
    Indicates Whether the Agent rule is enabled.
    expression str
    The SECL expression of the Agent rule
    name str
    The name of the Agent rule.
    description String
    A description for the Agent rule. Defaults to "".
    enabled Boolean
    Indicates Whether the Agent rule is enabled.
    expression String
    The SECL expression of the Agent rule
    name String
    The name of the Agent rule.

    Import

    CSM Agent Rules can be imported using ID. For example:

    $ pulumi import datadog:index/csmThreatsAgentRule:CsmThreatsAgentRule my_agent_rule m0o-hto-lkb
    

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

    Package Details

    Repository
    Datadog pulumi/pulumi-datadog
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the datadog Terraform Provider.
    datadog logo
    Datadog v4.33.2 published on Tuesday, Sep 24, 2024 by Pulumi