import { Command as $Command } from "@smithy/smithy-client"; import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import type { ConfigServiceClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConfigServiceClient"; import type { PutConfigRuleRequest } from "../models/models_0"; /** * @public */ export type { __MetadataBearer }; export { $Command }; /** * @public * * The input for {@link PutConfigRuleCommand}. */ export interface PutConfigRuleCommandInput extends PutConfigRuleRequest { } /** * @public * * The output of {@link PutConfigRuleCommand}. */ export interface PutConfigRuleCommandOutput extends __MetadataBearer { } declare const PutConfigRuleCommand_base: { new (input: PutConfigRuleCommandInput): import("@smithy/smithy-client").CommandImpl; new (input: PutConfigRuleCommandInput): import("@smithy/smithy-client").CommandImpl; getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions; }; /** *

Adds or updates an Config rule to evaluate if your * Amazon Web Services resources comply with your desired configurations. For information on how many Config rules you can have per account, * see * Service Limits * in the Config Developer Guide.

*

There are two types of rules: Config Managed Rules and Config Custom Rules. * You can use PutConfigRule to create both Config Managed Rules and Config Custom Rules.

*

Config Managed Rules are predefined, * customizable rules created by Config. For a list of managed rules, see * List of Config * Managed Rules. If you are adding an Config managed rule, you must specify the * rule's identifier for the SourceIdentifier key.

*

Config Custom Rules are rules that you create from scratch. There are two ways to create Config custom rules: with Lambda functions * ( Lambda Developer Guide) and with Guard (Guard GitHub * Repository), a policy-as-code language. * * Config custom rules created with Lambda * are called Config Custom Lambda Rules and Config custom rules created with * Guard are called Config Custom Policy Rules.

*

If you are adding a new Config Custom Lambda rule, * you first need to create an Lambda function that the rule invokes to evaluate * your resources. When you use PutConfigRule to add a Custom Lambda rule to Config, you must specify the Amazon Resource * Name (ARN) that Lambda assigns to the function. You specify the ARN * in the SourceIdentifier key. This key is part of the * Source object, which is part of the * ConfigRule object.

*

For any new Config rule that you add, specify the * ConfigRuleName in the ConfigRule * object. Do not specify the ConfigRuleArn or the * ConfigRuleId. These values are generated by Config for new rules.

*

If you are updating a rule that you added previously, you can * specify the rule by ConfigRuleName, * ConfigRuleId, or ConfigRuleArn in the * ConfigRule data type that you use in this * request.

*

For more information about developing and using Config * rules, see Evaluating Resources with Config Rules * in the Config Developer Guide.

* *

* Tags are added at creation and cannot be updated with this operation *

*

* PutConfigRule is an idempotent API. Subsequent requests won’t create a duplicate resource if one was already created. If a following request has different tags values, * Config will ignore these differences and treat it as an idempotent request of the previous. In this case, tags will not be updated, even if they are different.

*

Use TagResource and UntagResource to update tags after creation.

*
* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { ConfigServiceClient, PutConfigRuleCommand } from "@aws-sdk/client-config-service"; // ES Modules import * // const { ConfigServiceClient, PutConfigRuleCommand } = require("@aws-sdk/client-config-service"); // CommonJS import * // import type { ConfigServiceClientConfig } from "@aws-sdk/client-config-service"; * const config = {}; // type is ConfigServiceClientConfig * const client = new ConfigServiceClient(config); * const input = { // PutConfigRuleRequest * ConfigRule: { // ConfigRule * ConfigRuleName: "STRING_VALUE", * ConfigRuleArn: "STRING_VALUE", * ConfigRuleId: "STRING_VALUE", * Description: "STRING_VALUE", * Scope: { // Scope * ComplianceResourceTypes: [ // ComplianceResourceTypes * "STRING_VALUE", * ], * TagKey: "STRING_VALUE", * TagValue: "STRING_VALUE", * ComplianceResourceId: "STRING_VALUE", * }, * Source: { // Source * Owner: "CUSTOM_LAMBDA" || "AWS" || "CUSTOM_POLICY", // required * SourceIdentifier: "STRING_VALUE", * SourceDetails: [ // SourceDetails * { // SourceDetail * EventSource: "aws.config", * MessageType: "ConfigurationItemChangeNotification" || "ConfigurationSnapshotDeliveryCompleted" || "ScheduledNotification" || "OversizedConfigurationItemChangeNotification", * MaximumExecutionFrequency: "One_Hour" || "Three_Hours" || "Six_Hours" || "Twelve_Hours" || "TwentyFour_Hours", * }, * ], * CustomPolicyDetails: { // CustomPolicyDetails * PolicyRuntime: "STRING_VALUE", // required * PolicyText: "STRING_VALUE", // required * EnableDebugLogDelivery: true || false, * }, * }, * InputParameters: "STRING_VALUE", * MaximumExecutionFrequency: "One_Hour" || "Three_Hours" || "Six_Hours" || "Twelve_Hours" || "TwentyFour_Hours", * ConfigRuleState: "ACTIVE" || "DELETING" || "DELETING_RESULTS" || "EVALUATING", * CreatedBy: "STRING_VALUE", * EvaluationModes: [ // EvaluationModes * { // EvaluationModeConfiguration * Mode: "DETECTIVE" || "PROACTIVE", * }, * ], * }, * Tags: [ // TagsList * { // Tag * Key: "STRING_VALUE", * Value: "STRING_VALUE", * }, * ], * }; * const command = new PutConfigRuleCommand(input); * const response = await client.send(command); * // {}; * * ``` * * @param PutConfigRuleCommandInput - {@link PutConfigRuleCommandInput} * @returns {@link PutConfigRuleCommandOutput} * @see {@link PutConfigRuleCommandInput} for command's `input` shape. * @see {@link PutConfigRuleCommandOutput} for command's `response` shape. * @see {@link ConfigServiceClientResolvedConfig | config} for ConfigServiceClient's `config` shape. * * @throws {@link InsufficientPermissionsException} (client fault) *

Indicates one of the following errors:

* * * @throws {@link InvalidParameterValueException} (client fault) *

One or more of the specified parameters are not valid. Verify * that your parameters are valid and try again.

* * @throws {@link MaxNumberOfConfigRulesExceededException} (client fault) *

Failed to add the Config rule because the account already * contains the maximum number of 1000 rules. Consider deleting any * deactivated rules before you add new rules.

* * @throws {@link NoAvailableConfigurationRecorderException} (client fault) *

There are no customer managed configuration recorders available to record your resources. Use the PutConfigurationRecorder operation to create the customer managed configuration * recorder.

* * @throws {@link ResourceInUseException} (client fault) *

You see this exception in the following cases:

* * * @throws {@link ConfigServiceServiceException} *

Base exception class for all service exceptions from ConfigService service.

* * * @public */ export declare class PutConfigRuleCommand extends PutConfigRuleCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: PutConfigRuleRequest; output: {}; }; sdk: { input: PutConfigRuleCommandInput; output: PutConfigRuleCommandOutput; }; }; }