Returns the policy definition containing the logic for your organization Config Custom Policy rule.
Parameters:
Raises:
-
NoSuchOrganizationConfigRuleException
–
The Config rule in the request is not valid. Verify that the rule is an organization Config Process Check rule, that the rule name is correct, and that valid Amazon Resouce Names (ARNs) are used before trying again.
-
OrganizationAccessDeniedException
–
For PutConfigurationAggregator API, you can see this exception for the following reasons:
-
No permission to call EnableAWSServiceAccess API
-
The configuration aggregator cannot be updated because your Amazon Web Services Organization management account or the delegated administrator role changed. Delete this aggregator and create a new one with the current Amazon Web Services Organization.
-
The configuration aggregator is associated with a previous Amazon Web Services Organization and Config cannot aggregate data with current Amazon Web Services Organization. Delete this aggregator and create a new one with the current Amazon Web Services Organization.
-
You are not a registered delegated administrator for Config with permissions to call ListDelegatedAdministrators API. Ensure that the management account registers delagated administrator for Config service principal name before the delegated administrator creates an aggregator.
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.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_config_service/_services/async_config_service.py
| async def get_organization_custom_rule_policy(
self,
organization_config_rule_name: "capo_config_service.types.organization_config_rule_name.OrganizationConfigRuleName",
*,
config_overrides: Optional[AsyncConfigServiceClientConfig] = None,
) -> "capo_config_service.types.get_organization_custom_rule_policy_response.GetOrganizationCustomRulePolicyResponse":
"""<p>Returns the policy definition containing the logic for your organization Config Custom Policy rule.</p>
Args:
organization_config_rule_name: <p>The name of your organization Config Custom Policy rule. </p>
Raises:
capo_config_service.errors.no_such_organization_config_rule_exception.NoSuchOrganizationConfigRuleException: <p>The Config rule in the request is not valid. Verify that the rule is an organization Config Process Check rule, that the rule name is correct, and that valid Amazon Resouce Names (ARNs) are used before trying again.</p>
capo_config_service.errors.organization_access_denied_exception.OrganizationAccessDeniedException: <p>For <code>PutConfigurationAggregator</code> API, you can see this exception for the following reasons:</p> <ul> <li> <p>No permission to call <code>EnableAWSServiceAccess</code> API</p> </li> <li> <p>The configuration aggregator cannot be updated because your Amazon Web Services Organization management account or the delegated administrator role changed. Delete this aggregator and create a new one with the current Amazon Web Services Organization.</p> </li> <li> <p>The configuration aggregator is associated with a previous Amazon Web Services Organization and Config cannot aggregate data with current Amazon Web Services Organization. Delete this aggregator and create a new one with the current Amazon Web Services Organization.</p> </li> <li> <p>You are not a registered delegated administrator for Config with permissions to call <code>ListDelegatedAdministrators</code> API. Ensure that the management account registers delagated administrator for Config service principal name before the delegated administrator creates an aggregator.</p> </li> </ul> <p>For all <code>OrganizationConfigRule</code> and <code>OrganizationConformancePack</code> APIs, Config throws an exception if APIs are called from member accounts. All APIs must be called from organization management account.</p>
capo_config_service.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_config_service.types.get_organization_custom_rule_policy_request.GetOrganizationCustomRulePolicyRequest]",
) -> AsyncOperationResponse[
"capo_config_service.types.get_organization_custom_rule_policy_response.GetOrganizationCustomRulePolicyResponse"
]:
import capo_config_service._operations.starling_dove_service.get_organization_custom_rule_policy
(
output,
http_response,
) = await capo_config_service._operations.starling_dove_service.get_organization_custom_rule_policy.async_get_organization_custom_rule_policy(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetOrganizationCustomRulePolicy")
)
input_: capo_config_service.types.get_organization_custom_rule_policy_request.GetOrganizationCustomRulePolicyRequest = {
"organization_config_rule_name": organization_config_rule_name
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|