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 { PutOrganizationConfigRuleRequest, PutOrganizationConfigRuleResponse } from "../models/models_0"; /** * @public */ export type { __MetadataBearer }; export { $Command }; /** * @public * * The input for {@link PutOrganizationConfigRuleCommand}. */ export interface PutOrganizationConfigRuleCommandInput extends PutOrganizationConfigRuleRequest { } /** * @public * * The output of {@link PutOrganizationConfigRuleCommand}. */ export interface PutOrganizationConfigRuleCommandOutput extends PutOrganizationConfigRuleResponse, __MetadataBearer { } declare const PutOrganizationConfigRuleCommand_base: { new (input: PutOrganizationConfigRuleCommandInput): import("@smithy/smithy-client").CommandImpl; new (input: PutOrganizationConfigRuleCommandInput): import("@smithy/smithy-client").CommandImpl; getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions; }; /** *

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

*

Only a management account and a delegated administrator can create or update an organization Config rule. * When calling this API with a delegated administrator, you must ensure Organizations * ListDelegatedAdministrator permissions are added. An organization can have up to 3 delegated administrators.

*

This API enables organization service access through the EnableAWSServiceAccess action and creates a service-linked * role AWSServiceRoleForConfigMultiAccountSetup in the management or delegated administrator account of your organization. * The service-linked role is created only when the role does not exist in the caller account. * Config verifies the existence of role with GetRole action.

*

To use this API with delegated administrator, register a delegated administrator by calling Amazon Web Services Organization * register-delegated-administrator for config-multiaccountsetup.amazonaws.com.

*

There are two types of rules: Config Managed Rules and Config Custom Rules. * You can use PutOrganizationConfigRule 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 RuleIdentifier 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 in the management account or a delegated * administrator that the rule invokes to evaluate your resources. You also need to create an IAM role in the managed account that can be assumed by the Lambda function. * When you use PutOrganizationConfigRule to add a Custom Lambda rule to Config, you must * specify the Amazon Resource Name (ARN) that Lambda assigns to the function.

* *

Prerequisite: Ensure you call EnableAllFeatures API to enable all features in an organization.

*

Make sure to specify one of either OrganizationCustomPolicyRuleMetadata for Custom Policy rules, OrganizationCustomRuleMetadata for Custom Lambda rules, or OrganizationManagedRuleMetadata for managed rules.

*
* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { ConfigServiceClient, PutOrganizationConfigRuleCommand } from "@aws-sdk/client-config-service"; // ES Modules import * // const { ConfigServiceClient, PutOrganizationConfigRuleCommand } = 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 = { // PutOrganizationConfigRuleRequest * OrganizationConfigRuleName: "STRING_VALUE", // required * OrganizationManagedRuleMetadata: { // OrganizationManagedRuleMetadata * Description: "STRING_VALUE", * RuleIdentifier: "STRING_VALUE", // required * InputParameters: "STRING_VALUE", * MaximumExecutionFrequency: "One_Hour" || "Three_Hours" || "Six_Hours" || "Twelve_Hours" || "TwentyFour_Hours", * ResourceTypesScope: [ // ResourceTypesScope * "STRING_VALUE", * ], * ResourceIdScope: "STRING_VALUE", * TagKeyScope: "STRING_VALUE", * TagValueScope: "STRING_VALUE", * }, * OrganizationCustomRuleMetadata: { // OrganizationCustomRuleMetadata * Description: "STRING_VALUE", * LambdaFunctionArn: "STRING_VALUE", // required * OrganizationConfigRuleTriggerTypes: [ // OrganizationConfigRuleTriggerTypes // required * "ConfigurationItemChangeNotification" || "OversizedConfigurationItemChangeNotification" || "ScheduledNotification", * ], * InputParameters: "STRING_VALUE", * MaximumExecutionFrequency: "One_Hour" || "Three_Hours" || "Six_Hours" || "Twelve_Hours" || "TwentyFour_Hours", * ResourceTypesScope: [ * "STRING_VALUE", * ], * ResourceIdScope: "STRING_VALUE", * TagKeyScope: "STRING_VALUE", * TagValueScope: "STRING_VALUE", * }, * ExcludedAccounts: [ // ExcludedAccounts * "STRING_VALUE", * ], * OrganizationCustomPolicyRuleMetadata: { // OrganizationCustomPolicyRuleMetadata * Description: "STRING_VALUE", * OrganizationConfigRuleTriggerTypes: [ // OrganizationConfigRuleTriggerTypeNoSNs * "ConfigurationItemChangeNotification" || "OversizedConfigurationItemChangeNotification", * ], * InputParameters: "STRING_VALUE", * MaximumExecutionFrequency: "One_Hour" || "Three_Hours" || "Six_Hours" || "Twelve_Hours" || "TwentyFour_Hours", * ResourceTypesScope: [ * "STRING_VALUE", * ], * ResourceIdScope: "STRING_VALUE", * TagKeyScope: "STRING_VALUE", * TagValueScope: "STRING_VALUE", * PolicyRuntime: "STRING_VALUE", // required * PolicyText: "STRING_VALUE", // required * DebugLogDeliveryAccounts: [ // DebugLogDeliveryAccounts * "STRING_VALUE", * ], * }, * }; * const command = new PutOrganizationConfigRuleCommand(input); * const response = await client.send(command); * // { // PutOrganizationConfigRuleResponse * // OrganizationConfigRuleArn: "STRING_VALUE", * // }; * * ``` * * @param PutOrganizationConfigRuleCommandInput - {@link PutOrganizationConfigRuleCommandInput} * @returns {@link PutOrganizationConfigRuleCommandOutput} * @see {@link PutOrganizationConfigRuleCommandInput} for command's `input` shape. * @see {@link PutOrganizationConfigRuleCommandOutput} 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 MaxNumberOfOrganizationConfigRulesExceededException} (client fault) *

You have reached the limit of the number of organization Config rules you can create. For more information, see see * Service Limits * in the Config Developer Guide.

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

Organization is no longer available.

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

For PutConfigurationAggregator API, you can see this exception for the following reasons:

* *

For all OrganizationConfigRule and OrganizationConformancePack APIs, Config throws an exception if APIs are called from member accounts. All APIs must be called from organization management account.

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

Config resource cannot be created because your organization does not have all features enabled.

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

You see this exception in the following cases:

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

The requested operation is not valid. You will see this exception if there are missing required fields or if the input value fails the validation.

*

For PutStoredQuery, one of the following errors:

* *

For DescribeConfigurationRecorders and DescribeConfigurationRecorderStatus, one of the following errors:

* *

For AssociateResourceTypes and DisassociateResourceTypes, one of the following errors:

* * * @throws {@link ConfigServiceServiceException} *

Base exception class for all service exceptions from ConfigService service.

* * * @public */ export declare class PutOrganizationConfigRuleCommand extends PutOrganizationConfigRuleCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: PutOrganizationConfigRuleRequest; output: PutOrganizationConfigRuleResponse; }; sdk: { input: PutOrganizationConfigRuleCommandInput; output: PutOrganizationConfigRuleCommandOutput; }; }; }