1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. sddp
  5. getRules
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.sddp.getRules

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    This data source provides the Sddp Rules of the current Alibaba Cloud user.

    NOTE: Available in v1.132.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const defaultRule = new alicloud.sddp.Rule("default", {
        category: 0,
        content: "content",
        ruleName: "rule_name",
        riskLevelId: "4",
        productCode: "ODPS",
    });
    const default = alicloud.sddp.getRulesOutput({
        ids: [defaultRule.id],
    });
    export const sddpRuleId = _default.apply(_default => _default.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default_rule = alicloud.sddp.Rule("default",
        category=0,
        content="content",
        rule_name="rule_name",
        risk_level_id="4",
        product_code="ODPS")
    default = alicloud.sddp.get_rules_output(ids=[default_rule.id])
    pulumi.export("sddpRuleId", default.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/sddp"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
    defaultRule, err := sddp.NewRule(ctx, "default", &sddp.RuleArgs{
    Category: pulumi.Int(0),
    Content: pulumi.String("content"),
    RuleName: pulumi.String("rule_name"),
    RiskLevelId: pulumi.String("4"),
    ProductCode: pulumi.String("ODPS"),
    })
    if err != nil {
    return err
    }
    _default := sddp.GetRulesOutput(ctx, sddp.GetRulesOutputArgs{
    Ids: pulumi.StringArray{
    defaultRule.ID(),
    },
    }, nil);
    ctx.Export("sddpRuleId", _default.ApplyT(func(_default sddp.GetRulesResult) (*string, error) {
    return &default.Id, nil
    }).(pulumi.StringPtrOutput))
    return nil
    })
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var defaultRule = new AliCloud.Sddp.Rule("default", new()
        {
            Category = 0,
            Content = "content",
            RuleName = "rule_name",
            RiskLevelId = "4",
            ProductCode = "ODPS",
        });
    
        var @default = AliCloud.Sddp.GetRules.Invoke(new()
        {
            Ids = new[]
            {
                defaultRule.Id,
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["sddpRuleId"] = @default.Apply(@default => @default.Apply(getRulesResult => getRulesResult.Id)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.sddp.Rule;
    import com.pulumi.alicloud.sddp.RuleArgs;
    import com.pulumi.alicloud.sddp.SddpFunctions;
    import com.pulumi.alicloud.sddp.inputs.GetRulesArgs;
    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 defaultRule = new Rule("defaultRule", RuleArgs.builder()
                .category("0")
                .content("content")
                .ruleName("rule_name")
                .riskLevelId("4")
                .productCode("ODPS")
                .build());
    
            final var default = SddpFunctions.getRules(GetRulesArgs.builder()
                .ids(defaultRule.id())
                .build());
    
            ctx.export("sddpRuleId", default_.applyValue(default_ -> default_.id()));
        }
    }
    
    resources:
      defaultRule:
        type: alicloud:sddp:Rule
        name: default
        properties:
          category: '0'
          content: content
          ruleName: rule_name
          riskLevelId: '4'
          productCode: ODPS
    variables:
      default:
        fn::invoke:
          Function: alicloud:sddp:getRules
          Arguments:
            ids:
              - ${defaultRule.id}
    outputs:
      sddpRuleId: ${default.id}
    

    Using getRules

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getRules(args: GetRulesArgs, opts?: InvokeOptions): Promise<GetRulesResult>
    function getRulesOutput(args: GetRulesOutputArgs, opts?: InvokeOptions): Output<GetRulesResult>
    def get_rules(category: Optional[int] = None,
                  content_category: Optional[str] = None,
                  custom_type: Optional[int] = None,
                  enable_details: Optional[bool] = None,
                  ids: Optional[Sequence[str]] = None,
                  name: Optional[str] = None,
                  name_regex: Optional[str] = None,
                  output_file: Optional[str] = None,
                  product_id: Optional[str] = None,
                  risk_level_id: Optional[str] = None,
                  rule_type: Optional[int] = None,
                  status: Optional[str] = None,
                  warn_level: Optional[int] = None,
                  opts: Optional[InvokeOptions] = None) -> GetRulesResult
    def get_rules_output(category: Optional[pulumi.Input[int]] = None,
                  content_category: Optional[pulumi.Input[str]] = None,
                  custom_type: Optional[pulumi.Input[int]] = None,
                  enable_details: Optional[pulumi.Input[bool]] = None,
                  ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                  name: Optional[pulumi.Input[str]] = None,
                  name_regex: Optional[pulumi.Input[str]] = None,
                  output_file: Optional[pulumi.Input[str]] = None,
                  product_id: Optional[pulumi.Input[str]] = None,
                  risk_level_id: Optional[pulumi.Input[str]] = None,
                  rule_type: Optional[pulumi.Input[int]] = None,
                  status: Optional[pulumi.Input[str]] = None,
                  warn_level: Optional[pulumi.Input[int]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetRulesResult]
    func GetRules(ctx *Context, args *GetRulesArgs, opts ...InvokeOption) (*GetRulesResult, error)
    func GetRulesOutput(ctx *Context, args *GetRulesOutputArgs, opts ...InvokeOption) GetRulesResultOutput

    > Note: This function is named GetRules in the Go SDK.

    public static class GetRules 
    {
        public static Task<GetRulesResult> InvokeAsync(GetRulesArgs args, InvokeOptions? opts = null)
        public static Output<GetRulesResult> Invoke(GetRulesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRulesResult> getRules(GetRulesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:sddp/getRules:getRules
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Category int
    Sensitive Data Identification Rules for the Type of. Valid values:
    ContentCategory string
    The Content Classification.
    CustomType int
    Sensitive Data Identification Rules of Type. Valid values:
    EnableDetails bool
    Ids List<string>
    A list of Rule IDs.
    Name string
    The name of rule.
    NameRegex string
    A regex string to filter results by Rule name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ProductId string
    Product ID. Valid values:
    RiskLevelId string
    Sensitive Data Identification Rules of Risk Level ID. Valid values:
    RuleType int
    Rule Type.
    Status string
    Sensitive Data Identification Rules Detection State of.
    WarnLevel int
    The Level of Risk. Valid values:
    Category int
    Sensitive Data Identification Rules for the Type of. Valid values:
    ContentCategory string
    The Content Classification.
    CustomType int
    Sensitive Data Identification Rules of Type. Valid values:
    EnableDetails bool
    Ids []string
    A list of Rule IDs.
    Name string
    The name of rule.
    NameRegex string
    A regex string to filter results by Rule name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ProductId string
    Product ID. Valid values:
    RiskLevelId string
    Sensitive Data Identification Rules of Risk Level ID. Valid values:
    RuleType int
    Rule Type.
    Status string
    Sensitive Data Identification Rules Detection State of.
    WarnLevel int
    The Level of Risk. Valid values:
    category Integer
    Sensitive Data Identification Rules for the Type of. Valid values:
    contentCategory String
    The Content Classification.
    customType Integer
    Sensitive Data Identification Rules of Type. Valid values:
    enableDetails Boolean
    ids List<String>
    A list of Rule IDs.
    name String
    The name of rule.
    nameRegex String
    A regex string to filter results by Rule name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    productId String
    Product ID. Valid values:
    riskLevelId String
    Sensitive Data Identification Rules of Risk Level ID. Valid values:
    ruleType Integer
    Rule Type.
    status String
    Sensitive Data Identification Rules Detection State of.
    warnLevel Integer
    The Level of Risk. Valid values:
    category number
    Sensitive Data Identification Rules for the Type of. Valid values:
    contentCategory string
    The Content Classification.
    customType number
    Sensitive Data Identification Rules of Type. Valid values:
    enableDetails boolean
    ids string[]
    A list of Rule IDs.
    name string
    The name of rule.
    nameRegex string
    A regex string to filter results by Rule name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    productId string
    Product ID. Valid values:
    riskLevelId string
    Sensitive Data Identification Rules of Risk Level ID. Valid values:
    ruleType number
    Rule Type.
    status string
    Sensitive Data Identification Rules Detection State of.
    warnLevel number
    The Level of Risk. Valid values:
    category int
    Sensitive Data Identification Rules for the Type of. Valid values:
    content_category str
    The Content Classification.
    custom_type int
    Sensitive Data Identification Rules of Type. Valid values:
    enable_details bool
    ids Sequence[str]
    A list of Rule IDs.
    name str
    The name of rule.
    name_regex str
    A regex string to filter results by Rule name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    product_id str
    Product ID. Valid values:
    risk_level_id str
    Sensitive Data Identification Rules of Risk Level ID. Valid values:
    rule_type int
    Rule Type.
    status str
    Sensitive Data Identification Rules Detection State of.
    warn_level int
    The Level of Risk. Valid values:
    category Number
    Sensitive Data Identification Rules for the Type of. Valid values:
    contentCategory String
    The Content Classification.
    customType Number
    Sensitive Data Identification Rules of Type. Valid values:
    enableDetails Boolean
    ids List<String>
    A list of Rule IDs.
    name String
    The name of rule.
    nameRegex String
    A regex string to filter results by Rule name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    productId String
    Product ID. Valid values:
    riskLevelId String
    Sensitive Data Identification Rules of Risk Level ID. Valid values:
    ruleType Number
    Rule Type.
    status String
    Sensitive Data Identification Rules Detection State of.
    warnLevel Number
    The Level of Risk. Valid values:

    getRules Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    Rules List<Pulumi.AliCloud.Sddp.Outputs.GetRulesRule>
    Category int
    ContentCategory string
    CustomType int
    EnableDetails bool
    Name string
    NameRegex string
    OutputFile string
    ProductId string
    RiskLevelId string
    RuleType int
    Status string
    WarnLevel int
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    Rules []GetRulesRule
    Category int
    ContentCategory string
    CustomType int
    EnableDetails bool
    Name string
    NameRegex string
    OutputFile string
    ProductId string
    RiskLevelId string
    RuleType int
    Status string
    WarnLevel int
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    rules List<GetRulesRule>
    category Integer
    contentCategory String
    customType Integer
    enableDetails Boolean
    name String
    nameRegex String
    outputFile String
    productId String
    riskLevelId String
    ruleType Integer
    status String
    warnLevel Integer
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    rules GetRulesRule[]
    category number
    contentCategory string
    customType number
    enableDetails boolean
    name string
    nameRegex string
    outputFile string
    productId string
    riskLevelId string
    ruleType number
    status string
    warnLevel number
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    rules Sequence[GetRulesRule]
    category int
    content_category str
    custom_type int
    enable_details bool
    name str
    name_regex str
    output_file str
    product_id str
    risk_level_id str
    rule_type int
    status str
    warn_level int
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    rules List<Property Map>
    category Number
    contentCategory String
    customType Number
    enableDetails Boolean
    name String
    nameRegex String
    outputFile String
    productId String
    riskLevelId String
    ruleType Number
    status String
    warnLevel Number

    Supporting Types

    GetRulesRule

    Category int
    Sensitive Data Identification Rules for the Type of.
    CategoryName string
    Sensitive Data Identification Rules Belongs Type Name.
    Content string
    Sensitive Data Identification Rules the Content.
    ContentCategory string
    The Content Classification.
    CreateTime string
    Sensitive Data Identification Rules the Creation Time of the Number of Milliseconds.
    CustomType int
    Sensitive Data Identification Rules of Type. 0: the Built-in 1: The User-Defined.
    Description string
    Sensitive Data Identification a Description of the Rule Information.
    DisplayName string
    Sensitive Data Identification Rules, Founder of Account Display Name.
    GmtModified string
    Sensitive Data Identification Rules to the Modified Time of the Number of Milliseconds.
    Id string
    The ID of the Rule.
    LoginName string
    Sensitive Data Identification Rules, Founder Of Account Login.
    MajorKey string
    The Primary Key.
    Name string
    The name of rule.
    ProductCode string
    Product Code.
    ProductId string
    Product ID.
    RiskLevelId string
    Sensitive Data Identification Rules of Risk Level ID. Valid values:1:S1, Weak Risk Level. 2:S2, Medium Risk Level. 3:S3 High Risk Level. 4:S4, the Highest Risk Level.
    RiskLevelName string
    Sensitive Data Identification Rules the Risk Level of. S1: Weak Risk Level S2: Moderate Risk Level S3: High Risk Level S4: the Highest Risk Level.
    RuleId string
    The first ID of the resource.
    StatExpress string
    Triggered the Alarm Conditions.
    Status int
    Sensitive Data Identification Rules Detection State of.
    Target string
    The Target.
    UserId string
    The User ID.
    WarnLevel int
    The Level of Risk.
    Category int
    Sensitive Data Identification Rules for the Type of.
    CategoryName string
    Sensitive Data Identification Rules Belongs Type Name.
    Content string
    Sensitive Data Identification Rules the Content.
    ContentCategory string
    The Content Classification.
    CreateTime string
    Sensitive Data Identification Rules the Creation Time of the Number of Milliseconds.
    CustomType int
    Sensitive Data Identification Rules of Type. 0: the Built-in 1: The User-Defined.
    Description string
    Sensitive Data Identification a Description of the Rule Information.
    DisplayName string
    Sensitive Data Identification Rules, Founder of Account Display Name.
    GmtModified string
    Sensitive Data Identification Rules to the Modified Time of the Number of Milliseconds.
    Id string
    The ID of the Rule.
    LoginName string
    Sensitive Data Identification Rules, Founder Of Account Login.
    MajorKey string
    The Primary Key.
    Name string
    The name of rule.
    ProductCode string
    Product Code.
    ProductId string
    Product ID.
    RiskLevelId string
    Sensitive Data Identification Rules of Risk Level ID. Valid values:1:S1, Weak Risk Level. 2:S2, Medium Risk Level. 3:S3 High Risk Level. 4:S4, the Highest Risk Level.
    RiskLevelName string
    Sensitive Data Identification Rules the Risk Level of. S1: Weak Risk Level S2: Moderate Risk Level S3: High Risk Level S4: the Highest Risk Level.
    RuleId string
    The first ID of the resource.
    StatExpress string
    Triggered the Alarm Conditions.
    Status int
    Sensitive Data Identification Rules Detection State of.
    Target string
    The Target.
    UserId string
    The User ID.
    WarnLevel int
    The Level of Risk.
    category Integer
    Sensitive Data Identification Rules for the Type of.
    categoryName String
    Sensitive Data Identification Rules Belongs Type Name.
    content String
    Sensitive Data Identification Rules the Content.
    contentCategory String
    The Content Classification.
    createTime String
    Sensitive Data Identification Rules the Creation Time of the Number of Milliseconds.
    customType Integer
    Sensitive Data Identification Rules of Type. 0: the Built-in 1: The User-Defined.
    description String
    Sensitive Data Identification a Description of the Rule Information.
    displayName String
    Sensitive Data Identification Rules, Founder of Account Display Name.
    gmtModified String
    Sensitive Data Identification Rules to the Modified Time of the Number of Milliseconds.
    id String
    The ID of the Rule.
    loginName String
    Sensitive Data Identification Rules, Founder Of Account Login.
    majorKey String
    The Primary Key.
    name String
    The name of rule.
    productCode String
    Product Code.
    productId String
    Product ID.
    riskLevelId String
    Sensitive Data Identification Rules of Risk Level ID. Valid values:1:S1, Weak Risk Level. 2:S2, Medium Risk Level. 3:S3 High Risk Level. 4:S4, the Highest Risk Level.
    riskLevelName String
    Sensitive Data Identification Rules the Risk Level of. S1: Weak Risk Level S2: Moderate Risk Level S3: High Risk Level S4: the Highest Risk Level.
    ruleId String
    The first ID of the resource.
    statExpress String
    Triggered the Alarm Conditions.
    status Integer
    Sensitive Data Identification Rules Detection State of.
    target String
    The Target.
    userId String
    The User ID.
    warnLevel Integer
    The Level of Risk.
    category number
    Sensitive Data Identification Rules for the Type of.
    categoryName string
    Sensitive Data Identification Rules Belongs Type Name.
    content string
    Sensitive Data Identification Rules the Content.
    contentCategory string
    The Content Classification.
    createTime string
    Sensitive Data Identification Rules the Creation Time of the Number of Milliseconds.
    customType number
    Sensitive Data Identification Rules of Type. 0: the Built-in 1: The User-Defined.
    description string
    Sensitive Data Identification a Description of the Rule Information.
    displayName string
    Sensitive Data Identification Rules, Founder of Account Display Name.
    gmtModified string
    Sensitive Data Identification Rules to the Modified Time of the Number of Milliseconds.
    id string
    The ID of the Rule.
    loginName string
    Sensitive Data Identification Rules, Founder Of Account Login.
    majorKey string
    The Primary Key.
    name string
    The name of rule.
    productCode string
    Product Code.
    productId string
    Product ID.
    riskLevelId string
    Sensitive Data Identification Rules of Risk Level ID. Valid values:1:S1, Weak Risk Level. 2:S2, Medium Risk Level. 3:S3 High Risk Level. 4:S4, the Highest Risk Level.
    riskLevelName string
    Sensitive Data Identification Rules the Risk Level of. S1: Weak Risk Level S2: Moderate Risk Level S3: High Risk Level S4: the Highest Risk Level.
    ruleId string
    The first ID of the resource.
    statExpress string
    Triggered the Alarm Conditions.
    status number
    Sensitive Data Identification Rules Detection State of.
    target string
    The Target.
    userId string
    The User ID.
    warnLevel number
    The Level of Risk.
    category int
    Sensitive Data Identification Rules for the Type of.
    category_name str
    Sensitive Data Identification Rules Belongs Type Name.
    content str
    Sensitive Data Identification Rules the Content.
    content_category str
    The Content Classification.
    create_time str
    Sensitive Data Identification Rules the Creation Time of the Number of Milliseconds.
    custom_type int
    Sensitive Data Identification Rules of Type. 0: the Built-in 1: The User-Defined.
    description str
    Sensitive Data Identification a Description of the Rule Information.
    display_name str
    Sensitive Data Identification Rules, Founder of Account Display Name.
    gmt_modified str
    Sensitive Data Identification Rules to the Modified Time of the Number of Milliseconds.
    id str
    The ID of the Rule.
    login_name str
    Sensitive Data Identification Rules, Founder Of Account Login.
    major_key str
    The Primary Key.
    name str
    The name of rule.
    product_code str
    Product Code.
    product_id str
    Product ID.
    risk_level_id str
    Sensitive Data Identification Rules of Risk Level ID. Valid values:1:S1, Weak Risk Level. 2:S2, Medium Risk Level. 3:S3 High Risk Level. 4:S4, the Highest Risk Level.
    risk_level_name str
    Sensitive Data Identification Rules the Risk Level of. S1: Weak Risk Level S2: Moderate Risk Level S3: High Risk Level S4: the Highest Risk Level.
    rule_id str
    The first ID of the resource.
    stat_express str
    Triggered the Alarm Conditions.
    status int
    Sensitive Data Identification Rules Detection State of.
    target str
    The Target.
    user_id str
    The User ID.
    warn_level int
    The Level of Risk.
    category Number
    Sensitive Data Identification Rules for the Type of.
    categoryName String
    Sensitive Data Identification Rules Belongs Type Name.
    content String
    Sensitive Data Identification Rules the Content.
    contentCategory String
    The Content Classification.
    createTime String
    Sensitive Data Identification Rules the Creation Time of the Number of Milliseconds.
    customType Number
    Sensitive Data Identification Rules of Type. 0: the Built-in 1: The User-Defined.
    description String
    Sensitive Data Identification a Description of the Rule Information.
    displayName String
    Sensitive Data Identification Rules, Founder of Account Display Name.
    gmtModified String
    Sensitive Data Identification Rules to the Modified Time of the Number of Milliseconds.
    id String
    The ID of the Rule.
    loginName String
    Sensitive Data Identification Rules, Founder Of Account Login.
    majorKey String
    The Primary Key.
    name String
    The name of rule.
    productCode String
    Product Code.
    productId String
    Product ID.
    riskLevelId String
    Sensitive Data Identification Rules of Risk Level ID. Valid values:1:S1, Weak Risk Level. 2:S2, Medium Risk Level. 3:S3 High Risk Level. 4:S4, the Highest Risk Level.
    riskLevelName String
    Sensitive Data Identification Rules the Risk Level of. S1: Weak Risk Level S2: Moderate Risk Level S3: High Risk Level S4: the Highest Risk Level.
    ruleId String
    The first ID of the resource.
    statExpress String
    Triggered the Alarm Conditions.
    status Number
    Sensitive Data Identification Rules Detection State of.
    target String
    The Target.
    userId String
    The User ID.
    warnLevel Number
    The Level of Risk.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi