RuleArgs

data class RuleArgs(val configRuleTriggerTypes: Output<String>? = null, val description: Output<String>? = null, val excludeResourceIdsScope: Output<String>? = null, val inputParameters: Output<Map<String, Any>>? = null, val maximumExecutionFrequency: Output<String>? = null, val regionIdsScope: Output<String>? = null, val resourceGroupIdsScope: Output<String>? = null, val resourceTypesScopes: Output<List<String>>? = null, val riskLevel: Output<Int>? = null, val ruleName: Output<String>? = null, val scopeComplianceResourceTypes: Output<List<String>>? = null, val sourceDetailMessageType: Output<String>? = null, val sourceIdentifier: Output<String>? = null, val sourceMaximumExecutionFrequency: Output<String>? = null, val sourceOwner: Output<String>? = null, val status: Output<String>? = null, val tagKeyScope: Output<String>? = null, val tagValueScope: Output<String>? = null) : ConvertibleToJava<RuleArgs>

Provides a a Alicloud Config Rule resource. Cloud Config checks the validity of resources based on rules. You can create rules to evaluate resources as needed. For information about Alicloud Config Rule and how to use it, see What is Alicloud Config Rule.

NOTE: Available in v1.99.0+. NOTE: The Cloud Config region only support cn-shanghai and ap-southeast-1. NOTE: If you use custom rules, you need to create your own rule functions in advance. Please refer to the link for Create a custom rule.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
var example = new Rule("example", RuleArgs.builder()
.configRuleTriggerTypes("ConfigurationItemChangeNotification")
.description("ecs instances in vpc")
.inputParameters(Map.of("vpcIds", "vpc-uf6gksw4ctjd******"))
.resourceTypesScopes("ACS::ECS::Instance")
.riskLevel(1)
.ruleName("instances-in-vpc")
.sourceIdentifier("ecs-instances-in-vpc")
.sourceOwner("ALIYUN")
.build());
}
}

Import

Alicloud Config Rule can be imported using the id, e.g.

$ pulumi import alicloud:cfg/rule:Rule this cr-ed4bad756057********

Constructors

Link copied to clipboard
fun RuleArgs(configRuleTriggerTypes: Output<String>? = null, description: Output<String>? = null, excludeResourceIdsScope: Output<String>? = null, inputParameters: Output<Map<String, Any>>? = null, maximumExecutionFrequency: Output<String>? = null, regionIdsScope: Output<String>? = null, resourceGroupIdsScope: Output<String>? = null, resourceTypesScopes: Output<List<String>>? = null, riskLevel: Output<Int>? = null, ruleName: Output<String>? = null, scopeComplianceResourceTypes: Output<List<String>>? = null, sourceDetailMessageType: Output<String>? = null, sourceIdentifier: Output<String>? = null, sourceMaximumExecutionFrequency: Output<String>? = null, sourceOwner: Output<String>? = null, status: Output<String>? = null, tagKeyScope: Output<String>? = null, tagValueScope: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): RuleArgs

Properties

Link copied to clipboard
val configRuleTriggerTypes: Output<String>? = null

The trigger type of the rule. Valid values: ConfigurationItemChangeNotification: The rule is triggered upon configuration changes. ScheduledNotification: The rule is triggered as scheduled.

Link copied to clipboard
val description: Output<String>? = null

The description of the Config Rule.

Link copied to clipboard
val excludeResourceIdsScope: Output<String>? = null

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.

Link copied to clipboard
val inputParameters: Output<Map<String, Any>>? = null

Threshold value for managed rule triggering.

Link copied to clipboard
val maximumExecutionFrequency: Output<String>? = null

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.

Link copied to clipboard
val regionIdsScope: Output<String>? = null

The rule monitors region IDs, separated by commas, only applies to rules created based on managed rules.

Link copied to clipboard
val resourceGroupIdsScope: Output<String>? = null

The rule monitors resource group IDs, separated by commas, only applies to rules created based on managed rules.

Link copied to clipboard
val resourceTypesScopes: Output<List<String>>? = null
Link copied to clipboard
val riskLevel: Output<Int>? = null

The risk level of the Config Rule. Valid values: 1: Critical ,2: Warning , 3: Info.

Link copied to clipboard
val ruleName: Output<String>? = null

The name of the Config Rule.

Link copied to clipboard

Field scope_compliance_resource_types has been deprecated from provider version 1.124.1. New field resource_types_scope instead.

Link copied to clipboard
val sourceDetailMessageType: Output<String>? = null

Field source_detail_message_type has been deprecated from provider version 1.124.1. New field config_rule_trigger_types instead.

Link copied to clipboard
val sourceIdentifier: Output<String>? = null

The identifier of the rule. For a managed rule, the value is the identifier of the managed rule. For a custom rule, the value is the ARN of the custom rule. Using managed rules, refer to List of Managed rules.

Link copied to clipboard

Field source_maximum_execution_frequency has been deprecated from provider version 1.124.1. New field maximum_execution_frequency instead.

Link copied to clipboard
val sourceOwner: Output<String>? = null

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.

Link copied to clipboard
val status: Output<String>? = null

The rule status. The valid values: ACTIVE, INACTIVE.

Link copied to clipboard
val tagKeyScope: Output<String>? = null

The rule monitors the tag key, only applies to rules created based on managed rules.

Link copied to clipboard
val tagValueScope: Output<String>? = null

The rule monitors the tag value, use with the tag_key_scope options. only applies to rules created based on managed rules.