All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.alicloud.cfg.kotlin.RuleArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 3.62.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.alicloud.cfg.kotlin

import com.pulumi.alicloud.cfg.RuleArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Deprecated
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Provides a Config Rule resource.
 * For information about Config Rule and how to use it, see [What is Rule](https://www.alibabacloud.com/help/en/cloud-config/latest/api-config-2020-09-07-createconfigrule).
 * > **NOTE:** Available since v1.204.0.
 * ## Example Usage
 * Basic Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as alicloud from "@pulumi/alicloud";
 * const default = alicloud.resourcemanager.getResourceGroups({
 *     status: "OK",
 * });
 * const defaultRule = new alicloud.cfg.Rule("default", {
 *     description: "If the resource matches one of the specified tag key-value pairs, the configuration is considered compliant.",
 *     sourceOwner: "ALIYUN",
 *     sourceIdentifier: "contains-tag",
 *     riskLevel: 1,
 *     tagValueScope: "example-value",
 *     tagKeyScope: "example-key",
 *     excludeResourceIdsScope: "example-resource_id",
 *     regionIdsScope: "cn-hangzhou",
 *     configRuleTriggerTypes: "ConfigurationItemChangeNotification",
 *     resourceGroupIdsScope: _default.then(_default => _default.ids?.[0]),
 *     resourceTypesScopes: ["ACS::RDS::DBInstance"],
 *     ruleName: "contains-tag",
 *     inputParameters: {
 *         key: "example",
 *         value: "example",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_alicloud as alicloud
 * default = alicloud.resourcemanager.get_resource_groups(status="OK")
 * default_rule = alicloud.cfg.Rule("default",
 *     description="If the resource matches one of the specified tag key-value pairs, the configuration is considered compliant.",
 *     source_owner="ALIYUN",
 *     source_identifier="contains-tag",
 *     risk_level=1,
 *     tag_value_scope="example-value",
 *     tag_key_scope="example-key",
 *     exclude_resource_ids_scope="example-resource_id",
 *     region_ids_scope="cn-hangzhou",
 *     config_rule_trigger_types="ConfigurationItemChangeNotification",
 *     resource_group_ids_scope=default.ids[0],
 *     resource_types_scopes=["ACS::RDS::DBInstance"],
 *     rule_name="contains-tag",
 *     input_parameters={
 *         "key": "example",
 *         "value": "example",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AliCloud = Pulumi.AliCloud;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = AliCloud.ResourceManager.GetResourceGroups.Invoke(new()
 *     {
 *         Status = "OK",
 *     });
 *     var defaultRule = new AliCloud.Cfg.Rule("default", new()
 *     {
 *         Description = "If the resource matches one of the specified tag key-value pairs, the configuration is considered compliant.",
 *         SourceOwner = "ALIYUN",
 *         SourceIdentifier = "contains-tag",
 *         RiskLevel = 1,
 *         TagValueScope = "example-value",
 *         TagKeyScope = "example-key",
 *         ExcludeResourceIdsScope = "example-resource_id",
 *         RegionIdsScope = "cn-hangzhou",
 *         ConfigRuleTriggerTypes = "ConfigurationItemChangeNotification",
 *         ResourceGroupIdsScope = @default.Apply(@default => @default.Apply(getResourceGroupsResult => getResourceGroupsResult.Ids[0])),
 *         ResourceTypesScopes = new[]
 *         {
 *             "ACS::RDS::DBInstance",
 *         },
 *         RuleName = "contains-tag",
 *         InputParameters =
 *         {
 *             { "key", "example" },
 *             { "value", "example" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cfg"
 * 	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_default, err := resourcemanager.GetResourceGroups(ctx, &resourcemanager.GetResourceGroupsArgs{
 * 			Status: pulumi.StringRef("OK"),
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = cfg.NewRule(ctx, "default", &cfg.RuleArgs{
 * 			Description:             pulumi.String("If the resource matches one of the specified tag key-value pairs, the configuration is considered compliant."),
 * 			SourceOwner:             pulumi.String("ALIYUN"),
 * 			SourceIdentifier:        pulumi.String("contains-tag"),
 * 			RiskLevel:               pulumi.Int(1),
 * 			TagValueScope:           pulumi.String("example-value"),
 * 			TagKeyScope:             pulumi.String("example-key"),
 * 			ExcludeResourceIdsScope: pulumi.String("example-resource_id"),
 * 			RegionIdsScope:          pulumi.String("cn-hangzhou"),
 * 			ConfigRuleTriggerTypes:  pulumi.String("ConfigurationItemChangeNotification"),
 * 			ResourceGroupIdsScope:   pulumi.String(_default.Ids[0]),
 * 			ResourceTypesScopes: pulumi.StringArray{
 * 				pulumi.String("ACS::RDS::DBInstance"),
 * 			},
 * 			RuleName: pulumi.String("contains-tag"),
 * 			InputParameters: pulumi.StringMap{
 * 				"key":   pulumi.String("example"),
 * 				"value": pulumi.String("example"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.alicloud.resourcemanager.ResourcemanagerFunctions;
 * import com.pulumi.alicloud.resourcemanager.inputs.GetResourceGroupsArgs;
 * import com.pulumi.alicloud.cfg.Rule;
 * import com.pulumi.alicloud.cfg.RuleArgs;
 * 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 default = ResourcemanagerFunctions.getResourceGroups(GetResourceGroupsArgs.builder()
 *             .status("OK")
 *             .build());
 *         var defaultRule = new Rule("defaultRule", RuleArgs.builder()
 *             .description("If the resource matches one of the specified tag key-value pairs, the configuration is considered compliant.")
 *             .sourceOwner("ALIYUN")
 *             .sourceIdentifier("contains-tag")
 *             .riskLevel(1)
 *             .tagValueScope("example-value")
 *             .tagKeyScope("example-key")
 *             .excludeResourceIdsScope("example-resource_id")
 *             .regionIdsScope("cn-hangzhou")
 *             .configRuleTriggerTypes("ConfigurationItemChangeNotification")
 *             .resourceGroupIdsScope(default_.ids()[0])
 *             .resourceTypesScopes("ACS::RDS::DBInstance")
 *             .ruleName("contains-tag")
 *             .inputParameters(Map.ofEntries(
 *                 Map.entry("key", "example"),
 *                 Map.entry("value", "example")
 *             ))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   defaultRule:
 *     type: alicloud:cfg:Rule
 *     name: default
 *     properties:
 *       description: If the resource matches one of the specified tag key-value pairs, the configuration is considered compliant.
 *       sourceOwner: ALIYUN
 *       sourceIdentifier: contains-tag
 *       riskLevel: 1
 *       tagValueScope: example-value
 *       tagKeyScope: example-key
 *       excludeResourceIdsScope: example-resource_id
 *       regionIdsScope: cn-hangzhou
 *       configRuleTriggerTypes: ConfigurationItemChangeNotification
 *       resourceGroupIdsScope: ${default.ids[0]}
 *       resourceTypesScopes:
 *         - ACS::RDS::DBInstance
 *       ruleName: contains-tag
 *       inputParameters:
 *         key: example
 *         value: example
 * variables:
 *   default:
 *     fn::invoke:
 *       Function: alicloud:resourcemanager:getResourceGroups
 *       Arguments:
 *         status: OK
 * ```
 * 
 * ## Import
 * Config Rule can be imported using the id, e.g.
 * ```sh
 * $ pulumi import alicloud:cfg/rule:Rule example 
 * ```
 * @property configRuleTriggerTypes The trigger type of the rule. Valid values:  `ConfigurationItemChangeNotification`: The rule is triggered upon configuration changes. `ScheduledNotification`: The rule is triggered as scheduled.
 * @property description The description of the rule.
 * @property excludeResourceIdsScope The rule monitors excluded resource IDs, multiple of which are separated by commas, only applies to rules created based on managed rules, , custom rule this field is empty.
 * @property inputParameters The settings of the input parameters for the rule.
 * @property maximumExecutionFrequency The frequency of the compliance evaluations, it is required if the ConfigRuleTriggerTypes value is ScheduledNotification. Valid values:  `One_Hour`, `Three_Hours`, `Six_Hours`, `Twelve_Hours`, `TwentyFour_Hours`.
 * @property regionIdsScope The rule monitors region IDs, separated by commas, only applies to rules created based on managed rules.
 * @property resourceGroupIdsScope The rule monitors resource group IDs, separated by commas, only applies to rules created based on managed rules.
 * @property resourceTypesScopes The types of the resources to be evaluated against the rule.
 * @property riskLevel The risk level of the resources that are not compliant with the rule. Valid values:  `1`: critical `2`: warning `3`: info
 * @property ruleName The name of the rule.
 * @property scopeComplianceResourceTypes Field 'scope_compliance_resource_types' has been deprecated from provider version 1.124.1. New field 'resource_types_scope' instead.
 * @property sourceDetailMessageType Field 'source_detail_message_type' has been deprecated from provider version 1.124.1. New field 'config_rule_trigger_types' instead.
 * @property sourceIdentifier The identifier of the rule.  For a managed rule, the value is the name of the managed rule. For a custom rule, the value is the ARN of the custom rule.
 * @property sourceMaximumExecutionFrequency Field 'source_maximum_execution_frequency' has been deprecated from provider version 1.124.1. New field 'maximum_execution_frequency' instead.
 * @property sourceOwner Specifies whether you or Alibaba Cloud owns and manages the rule. Valid values:  `CUSTOM_FC`: The rule is a custom rule and you own the rule. `ALIYUN`: The rule is a managed rule and Alibaba Cloud owns the rule
 * @property status The status of the rule. Valid values: ACTIVE: The rule is monitoring the configurations of target resources. DELETING_RESULTS: The compliance evaluation result returned by the rule is being deleted. EVALUATING: The rule is triggered and is evaluating whether the configurations of target resources are compliant. INACTIVE: The rule is disabled from monitoring the configurations of target resources.
 * @property tagKeyScope The rule monitors the tag key, only applies to rules created based on managed rules.
 * @property tagValueScope The rule monitors the tag value, only applies to rules created based on managed rules.
 * The following arguments will be discarded. Please use new fields as soon as possible:
 */
public data class RuleArgs(
    public val configRuleTriggerTypes: Output? = null,
    public val description: Output? = null,
    public val excludeResourceIdsScope: Output? = null,
    public val inputParameters: Output>? = null,
    public val maximumExecutionFrequency: Output? = null,
    public val regionIdsScope: Output? = null,
    public val resourceGroupIdsScope: Output? = null,
    public val resourceTypesScopes: Output>? = null,
    public val riskLevel: Output? = null,
    public val ruleName: Output? = null,
    @Deprecated(
        message = """
  Field 'scope_compliance_resource_types' has been deprecated from provider version 1.124.1. New
      field 'resource_types_scope' instead.
  """,
    )
    public val scopeComplianceResourceTypes: Output? = null,
    @Deprecated(
        message = """
  Field 'source_detail_message_type' has been deprecated from provider version 1.124.1. New field
      'config_rule_trigger_types' instead.
  """,
    )
    public val sourceDetailMessageType: Output? = null,
    public val sourceIdentifier: Output? = null,
    @Deprecated(
        message = """
  Field 'source_maximum_execution_frequency' has been deprecated from provider version 1.124.1. New
      field 'maximum_execution_frequency' instead.
  """,
    )
    public val sourceMaximumExecutionFrequency: Output? = null,
    public val sourceOwner: Output? = null,
    public val status: Output? = null,
    public val tagKeyScope: Output? = null,
    public val tagValueScope: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.alicloud.cfg.RuleArgs =
        com.pulumi.alicloud.cfg.RuleArgs.builder()
            .configRuleTriggerTypes(configRuleTriggerTypes?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .excludeResourceIdsScope(excludeResourceIdsScope?.applyValue({ args0 -> args0 }))
            .inputParameters(
                inputParameters?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .maximumExecutionFrequency(maximumExecutionFrequency?.applyValue({ args0 -> args0 }))
            .regionIdsScope(regionIdsScope?.applyValue({ args0 -> args0 }))
            .resourceGroupIdsScope(resourceGroupIdsScope?.applyValue({ args0 -> args0 }))
            .resourceTypesScopes(resourceTypesScopes?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .riskLevel(riskLevel?.applyValue({ args0 -> args0 }))
            .ruleName(ruleName?.applyValue({ args0 -> args0 }))
            .scopeComplianceResourceTypes(scopeComplianceResourceTypes?.applyValue({ args0 -> args0 }))
            .sourceDetailMessageType(sourceDetailMessageType?.applyValue({ args0 -> args0 }))
            .sourceIdentifier(sourceIdentifier?.applyValue({ args0 -> args0 }))
            .sourceMaximumExecutionFrequency(sourceMaximumExecutionFrequency?.applyValue({ args0 -> args0 }))
            .sourceOwner(sourceOwner?.applyValue({ args0 -> args0 }))
            .status(status?.applyValue({ args0 -> args0 }))
            .tagKeyScope(tagKeyScope?.applyValue({ args0 -> args0 }))
            .tagValueScope(tagValueScope?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [RuleArgs].
 */
@PulumiTagMarker
public class RuleArgsBuilder internal constructor() {
    private var configRuleTriggerTypes: Output? = null

    private var description: Output? = null

    private var excludeResourceIdsScope: Output? = null

    private var inputParameters: Output>? = null

    private var maximumExecutionFrequency: Output? = null

    private var regionIdsScope: Output? = null

    private var resourceGroupIdsScope: Output? = null

    private var resourceTypesScopes: Output>? = null

    private var riskLevel: Output? = null

    private var ruleName: Output? = null

    private var scopeComplianceResourceTypes: Output? = null

    private var sourceDetailMessageType: Output? = null

    private var sourceIdentifier: Output? = null

    private var sourceMaximumExecutionFrequency: Output? = null

    private var sourceOwner: Output? = null

    private var status: Output? = null

    private var tagKeyScope: Output? = null

    private var tagValueScope: Output? = null

    /**
     * @param value The trigger type of the rule. Valid values:  `ConfigurationItemChangeNotification`: The rule is triggered upon configuration changes. `ScheduledNotification`: The rule is triggered as scheduled.
     */
    @JvmName("phojrukfsofncuyu")
    public suspend fun configRuleTriggerTypes(`value`: Output) {
        this.configRuleTriggerTypes = value
    }

    /**
     * @param value The description of the rule.
     */
    @JvmName("rptsiihbfqutqoad")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The rule monitors excluded resource IDs, multiple of which are separated by commas, only applies to rules created based on managed rules, , custom rule this field is empty.
     */
    @JvmName("eoxfxddjrtndjmjn")
    public suspend fun excludeResourceIdsScope(`value`: Output) {
        this.excludeResourceIdsScope = value
    }

    /**
     * @param value The settings of the input parameters for the rule.
     */
    @JvmName("dnnvacjbnvjjgbrb")
    public suspend fun inputParameters(`value`: Output>) {
        this.inputParameters = value
    }

    /**
     * @param value The frequency of the compliance evaluations, it is required if the ConfigRuleTriggerTypes value is ScheduledNotification. Valid values:  `One_Hour`, `Three_Hours`, `Six_Hours`, `Twelve_Hours`, `TwentyFour_Hours`.
     */
    @JvmName("eavtsmgarduapgmj")
    public suspend fun maximumExecutionFrequency(`value`: Output) {
        this.maximumExecutionFrequency = value
    }

    /**
     * @param value The rule monitors region IDs, separated by commas, only applies to rules created based on managed rules.
     */
    @JvmName("hxfhbqldryobxgre")
    public suspend fun regionIdsScope(`value`: Output) {
        this.regionIdsScope = value
    }

    /**
     * @param value The rule monitors resource group IDs, separated by commas, only applies to rules created based on managed rules.
     */
    @JvmName("yirxqhmagoewscdo")
    public suspend fun resourceGroupIdsScope(`value`: Output) {
        this.resourceGroupIdsScope = value
    }

    /**
     * @param value The types of the resources to be evaluated against the rule.
     */
    @JvmName("nmomtasimcklqegb")
    public suspend fun resourceTypesScopes(`value`: Output>) {
        this.resourceTypesScopes = value
    }

    @JvmName("hjdjbhusguugiyut")
    public suspend fun resourceTypesScopes(vararg values: Output) {
        this.resourceTypesScopes = Output.all(values.asList())
    }

    /**
     * @param values The types of the resources to be evaluated against the rule.
     */
    @JvmName("mhfyniobqpeuuuhx")
    public suspend fun resourceTypesScopes(values: List>) {
        this.resourceTypesScopes = Output.all(values)
    }

    /**
     * @param value The risk level of the resources that are not compliant with the rule. Valid values:  `1`: critical `2`: warning `3`: info
     */
    @JvmName("lkefvdtbcfqirprc")
    public suspend fun riskLevel(`value`: Output) {
        this.riskLevel = value
    }

    /**
     * @param value The name of the rule.
     */
    @JvmName("ttegyhxccjyronsi")
    public suspend fun ruleName(`value`: Output) {
        this.ruleName = value
    }

    /**
     * @param value Field 'scope_compliance_resource_types' has been deprecated from provider version 1.124.1. New field 'resource_types_scope' instead.
     */
    @Deprecated(
        message = """
  Field 'scope_compliance_resource_types' has been deprecated from provider version 1.124.1. New
      field 'resource_types_scope' instead.
  """,
    )
    @JvmName("sjtqvppjbhuriver")
    public suspend fun scopeComplianceResourceTypes(`value`: Output) {
        this.scopeComplianceResourceTypes = value
    }

    /**
     * @param value Field 'source_detail_message_type' has been deprecated from provider version 1.124.1. New field 'config_rule_trigger_types' instead.
     */
    @Deprecated(
        message = """
  Field 'source_detail_message_type' has been deprecated from provider version 1.124.1. New field
      'config_rule_trigger_types' instead.
  """,
    )
    @JvmName("togaucckysphipgk")
    public suspend fun sourceDetailMessageType(`value`: Output) {
        this.sourceDetailMessageType = value
    }

    /**
     * @param value The identifier of the rule.  For a managed rule, the value is the name of the managed rule. For a custom rule, the value is the ARN of the custom rule.
     */
    @JvmName("rvkhpccqfxaemtku")
    public suspend fun sourceIdentifier(`value`: Output) {
        this.sourceIdentifier = value
    }

    /**
     * @param value Field 'source_maximum_execution_frequency' has been deprecated from provider version 1.124.1. New field 'maximum_execution_frequency' instead.
     */
    @Deprecated(
        message = """
  Field 'source_maximum_execution_frequency' has been deprecated from provider version 1.124.1. New
      field 'maximum_execution_frequency' instead.
  """,
    )
    @JvmName("ekcarwlliyqfwyvy")
    public suspend fun sourceMaximumExecutionFrequency(`value`: Output) {
        this.sourceMaximumExecutionFrequency = value
    }

    /**
     * @param value Specifies whether you or Alibaba Cloud owns and manages the rule. Valid values:  `CUSTOM_FC`: The rule is a custom rule and you own the rule. `ALIYUN`: The rule is a managed rule and Alibaba Cloud owns the rule
     */
    @JvmName("feguinfuomxwdgxm")
    public suspend fun sourceOwner(`value`: Output) {
        this.sourceOwner = value
    }

    /**
     * @param value The status of the rule. Valid values: ACTIVE: The rule is monitoring the configurations of target resources. DELETING_RESULTS: The compliance evaluation result returned by the rule is being deleted. EVALUATING: The rule is triggered and is evaluating whether the configurations of target resources are compliant. INACTIVE: The rule is disabled from monitoring the configurations of target resources.
     */
    @JvmName("hfnfdplmvgumsaqc")
    public suspend fun status(`value`: Output) {
        this.status = value
    }

    /**
     * @param value The rule monitors the tag key, only applies to rules created based on managed rules.
     */
    @JvmName("bcevqyhqmkswtaqb")
    public suspend fun tagKeyScope(`value`: Output) {
        this.tagKeyScope = value
    }

    /**
     * @param value The rule monitors the tag value, only applies to rules created based on managed rules.
     * The following arguments will be discarded. Please use new fields as soon as possible:
     */
    @JvmName("ekbkpxavecptfvwi")
    public suspend fun tagValueScope(`value`: Output) {
        this.tagValueScope = value
    }

    /**
     * @param value The trigger type of the rule. Valid values:  `ConfigurationItemChangeNotification`: The rule is triggered upon configuration changes. `ScheduledNotification`: The rule is triggered as scheduled.
     */
    @JvmName("ogqinfsbehcrurcp")
    public suspend fun configRuleTriggerTypes(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.configRuleTriggerTypes = mapped
    }

    /**
     * @param value The description of the rule.
     */
    @JvmName("mjlsaojeegsxrtqu")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The rule monitors excluded resource IDs, multiple of which are separated by commas, only applies to rules created based on managed rules, , custom rule this field is empty.
     */
    @JvmName("fdwjtkwngaturcfw")
    public suspend fun excludeResourceIdsScope(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.excludeResourceIdsScope = mapped
    }

    /**
     * @param value The settings of the input parameters for the rule.
     */
    @JvmName("hlryrgsbqqxloabo")
    public suspend fun inputParameters(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.inputParameters = mapped
    }

    /**
     * @param values The settings of the input parameters for the rule.
     */
    @JvmName("gbqeaywsvwikhtmk")
    public fun inputParameters(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.inputParameters = mapped
    }

    /**
     * @param value The frequency of the compliance evaluations, it is required if the ConfigRuleTriggerTypes value is ScheduledNotification. Valid values:  `One_Hour`, `Three_Hours`, `Six_Hours`, `Twelve_Hours`, `TwentyFour_Hours`.
     */
    @JvmName("gixwgdnofrkwmxfb")
    public suspend fun maximumExecutionFrequency(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maximumExecutionFrequency = mapped
    }

    /**
     * @param value The rule monitors region IDs, separated by commas, only applies to rules created based on managed rules.
     */
    @JvmName("wukyetxwtnalodao")
    public suspend fun regionIdsScope(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.regionIdsScope = mapped
    }

    /**
     * @param value The rule monitors resource group IDs, separated by commas, only applies to rules created based on managed rules.
     */
    @JvmName("tkgilosgwvlswekn")
    public suspend fun resourceGroupIdsScope(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupIdsScope = mapped
    }

    /**
     * @param value The types of the resources to be evaluated against the rule.
     */
    @JvmName("iocmnvlxunmtytaq")
    public suspend fun resourceTypesScopes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceTypesScopes = mapped
    }

    /**
     * @param values The types of the resources to be evaluated against the rule.
     */
    @JvmName("haqnxqsdpifecgrn")
    public suspend fun resourceTypesScopes(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.resourceTypesScopes = mapped
    }

    /**
     * @param value The risk level of the resources that are not compliant with the rule. Valid values:  `1`: critical `2`: warning `3`: info
     */
    @JvmName("xdkyeiqaqenltqax")
    public suspend fun riskLevel(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.riskLevel = mapped
    }

    /**
     * @param value The name of the rule.
     */
    @JvmName("mucstvigbgbhudjx")
    public suspend fun ruleName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ruleName = mapped
    }

    /**
     * @param value Field 'scope_compliance_resource_types' has been deprecated from provider version 1.124.1. New field 'resource_types_scope' instead.
     */
    @Deprecated(
        message = """
  Field 'scope_compliance_resource_types' has been deprecated from provider version 1.124.1. New
      field 'resource_types_scope' instead.
  """,
    )
    @JvmName("kwmvfttehkeliqoo")
    public suspend fun scopeComplianceResourceTypes(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scopeComplianceResourceTypes = mapped
    }

    /**
     * @param value Field 'source_detail_message_type' has been deprecated from provider version 1.124.1. New field 'config_rule_trigger_types' instead.
     */
    @Deprecated(
        message = """
  Field 'source_detail_message_type' has been deprecated from provider version 1.124.1. New field
      'config_rule_trigger_types' instead.
  """,
    )
    @JvmName("baojgchopcxheldh")
    public suspend fun sourceDetailMessageType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceDetailMessageType = mapped
    }

    /**
     * @param value The identifier of the rule.  For a managed rule, the value is the name of the managed rule. For a custom rule, the value is the ARN of the custom rule.
     */
    @JvmName("cpltypnrfrdsvpwk")
    public suspend fun sourceIdentifier(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceIdentifier = mapped
    }

    /**
     * @param value Field 'source_maximum_execution_frequency' has been deprecated from provider version 1.124.1. New field 'maximum_execution_frequency' instead.
     */
    @Deprecated(
        message = """
  Field 'source_maximum_execution_frequency' has been deprecated from provider version 1.124.1. New
      field 'maximum_execution_frequency' instead.
  """,
    )
    @JvmName("utkjgxtpxqaltjox")
    public suspend fun sourceMaximumExecutionFrequency(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceMaximumExecutionFrequency = mapped
    }

    /**
     * @param value Specifies whether you or Alibaba Cloud owns and manages the rule. Valid values:  `CUSTOM_FC`: The rule is a custom rule and you own the rule. `ALIYUN`: The rule is a managed rule and Alibaba Cloud owns the rule
     */
    @JvmName("fljjuhrykeskjpsx")
    public suspend fun sourceOwner(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceOwner = mapped
    }

    /**
     * @param value The status of the rule. Valid values: ACTIVE: The rule is monitoring the configurations of target resources. DELETING_RESULTS: The compliance evaluation result returned by the rule is being deleted. EVALUATING: The rule is triggered and is evaluating whether the configurations of target resources are compliant. INACTIVE: The rule is disabled from monitoring the configurations of target resources.
     */
    @JvmName("mmgdsfxgdmqxtxpv")
    public suspend fun status(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.status = mapped
    }

    /**
     * @param value The rule monitors the tag key, only applies to rules created based on managed rules.
     */
    @JvmName("dkatxcxbvytpjhpe")
    public suspend fun tagKeyScope(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tagKeyScope = mapped
    }

    /**
     * @param value The rule monitors the tag value, only applies to rules created based on managed rules.
     * The following arguments will be discarded. Please use new fields as soon as possible:
     */
    @JvmName("wqjsjsimoyxorvad")
    public suspend fun tagValueScope(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tagValueScope = mapped
    }

    internal fun build(): RuleArgs = RuleArgs(
        configRuleTriggerTypes = configRuleTriggerTypes,
        description = description,
        excludeResourceIdsScope = excludeResourceIdsScope,
        inputParameters = inputParameters,
        maximumExecutionFrequency = maximumExecutionFrequency,
        regionIdsScope = regionIdsScope,
        resourceGroupIdsScope = resourceGroupIdsScope,
        resourceTypesScopes = resourceTypesScopes,
        riskLevel = riskLevel,
        ruleName = ruleName,
        scopeComplianceResourceTypes = scopeComplianceResourceTypes,
        sourceDetailMessageType = sourceDetailMessageType,
        sourceIdentifier = sourceIdentifier,
        sourceMaximumExecutionFrequency = sourceMaximumExecutionFrequency,
        sourceOwner = sourceOwner,
        status = status,
        tagKeyScope = tagKeyScope,
        tagValueScope = tagValueScope,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy