1. Packages
  2. Impart Security
  3. API Docs
  4. RuleScript
Impart Security v0.4.0 published on Wednesday, Apr 10, 2024 by Impart Security

impart.RuleScript

Explore with Pulumi AI

impart logo
Impart Security v0.4.0 published on Wednesday, Apr 10, 2024 by Impart Security

    Manage a rule script.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as impart from "@impart-security/pulumi-impart";
    
    // Create a new rule script
    const example = new impart.RuleScript("example", {
        description: "Rule description",
        disabled: false,
        name: "example",
        sourceFile: `${path.module}/rule.js`,
        sourceHash: "<sha256 hash for the source_file content>",
    });
    
    import pulumi
    import pulumi_impart as impart
    
    # Create a new rule script
    example = impart.RuleScript("example",
        description="Rule description",
        disabled=False,
        name="example",
        source_file=f"{path['module']}/rule.js",
        source_hash="<sha256 hash for the source_file content>")
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/impart-security/pulumi-impart/sdk/go/impart"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Create a new rule script
    		_, err := impart.NewRuleScript(ctx, "example", &impart.RuleScriptArgs{
    			Description: pulumi.String("Rule description"),
    			Disabled:    pulumi.Bool(false),
    			Name:        pulumi.String("example"),
    			SourceFile:  pulumi.String(fmt.Sprintf("%v/rule.js", path.Module)),
    			SourceHash:  pulumi.String("<sha256 hash for the source_file content>"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Impart = Pulumi.Impart;
    
    return await Deployment.RunAsync(() => 
    {
        // Create a new rule script
        var example = new Impart.RuleScript("example", new()
        {
            Description = "Rule description",
            Disabled = false,
            Name = "example",
            SourceFile = $"{path.Module}/rule.js",
            SourceHash = "<sha256 hash for the source_file content>",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.impart.RuleScript;
    import com.pulumi.impart.RuleScriptArgs;
    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 rule script
            var example = new RuleScript("example", RuleScriptArgs.builder()        
                .description("Rule description")
                .disabled(false)
                .name("example")
                .sourceFile(String.format("%s/rule.js", path.module()))
                .sourceHash("<sha256 hash for the source_file content>")
                .build());
    
        }
    }
    
    resources:
      # Create a new rule script
      example:
        type: impart:RuleScript
        properties:
          description: Rule description
          disabled: false
          name: example
          sourceFile: ${path.module}/rule.js
          sourceHash: <sha256 hash for the source_file content>
    

    Create RuleScript Resource

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

    Constructor syntax

    new RuleScript(name: string, args: RuleScriptArgs, opts?: CustomResourceOptions);
    @overload
    def RuleScript(resource_name: str,
                   args: RuleScriptArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def RuleScript(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   disabled: Optional[bool] = None,
                   name: Optional[str] = None,
                   source_file: Optional[str] = None,
                   description: Optional[str] = None,
                   source_hash: Optional[str] = None)
    func NewRuleScript(ctx *Context, name string, args RuleScriptArgs, opts ...ResourceOption) (*RuleScript, error)
    public RuleScript(string name, RuleScriptArgs args, CustomResourceOptions? opts = null)
    public RuleScript(String name, RuleScriptArgs args)
    public RuleScript(String name, RuleScriptArgs args, CustomResourceOptions options)
    
    type: impart:RuleScript
    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 RuleScriptArgs
    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 RuleScriptArgs
    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 RuleScriptArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RuleScriptArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RuleScriptArgs
    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 ruleScriptResource = new Impart.RuleScript("ruleScriptResource", new()
    {
        Disabled = false,
        Name = "string",
        SourceFile = "string",
        Description = "string",
        SourceHash = "string",
    });
    
    example, err := impart.NewRuleScript(ctx, "ruleScriptResource", &impart.RuleScriptArgs{
    	Disabled:    pulumi.Bool(false),
    	Name:        pulumi.String("string"),
    	SourceFile:  pulumi.String("string"),
    	Description: pulumi.String("string"),
    	SourceHash:  pulumi.String("string"),
    })
    
    var ruleScriptResource = new RuleScript("ruleScriptResource", RuleScriptArgs.builder()        
        .disabled(false)
        .name("string")
        .sourceFile("string")
        .description("string")
        .sourceHash("string")
        .build());
    
    rule_script_resource = impart.RuleScript("ruleScriptResource",
        disabled=False,
        name="string",
        source_file="string",
        description="string",
        source_hash="string")
    
    const ruleScriptResource = new impart.RuleScript("ruleScriptResource", {
        disabled: false,
        name: "string",
        sourceFile: "string",
        description: "string",
        sourceHash: "string",
    });
    
    type: impart:RuleScript
    properties:
        description: string
        disabled: false
        name: string
        sourceFile: string
        sourceHash: string
    

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

    Disabled bool
    Set true to disable the rule script.
    Name string
    The name for this rule script.
    SourceFile string
    The rule source file.
    Description string
    The description for this rule script.
    SourceHash string
    The rule source hash.
    Disabled bool
    Set true to disable the rule script.
    Name string
    The name for this rule script.
    SourceFile string
    The rule source file.
    Description string
    The description for this rule script.
    SourceHash string
    The rule source hash.
    disabled Boolean
    Set true to disable the rule script.
    name String
    The name for this rule script.
    sourceFile String
    The rule source file.
    description String
    The description for this rule script.
    sourceHash String
    The rule source hash.
    disabled boolean
    Set true to disable the rule script.
    name string
    The name for this rule script.
    sourceFile string
    The rule source file.
    description string
    The description for this rule script.
    sourceHash string
    The rule source hash.
    disabled bool
    Set true to disable the rule script.
    name str
    The name for this rule script.
    source_file str
    The rule source file.
    description str
    The description for this rule script.
    source_hash str
    The rule source hash.
    disabled Boolean
    Set true to disable the rule script.
    name String
    The name for this rule script.
    sourceFile String
    The rule source file.
    description String
    The description for this rule script.
    sourceHash String
    The rule source hash.

    Outputs

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

    Get an existing RuleScript 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?: RuleScriptState, opts?: CustomResourceOptions): RuleScript
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            disabled: Optional[bool] = None,
            name: Optional[str] = None,
            source_file: Optional[str] = None,
            source_hash: Optional[str] = None) -> RuleScript
    func GetRuleScript(ctx *Context, name string, id IDInput, state *RuleScriptState, opts ...ResourceOption) (*RuleScript, error)
    public static RuleScript Get(string name, Input<string> id, RuleScriptState? state, CustomResourceOptions? opts = null)
    public static RuleScript get(String name, Output<String> id, RuleScriptState 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
    The description for this rule script.
    Disabled bool
    Set true to disable the rule script.
    Name string
    The name for this rule script.
    SourceFile string
    The rule source file.
    SourceHash string
    The rule source hash.
    Description string
    The description for this rule script.
    Disabled bool
    Set true to disable the rule script.
    Name string
    The name for this rule script.
    SourceFile string
    The rule source file.
    SourceHash string
    The rule source hash.
    description String
    The description for this rule script.
    disabled Boolean
    Set true to disable the rule script.
    name String
    The name for this rule script.
    sourceFile String
    The rule source file.
    sourceHash String
    The rule source hash.
    description string
    The description for this rule script.
    disabled boolean
    Set true to disable the rule script.
    name string
    The name for this rule script.
    sourceFile string
    The rule source file.
    sourceHash string
    The rule source hash.
    description str
    The description for this rule script.
    disabled bool
    Set true to disable the rule script.
    name str
    The name for this rule script.
    source_file str
    The rule source file.
    source_hash str
    The rule source hash.
    description String
    The description for this rule script.
    disabled Boolean
    Set true to disable the rule script.
    name String
    The name for this rule script.
    sourceFile String
    The rule source file.
    sourceHash String
    The rule source hash.

    Package Details

    Repository
    impart impart-security/pulumi-impart
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the impart Terraform Provider.
    impart logo
    Impart Security v0.4.0 published on Wednesday, Apr 10, 2024 by Impart Security