Rule Args
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<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 Config Rule resource. For information about Config Rule and how to use it, see What is Rule.
NOTE: Available since v1.204.0.
Example Usage
Basic Usage
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 defaultResourceGroups = 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(defaultResourceGroups.applyValue(getResourceGroupsResult -> getResourceGroupsResult.ids()[0]))
.resourceTypesScopes("ACS::RDS::DBInstance")
.ruleName("contains-tag")
.inputParameters(Map.ofEntries(
Map.entry("key", "example"),
Map.entry("value", "example")
))
.build());
}
}
Content copied to clipboard
Import
Config Rule can be imported using the id, e.g.
$ pulumi import alicloud:cfg/rule:Rule example <id>
Content copied to clipboard
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<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
Properties
Link copied to clipboard
Link copied to clipboard
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.