Rule
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
andap-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********
Properties
Resource types to be evaluated. Alibaba Cloud services that support Cloud Config.
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.