<filename>sdk/dotnet/Cfg/GetAggregateConfigRules.cs// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.AliCloud.Cfg
{
    public static class GetAggregateConfigRules
    {
        /// <summary>
        /// This data source provides the Config Aggregate Config Rules of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.124.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var example = AliCloud.Cfg.GetAggregateConfigRules.Invoke(new()
        ///     {
        ///         AggregatorId = "ca-3a9b626622af001d****",
        ///         Ids = new[]
        ///         {
        ///             "cr-5154626622af0034****",
        ///         },
        ///         NameRegex = "the_resource_name",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["firstConfigAggregateConfigRuleId"] = example.Apply(getAggregateConfigRulesResult =&gt; getAggregateConfigRulesResult.Rules[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetAggregateConfigRulesResult> InvokeAsync(GetAggregateConfigRulesArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetAggregateConfigRulesResult>("alicloud:cfg/getAggregateConfigRules:getAggregateConfigRules", args ?? new GetAggregateConfigRulesArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides the Config Aggregate Config Rules of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.124.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var example = AliCloud.Cfg.GetAggregateConfigRules.Invoke(new()
        ///     {
        ///         AggregatorId = "ca-3a9b626622af001d****",
        ///         Ids = new[]
        ///         {
        ///             "cr-5154626622af0034****",
        ///         },
        ///         NameRegex = "the_resource_name",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["firstConfigAggregateConfigRuleId"] = example.Apply(getAggregateConfigRulesResult =&gt; getAggregateConfigRulesResult.Rules[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetAggregateConfigRulesResult> Invoke(GetAggregateConfigRulesInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetAggregateConfigRulesResult>("alicloud:cfg/getAggregateConfigRules:getAggregateConfigRules", args ?? new GetAggregateConfigRulesInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetAggregateConfigRulesArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// The config rule name.
        /// </summary>
        [Input("aggregateConfigRuleName")]
        public string? AggregateConfigRuleName { get; set; }

        /// <summary>
        /// The ID of aggregator.
        /// </summary>
        [Input("aggregatorId", required: true)]
        public string AggregatorId { get; set; } = null!;

        /// <summary>
        /// Default to `false`. Set it to `true` can output more details about resource attributes.
        /// </summary>
        [Input("enableDetails")]
        public bool? EnableDetails { get; set; }

        [Input("ids")]
        private List<string>? _ids;

        /// <summary>
        /// A list of Aggregate Config Rule IDs.
        /// </summary>
        public List<string> Ids
        {
            get => _ids ?? (_ids = new List<string>());
            set => _ids = value;
        }

        /// <summary>
        /// A regex string to filter results by Aggregate Config Rule name.
        /// </summary>
        [Input("nameRegex")]
        public string? NameRegex { get; set; }

        [Input("outputFile")]
        public string? OutputFile { get; set; }

        /// <summary>
        /// Optional, ForceNew) The Risk Level. Valid values `1`: critical, `2`: warning, `3`: info.
        /// </summary>
        [Input("riskLevel")]
        public int? RiskLevel { get; set; }

        /// <summary>
        /// The state of the config rule, valid values: `ACTIVE`, `DELETING`, `EVALUATING` and `INACTIVE`.
        /// </summary>
        [Input("status")]
        public string? Status { get; set; }

        public GetAggregateConfigRulesArgs()
        {
        }
        public static new GetAggregateConfigRulesArgs Empty => new GetAggregateConfigRulesArgs();
    }

    public sealed class GetAggregateConfigRulesInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// The config rule name.
        /// </summary>
        [Input("aggregateConfigRuleName")]
        public Input<string>? AggregateConfigRuleName { get; set; }

        /// <summary>
        /// The ID of aggregator.
        /// </summary>
        [Input("aggregatorId", required: true)]
        public Input<string> AggregatorId { get; set; } = null!;

        /// <summary>
        /// Default to `false`. Set it to `true` can output more details about resource attributes.
        /// </summary>
        [Input("enableDetails")]
        public Input<bool>? EnableDetails { get; set; }

        [Input("ids")]
        private InputList<string>? _ids;

        /// <summary>
        /// A list of Aggregate Config Rule IDs.
        /// </summary>
        public InputList<string> Ids
        {
            get => _ids ?? (_ids = new InputList<string>());
            set => _ids = value;
        }

        /// <summary>
        /// A regex string to filter results by Aggregate Config Rule name.
        /// </summary>
        [Input("nameRegex")]
        public Input<string>? NameRegex { get; set; }

        [Input("outputFile")]
        public Input<string>? OutputFile { get; set; }

        /// <summary>
        /// Optional, ForceNew) The Risk Level. Valid values `1`: critical, `2`: warning, `3`: info.
        /// </summary>
        [Input("riskLevel")]
        public Input<int>? RiskLevel { get; set; }

        /// <summary>
        /// The state of the config rule, valid values: `ACTIVE`, `DELETING`, `EVALUATING` and `INACTIVE`.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        public GetAggregateConfigRulesInvokeArgs()
        {
        }
        public static new GetAggregateConfigRulesInvokeArgs Empty => new GetAggregateConfigRulesInvokeArgs();
    }


    [OutputType]
    public sealed class GetAggregateConfigRulesResult
    {
        /// <summary>
        /// The name of the rule.
        /// </summary>
        public readonly string? AggregateConfigRuleName;
        /// <summary>
        /// The ID of Aggregator.
        /// * `compliance` -The Compliance information.
        /// </summary>
        public readonly string AggregatorId;
        public readonly bool? EnableDetails;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly ImmutableArray<string> Ids;
        public readonly string? NameRegex;
        /// <summary>
        /// A list of Aggregate Config Rule names.
        /// </summary>
        public readonly ImmutableArray<string> Names;
        public readonly string? OutputFile;
        /// <summary>
        /// The risk level of the resources that are not compliant with the rule. Valid values: `1`: critical, `2`: warning, `3`: info.
        /// </summary>
        public readonly int? RiskLevel;
        /// <summary>
        /// A list of Config Aggregate Config Rules. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetAggregateConfigRulesRuleResult> Rules;
        /// <summary>
        /// The status of the rule.
        /// </summary>
        public readonly string? Status;

        [OutputConstructor]
        private GetAggregateConfigRulesResult(
            string? aggregateConfigRuleName,

            string aggregatorId,

            bool? enableDetails,

            string id,

            ImmutableArray<string> ids,

            string? nameRegex,

            ImmutableArray<string> names,

            string? outputFile,

            int? riskLevel,

            ImmutableArray<Outputs.GetAggregateConfigRulesRuleResult> rules,

            string? status)
        {
            AggregateConfigRuleName = aggregateConfigRuleName;
            AggregatorId = aggregatorId;
            EnableDetails = enableDetails;
            Id = id;
            Ids = ids;
            NameRegex = nameRegex;
            Names = names;
            OutputFile = outputFile;
            RiskLevel = riskLevel;
            Rules = rules;
            Status = status;
        }
    }
}
