AWS Config
API Reference (API Version 2014-11-12)

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

PutOrganizationConfigRule

Adds or updates organization config rule for your entire organization evaluating whether your AWS resources comply with your desired configurations. Only a master account can create or update an organization config rule.

This API enables organization service access through the EnableAWSServiceAccess action and creates a service linked role AWSServiceRoleForConfigMultiAccountSetup in the master account of your organization. The service linked role is created only when the role does not exist in the master account. AWS Config verifies the existence of role with GetRole action.

You can use this action to create both custom AWS Config rules and AWS managed Config rules. If you are adding a new custom AWS Config rule, you must first create AWS Lambda function in the master account that the rule invokes to evaluate your resources. When you use the PutOrganizationConfigRule action to add the rule to AWS Config, you must specify the Amazon Resource Name (ARN) that AWS Lambda assigns to the function. If you are adding an AWS managed Config rule, specify the rule's identifier for the RuleIdentifier key.

The maximum number of organization config rules that AWS Config supports is 150.

Note

Specify either OrganizationCustomRuleMetadata or OrganizationManagedRuleMetadata.

Request Syntax

{ "ExcludedAccounts": [ "string" ], "OrganizationConfigRuleName": "string", "OrganizationCustomRuleMetadata": { "Description": "string", "InputParameters": "string", "LambdaFunctionArn": "string", "MaximumExecutionFrequency": "string", "OrganizationConfigRuleTriggerTypes": [ "string" ], "ResourceIdScope": "string", "ResourceTypesScope": [ "string" ], "TagKeyScope": "string", "TagValueScope": "string" }, "OrganizationManagedRuleMetadata": { "Description": "string", "InputParameters": "string", "MaximumExecutionFrequency": "string", "ResourceIdScope": "string", "ResourceTypesScope": [ "string" ], "RuleIdentifier": "string", "TagKeyScope": "string", "TagValueScope": "string" } }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

ExcludedAccounts

A comma-separated list of accounts that you want to exclude from an organization config rule.

Type: Array of strings

Array Members: Minimum number of 0 items. Maximum number of 1000 items.

Pattern: \d{12}

Required: No

OrganizationConfigRuleName

The name that you assign to an organization config rule.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: .*\S.*

Required: Yes

OrganizationCustomRuleMetadata

An OrganizationCustomRuleMetadata object.

Type: OrganizationCustomRuleMetadata object

Required: No

OrganizationManagedRuleMetadata

An OrganizationManagedRuleMetadata object.

Type: OrganizationManagedRuleMetadata object

Required: No

Response Syntax

{ "OrganizationConfigRuleArn": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

OrganizationConfigRuleArn

The Amazon Resource Name (ARN) of an organization config rule.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Errors

For information about the errors that are common to all actions, see Common Errors.

InsufficientPermissionsException

Indicates one of the following errors:

  • For PutConfigRule, the rule cannot be created because the IAM role assigned to AWS Config lacks permissions to perform the config:Put* action.

  • For PutConfigRule, the AWS Lambda function cannot be invoked. Check the function ARN, and check the function's permissions.

  • For OrganizationConfigRule, organization config rule cannot be created because you do not have permissions to call IAM GetRole action or create service linked role.

HTTP Status Code: 400

InvalidParameterValueException

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

HTTP Status Code: 400

MaxNumberOfOrganizationConfigRulesExceededException

You have reached the limit of the number of organization config rules you can create.

HTTP Status Code: 400

NoAvailableOrganizationException

Organization is no longer available.

HTTP Status Code: 400

OrganizationAccessDeniedException

For PutConfigAggregator API, no permission to call EnableAWSServiceAccess API.

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

HTTP Status Code: 400

OrganizationAllFeaturesNotEnabledException

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

HTTP Status Code: 400

ResourceInUseException

You see this exception in the following cases:

  • For DeleteConfigRule API, AWS Config is deleting this rule. Try your request again later.

  • For DeleteConfigRule API, the rule is deleting your evaluation results. Try your request again later.

  • For DeleteConfigRule API, a remediation action is associated with the rule and AWS Config cannot delete this rule. Delete the remediation action associated with the rule before deleting the rule and try your request again later.

  • For PutConfigOrganizationRule, organization config rule deletion is in progress. Try your request again later.

  • For DeleteOrganizationConfigRule, organization config rule creation is in progress. Try your request again later.

HTTP Status Code: 400

ValidationException

The requested action is not valid.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: