AggregateCompliancePackArgs

data class AggregateCompliancePackArgs(val aggregateCompliancePackName: Output<String>? = null, val aggregatorId: Output<String>? = null, val compliancePackTemplateId: Output<String>? = null, val configRuleIds: Output<List<AggregateCompliancePackConfigRuleIdArgs>>? = null, val configRules: Output<List<AggregateCompliancePackConfigRuleArgs>>? = null, val description: Output<String>? = null, val riskLevel: Output<Int>? = null) : ConvertibleToJava<AggregateCompliancePackArgs>

Provides a Cloud Config Aggregate Compliance Pack resource. For information about Cloud Config Aggregate Compliance Pack and how to use it, see What is Aggregate Compliance Pack.

NOTE: Available since v1.124.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.GetAccountsArgs;
import com.pulumi.alicloud.cfg.Aggregator;
import com.pulumi.alicloud.cfg.AggregatorArgs;
import com.pulumi.alicloud.cfg.inputs.AggregatorAggregatorAccountArgs;
import com.pulumi.alicloud.cfg.AggregateConfigRule;
import com.pulumi.alicloud.cfg.AggregateConfigRuleArgs;
import com.pulumi.alicloud.cfg.AggregateCompliancePack;
import com.pulumi.alicloud.cfg.AggregateCompliancePackArgs;
import com.pulumi.alicloud.cfg.inputs.AggregateCompliancePackConfigRuleIdArgs;
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 config = ctx.config();
final var name = config.get("name").orElse("terraform_example");
final var defaultAccounts = ResourcemanagerFunctions.getAccounts(GetAccountsArgs.builder()
.status("CreateSuccess")
.build());
var defaultAggregator = new Aggregator("defaultAggregator", AggregatorArgs.builder()
.aggregatorAccounts(AggregatorAggregatorAccountArgs.builder()
.accountId(defaultAccounts.applyValue(getAccountsResult -> getAccountsResult.accounts()[0].accountId()))
.accountName(defaultAccounts.applyValue(getAccountsResult -> getAccountsResult.accounts()[0].displayName()))
.accountType("ResourceDirectory")
.build())
.aggregatorName(name)
.description(name)
.aggregatorType("CUSTOM")
.build());
var defaultAggregateConfigRule = new AggregateConfigRule("defaultAggregateConfigRule", AggregateConfigRuleArgs.builder()
.aggregateConfigRuleName("contains-tag")
.aggregatorId(defaultAggregator.id())
.configRuleTriggerTypes("ConfigurationItemChangeNotification")
.sourceOwner("ALIYUN")
.sourceIdentifier("contains-tag")
.description(name)
.riskLevel(1)
.resourceTypesScopes("ACS::ECS::Instance")
.inputParameters(Map.ofEntries(
Map.entry("key", "example"),
Map.entry("value", "example")
))
.build());
var defaultAggregateCompliancePack = new AggregateCompliancePack("defaultAggregateCompliancePack", AggregateCompliancePackArgs.builder()
.aggregateCompliancePackName(name)
.aggregatorId(defaultAggregator.id())
.description(name)
.riskLevel(1)
.configRuleIds(AggregateCompliancePackConfigRuleIdArgs.builder()
.configRuleId(defaultAggregateConfigRule.configRuleId())
.build())
.build());
}
}

Import

Cloud Config Aggregate Compliance Pack can be imported using the id, e.g.

$ pulumi import alicloud:cfg/aggregateCompliancePack:AggregateCompliancePack example <aggregator_id>:<aggregator_compliance_pack_id>

Constructors

Link copied to clipboard
fun AggregateCompliancePackArgs(aggregateCompliancePackName: Output<String>? = null, aggregatorId: Output<String>? = null, compliancePackTemplateId: Output<String>? = null, configRuleIds: Output<List<AggregateCompliancePackConfigRuleIdArgs>>? = null, configRules: Output<List<AggregateCompliancePackConfigRuleArgs>>? = null, description: Output<String>? = null, riskLevel: Output<Int>? = null)

Functions

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

Properties

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

The name of compliance package name. NOTE: From version 1.145.0, aggregate_compliance_pack_name can be modified.

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

The ID of aggregator.

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

The Template ID of compliance package.

Link copied to clipboard

A list of Config Rule IDs. See config_rule_ids below.

Link copied to clipboard

A list of Config Rules. See config_rules below. NOTE: Field config_rules has been deprecated from provider version 1.141.0. New field config_rule_ids instead.

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

The description of compliance package.

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

The Risk Level. Valid values: