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

alicloud.cfg.getAggregateConfigRules

Explore with Pulumi AI

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

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

    NOTE: Available in v1.124.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = alicloud.cfg.getAggregateConfigRules({
        aggregatorId: "ca-3a9b626622af001d****",
        ids: ["cr-5154626622af0034****"],
        nameRegex: "the_resource_name",
    });
    export const firstConfigAggregateConfigRuleId = example.then(example => example.rules?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.cfg.get_aggregate_config_rules(aggregator_id="ca-3a9b626622af001d****",
        ids=["cr-5154626622af0034****"],
        name_regex="the_resource_name")
    pulumi.export("firstConfigAggregateConfigRuleId", example.rules[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cfg"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := cfg.GetAggregateConfigRules(ctx, &cfg.GetAggregateConfigRulesArgs{
    			AggregatorId: "ca-3a9b626622af001d****",
    			Ids: []string{
    				"cr-5154626622af0034****",
    			},
    			NameRegex: pulumi.StringRef("the_resource_name"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstConfigAggregateConfigRuleId", example.Rules[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = AliCloud.Cfg.GetAggregateConfigRules.Invoke(new()
        {
            AggregatorId = "ca-3a9b626622af001d****",
            Ids = new[]
            {
                "cr-5154626622af0034****",
            },
            NameRegex = "the_resource_name",
        });
    
        return new Dictionary<string, object?>
        {
            ["firstConfigAggregateConfigRuleId"] = example.Apply(getAggregateConfigRulesResult => getAggregateConfigRulesResult.Rules[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.cfg.CfgFunctions;
    import com.pulumi.alicloud.cfg.inputs.GetAggregateConfigRulesArgs;
    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) {
            final var example = CfgFunctions.getAggregateConfigRules(GetAggregateConfigRulesArgs.builder()
                .aggregatorId("ca-3a9b626622af001d****")
                .ids("cr-5154626622af0034****")
                .nameRegex("the_resource_name")
                .build());
    
            ctx.export("firstConfigAggregateConfigRuleId", example.applyValue(getAggregateConfigRulesResult -> getAggregateConfigRulesResult.rules()[0].id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: alicloud:cfg:getAggregateConfigRules
          Arguments:
            aggregatorId: ca-3a9b626622af001d****
            ids:
              - cr-5154626622af0034****
            nameRegex: the_resource_name
    outputs:
      firstConfigAggregateConfigRuleId: ${example.rules[0].id}
    

    Using getAggregateConfigRules

    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 getAggregateConfigRules(args: GetAggregateConfigRulesArgs, opts?: InvokeOptions): Promise<GetAggregateConfigRulesResult>
    function getAggregateConfigRulesOutput(args: GetAggregateConfigRulesOutputArgs, opts?: InvokeOptions): Output<GetAggregateConfigRulesResult>
    def get_aggregate_config_rules(aggregate_config_rule_name: Optional[str] = None,
                                   aggregator_id: Optional[str] = None,
                                   enable_details: Optional[bool] = None,
                                   ids: Optional[Sequence[str]] = None,
                                   name_regex: Optional[str] = None,
                                   output_file: Optional[str] = None,
                                   risk_level: Optional[int] = None,
                                   status: Optional[str] = None,
                                   opts: Optional[InvokeOptions] = None) -> GetAggregateConfigRulesResult
    def get_aggregate_config_rules_output(aggregate_config_rule_name: Optional[pulumi.Input[str]] = None,
                                   aggregator_id: Optional[pulumi.Input[str]] = None,
                                   enable_details: Optional[pulumi.Input[bool]] = None,
                                   ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                   name_regex: Optional[pulumi.Input[str]] = None,
                                   output_file: Optional[pulumi.Input[str]] = None,
                                   risk_level: Optional[pulumi.Input[int]] = None,
                                   status: Optional[pulumi.Input[str]] = None,
                                   opts: Optional[InvokeOptions] = None) -> Output[GetAggregateConfigRulesResult]
    func GetAggregateConfigRules(ctx *Context, args *GetAggregateConfigRulesArgs, opts ...InvokeOption) (*GetAggregateConfigRulesResult, error)
    func GetAggregateConfigRulesOutput(ctx *Context, args *GetAggregateConfigRulesOutputArgs, opts ...InvokeOption) GetAggregateConfigRulesResultOutput

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

    public static class GetAggregateConfigRules 
    {
        public static Task<GetAggregateConfigRulesResult> InvokeAsync(GetAggregateConfigRulesArgs args, InvokeOptions? opts = null)
        public static Output<GetAggregateConfigRulesResult> Invoke(GetAggregateConfigRulesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAggregateConfigRulesResult> getAggregateConfigRules(GetAggregateConfigRulesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:cfg/getAggregateConfigRules:getAggregateConfigRules
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AggregatorId string
    The ID of aggregator.
    AggregateConfigRuleName string
    The config rule name.
    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids List<string>
    A list of Aggregate Config Rule IDs.
    NameRegex string
    A regex string to filter results by Aggregate Config Rule name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    RiskLevel int
    Optional, ForceNew) The Risk Level. Valid values 1: critical, 2: warning, 3: info.
    Status string
    The state of the config rule, valid values: ACTIVE, DELETING, EVALUATING and INACTIVE.
    AggregatorId string
    The ID of aggregator.
    AggregateConfigRuleName string
    The config rule name.
    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids []string
    A list of Aggregate Config Rule IDs.
    NameRegex string
    A regex string to filter results by Aggregate Config Rule name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    RiskLevel int
    Optional, ForceNew) The Risk Level. Valid values 1: critical, 2: warning, 3: info.
    Status string
    The state of the config rule, valid values: ACTIVE, DELETING, EVALUATING and INACTIVE.
    aggregatorId String
    The ID of aggregator.
    aggregateConfigRuleName String
    The config rule name.
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of Aggregate Config Rule IDs.
    nameRegex String
    A regex string to filter results by Aggregate Config Rule name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    riskLevel Integer
    Optional, ForceNew) The Risk Level. Valid values 1: critical, 2: warning, 3: info.
    status String
    The state of the config rule, valid values: ACTIVE, DELETING, EVALUATING and INACTIVE.
    aggregatorId string
    The ID of aggregator.
    aggregateConfigRuleName string
    The config rule name.
    enableDetails boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids string[]
    A list of Aggregate Config Rule IDs.
    nameRegex string
    A regex string to filter results by Aggregate Config Rule name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    riskLevel number
    Optional, ForceNew) The Risk Level. Valid values 1: critical, 2: warning, 3: info.
    status string
    The state of the config rule, valid values: ACTIVE, DELETING, EVALUATING and INACTIVE.
    aggregator_id str
    The ID of aggregator.
    aggregate_config_rule_name str
    The config rule name.
    enable_details bool
    Default to false. Set it to true can output more details about resource attributes.
    ids Sequence[str]
    A list of Aggregate Config Rule IDs.
    name_regex str
    A regex string to filter results by Aggregate Config Rule name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    risk_level int
    Optional, ForceNew) The Risk Level. Valid values 1: critical, 2: warning, 3: info.
    status str
    The state of the config rule, valid values: ACTIVE, DELETING, EVALUATING and INACTIVE.
    aggregatorId String
    The ID of aggregator.
    aggregateConfigRuleName String
    The config rule name.
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of Aggregate Config Rule IDs.
    nameRegex String
    A regex string to filter results by Aggregate Config Rule name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    riskLevel Number
    Optional, ForceNew) The Risk Level. Valid values 1: critical, 2: warning, 3: info.
    status String
    The state of the config rule, valid values: ACTIVE, DELETING, EVALUATING and INACTIVE.

    getAggregateConfigRules Result

    The following output properties are available:

    AggregatorId string
    The ID of Aggregator.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    A list of Aggregate Config Rule names.
    Rules List<Pulumi.AliCloud.Cfg.Outputs.GetAggregateConfigRulesRule>
    A list of Config Aggregate Config Rules. Each element contains the following attributes:
    AggregateConfigRuleName string
    The name of the rule.
    EnableDetails bool
    NameRegex string
    OutputFile string
    RiskLevel int
    The risk level of the resources that are not compliant with the rule. Valid values: 1: critical, 2: warning, 3: info.
    Status string
    The status of the rule.
    AggregatorId string
    The ID of Aggregator.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    A list of Aggregate Config Rule names.
    Rules []GetAggregateConfigRulesRule
    A list of Config Aggregate Config Rules. Each element contains the following attributes:
    AggregateConfigRuleName string
    The name of the rule.
    EnableDetails bool
    NameRegex string
    OutputFile string
    RiskLevel int
    The risk level of the resources that are not compliant with the rule. Valid values: 1: critical, 2: warning, 3: info.
    Status string
    The status of the rule.
    aggregatorId String
    The ID of Aggregator.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    A list of Aggregate Config Rule names.
    rules List<GetAggregateConfigRulesRule>
    A list of Config Aggregate Config Rules. Each element contains the following attributes:
    aggregateConfigRuleName String
    The name of the rule.
    enableDetails Boolean
    nameRegex String
    outputFile String
    riskLevel Integer
    The risk level of the resources that are not compliant with the rule. Valid values: 1: critical, 2: warning, 3: info.
    status String
    The status of the rule.
    aggregatorId string
    The ID of Aggregator.
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    A list of Aggregate Config Rule names.
    rules GetAggregateConfigRulesRule[]
    A list of Config Aggregate Config Rules. Each element contains the following attributes:
    aggregateConfigRuleName string
    The name of the rule.
    enableDetails boolean
    nameRegex string
    outputFile string
    riskLevel number
    The risk level of the resources that are not compliant with the rule. Valid values: 1: critical, 2: warning, 3: info.
    status string
    The status of the rule.
    aggregator_id str
    The ID of Aggregator.
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    A list of Aggregate Config Rule names.
    rules Sequence[GetAggregateConfigRulesRule]
    A list of Config Aggregate Config Rules. Each element contains the following attributes:
    aggregate_config_rule_name str
    The name of the rule.
    enable_details bool
    name_regex str
    output_file str
    risk_level int
    The risk level of the resources that are not compliant with the rule. Valid values: 1: critical, 2: warning, 3: info.
    status str
    The status of the rule.
    aggregatorId String
    The ID of Aggregator.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    A list of Aggregate Config Rule names.
    rules List<Property Map>
    A list of Config Aggregate Config Rules. Each element contains the following attributes:
    aggregateConfigRuleName String
    The name of the rule.
    enableDetails Boolean
    nameRegex String
    outputFile String
    riskLevel Number
    The risk level of the resources that are not compliant with the rule. Valid values: 1: critical, 2: warning, 3: info.
    status String
    The status of the rule.

    Supporting Types

    GetAggregateConfigRulesRule

    AccountId string
    The Aliyun User ID.
    AggregateConfigRuleName string
    The config rule name.
    AggregatorId string
    The ID of aggregator.
    CompliancePackId string
    The ID of Compliance Package.
    Compliances List<Pulumi.AliCloud.Cfg.Inputs.GetAggregateConfigRulesRuleCompliance>
    The Compliance information.
    ConfigRuleArn string
    The config rule arn.
    ConfigRuleId string
    The ID of the rule.
    ConfigRuleTriggerTypes string
    The trigger types of config rules.
    Description string
    The description of the rule.
    EventSource string
    Event source of the Config Rule.
    ExcludeResourceIdsScope string
    The id of the resources to be evaluated against the rule.
    Id string
    The ID of the Aggregate Config Rule.
    InputParameters Dictionary<string, object>
    The settings of the input parameters for the rule.
    MaximumExecutionFrequency string
    The frequency of the compliance evaluations.
    ModifiedTimestamp string
    The timestamp when the rule was last modified.
    RegionIdsScope string
    The scope of resource region ids.
    ResourceGroupIdsScope string
    The scope of resource group ids.
    ResourceTypesScopes List<string>
    RiskLevel int
    Optional, ForceNew) The Risk Level. Valid values 1: critical, 2: warning, 3: info.
    SourceIdentifier string
    The identifier of the managed rule or the arn of the custom function.
    SourceOwner string
    The source owner of the Config Rule.
    Status string
    The state of the config rule, valid values: ACTIVE, DELETING, EVALUATING and INACTIVE.
    TagKeyScope string
    The scope of tay key.
    TagValueScope string
    The scope of tay value.
    AccountId string
    The Aliyun User ID.
    AggregateConfigRuleName string
    The config rule name.
    AggregatorId string
    The ID of aggregator.
    CompliancePackId string
    The ID of Compliance Package.
    Compliances []GetAggregateConfigRulesRuleCompliance
    The Compliance information.
    ConfigRuleArn string
    The config rule arn.
    ConfigRuleId string
    The ID of the rule.
    ConfigRuleTriggerTypes string
    The trigger types of config rules.
    Description string
    The description of the rule.
    EventSource string
    Event source of the Config Rule.
    ExcludeResourceIdsScope string
    The id of the resources to be evaluated against the rule.
    Id string
    The ID of the Aggregate Config Rule.
    InputParameters map[string]interface{}
    The settings of the input parameters for the rule.
    MaximumExecutionFrequency string
    The frequency of the compliance evaluations.
    ModifiedTimestamp string
    The timestamp when the rule was last modified.
    RegionIdsScope string
    The scope of resource region ids.
    ResourceGroupIdsScope string
    The scope of resource group ids.
    ResourceTypesScopes []string
    RiskLevel int
    Optional, ForceNew) The Risk Level. Valid values 1: critical, 2: warning, 3: info.
    SourceIdentifier string
    The identifier of the managed rule or the arn of the custom function.
    SourceOwner string
    The source owner of the Config Rule.
    Status string
    The state of the config rule, valid values: ACTIVE, DELETING, EVALUATING and INACTIVE.
    TagKeyScope string
    The scope of tay key.
    TagValueScope string
    The scope of tay value.
    accountId String
    The Aliyun User ID.
    aggregateConfigRuleName String
    The config rule name.
    aggregatorId String
    The ID of aggregator.
    compliancePackId String
    The ID of Compliance Package.
    compliances List<GetAggregateConfigRulesRuleCompliance>
    The Compliance information.
    configRuleArn String
    The config rule arn.
    configRuleId String
    The ID of the rule.
    configRuleTriggerTypes String
    The trigger types of config rules.
    description String
    The description of the rule.
    eventSource String
    Event source of the Config Rule.
    excludeResourceIdsScope String
    The id of the resources to be evaluated against the rule.
    id String
    The ID of the Aggregate Config Rule.
    inputParameters Map<String,Object>
    The settings of the input parameters for the rule.
    maximumExecutionFrequency String
    The frequency of the compliance evaluations.
    modifiedTimestamp String
    The timestamp when the rule was last modified.
    regionIdsScope String
    The scope of resource region ids.
    resourceGroupIdsScope String
    The scope of resource group ids.
    resourceTypesScopes List<String>
    riskLevel Integer
    Optional, ForceNew) The Risk Level. Valid values 1: critical, 2: warning, 3: info.
    sourceIdentifier String
    The identifier of the managed rule or the arn of the custom function.
    sourceOwner String
    The source owner of the Config Rule.
    status String
    The state of the config rule, valid values: ACTIVE, DELETING, EVALUATING and INACTIVE.
    tagKeyScope String
    The scope of tay key.
    tagValueScope String
    The scope of tay value.
    accountId string
    The Aliyun User ID.
    aggregateConfigRuleName string
    The config rule name.
    aggregatorId string
    The ID of aggregator.
    compliancePackId string
    The ID of Compliance Package.
    compliances GetAggregateConfigRulesRuleCompliance[]
    The Compliance information.
    configRuleArn string
    The config rule arn.
    configRuleId string
    The ID of the rule.
    configRuleTriggerTypes string
    The trigger types of config rules.
    description string
    The description of the rule.
    eventSource string
    Event source of the Config Rule.
    excludeResourceIdsScope string
    The id of the resources to be evaluated against the rule.
    id string
    The ID of the Aggregate Config Rule.
    inputParameters {[key: string]: any}
    The settings of the input parameters for the rule.
    maximumExecutionFrequency string
    The frequency of the compliance evaluations.
    modifiedTimestamp string
    The timestamp when the rule was last modified.
    regionIdsScope string
    The scope of resource region ids.
    resourceGroupIdsScope string
    The scope of resource group ids.
    resourceTypesScopes string[]
    riskLevel number
    Optional, ForceNew) The Risk Level. Valid values 1: critical, 2: warning, 3: info.
    sourceIdentifier string
    The identifier of the managed rule or the arn of the custom function.
    sourceOwner string
    The source owner of the Config Rule.
    status string
    The state of the config rule, valid values: ACTIVE, DELETING, EVALUATING and INACTIVE.
    tagKeyScope string
    The scope of tay key.
    tagValueScope string
    The scope of tay value.
    account_id str
    The Aliyun User ID.
    aggregate_config_rule_name str
    The config rule name.
    aggregator_id str
    The ID of aggregator.
    compliance_pack_id str
    The ID of Compliance Package.
    compliances Sequence[GetAggregateConfigRulesRuleCompliance]
    The Compliance information.
    config_rule_arn str
    The config rule arn.
    config_rule_id str
    The ID of the rule.
    config_rule_trigger_types str
    The trigger types of config rules.
    description str
    The description of the rule.
    event_source str
    Event source of the Config Rule.
    exclude_resource_ids_scope str
    The id of the resources to be evaluated against the rule.
    id str
    The ID of the Aggregate Config Rule.
    input_parameters Mapping[str, Any]
    The settings of the input parameters for the rule.
    maximum_execution_frequency str
    The frequency of the compliance evaluations.
    modified_timestamp str
    The timestamp when the rule was last modified.
    region_ids_scope str
    The scope of resource region ids.
    resource_group_ids_scope str
    The scope of resource group ids.
    resource_types_scopes Sequence[str]
    risk_level int
    Optional, ForceNew) The Risk Level. Valid values 1: critical, 2: warning, 3: info.
    source_identifier str
    The identifier of the managed rule or the arn of the custom function.
    source_owner str
    The source owner of the Config Rule.
    status str
    The state of the config rule, valid values: ACTIVE, DELETING, EVALUATING and INACTIVE.
    tag_key_scope str
    The scope of tay key.
    tag_value_scope str
    The scope of tay value.
    accountId String
    The Aliyun User ID.
    aggregateConfigRuleName String
    The config rule name.
    aggregatorId String
    The ID of aggregator.
    compliancePackId String
    The ID of Compliance Package.
    compliances List<Property Map>
    The Compliance information.
    configRuleArn String
    The config rule arn.
    configRuleId String
    The ID of the rule.
    configRuleTriggerTypes String
    The trigger types of config rules.
    description String
    The description of the rule.
    eventSource String
    Event source of the Config Rule.
    excludeResourceIdsScope String
    The id of the resources to be evaluated against the rule.
    id String
    The ID of the Aggregate Config Rule.
    inputParameters Map<Any>
    The settings of the input parameters for the rule.
    maximumExecutionFrequency String
    The frequency of the compliance evaluations.
    modifiedTimestamp String
    The timestamp when the rule was last modified.
    regionIdsScope String
    The scope of resource region ids.
    resourceGroupIdsScope String
    The scope of resource group ids.
    resourceTypesScopes List<String>
    riskLevel Number
    Optional, ForceNew) The Risk Level. Valid values 1: critical, 2: warning, 3: info.
    sourceIdentifier String
    The identifier of the managed rule or the arn of the custom function.
    sourceOwner String
    The source owner of the Config Rule.
    status String
    The state of the config rule, valid values: ACTIVE, DELETING, EVALUATING and INACTIVE.
    tagKeyScope String
    The scope of tay key.
    tagValueScope String
    The scope of tay value.

    GetAggregateConfigRulesRuleCompliance

    ComplianceType string
    The Compliance Type.
    Count int
    The Count.
    ComplianceType string
    The Compliance Type.
    Count int
    The Count.
    complianceType String
    The Compliance Type.
    count Integer
    The Count.
    complianceType string
    The Compliance Type.
    count number
    The Count.
    compliance_type str
    The Compliance Type.
    count int
    The Count.
    complianceType String
    The Compliance Type.
    count Number
    The Count.

    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