Skip to content

get_custom_rule_policy

get_custom_rule_policy(
    *,
    config_overrides: Optional[ConfigServiceClientConfig] = None,
    config_rule_name: Optional[ConfigRuleName] = None,
) -> GetCustomRulePolicyResponse

Returns the policy definition containing the logic for your Config Custom Policy rule.

Parameters:

Raises:

  • NoSuchConfigRuleException –

    The Config rule in the request is not valid. Verify that the rule is an Config Process Check rule, that the rule name is correct, and that valid Amazon Resouce Names (ARNs) are used before trying again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_config_service/_services/config_service.py
def get_custom_rule_policy(
    self,
    *,
    config_overrides: Optional[ConfigServiceClientConfig] = None,
    config_rule_name: Optional[
        "capo_config_service.types.config_rule_name.ConfigRuleName"
    ] = None,
) -> "capo_config_service.types.get_custom_rule_policy_response.GetCustomRulePolicyResponse":
    """<p>Returns the policy definition containing the logic for your Config Custom Policy rule.</p>

    Args:
        config_rule_name: <p>The name of your Config Custom Policy rule.</p>

    Raises:
        capo_config_service.errors.no_such_config_rule_exception.NoSuchConfigRuleException: <p>The Config rule in the request is not valid. Verify that the rule is an 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.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_config_service.types.get_custom_rule_policy_request.GetCustomRulePolicyRequest]",
    ) -> OperationResponse[
        "capo_config_service.types.get_custom_rule_policy_response.GetCustomRulePolicyResponse"
    ]:
        import capo_config_service._operations.starling_dove_service.get_custom_rule_policy

        output, http_response = (
            capo_config_service._operations.starling_dove_service.get_custom_rule_policy.get_custom_rule_policy(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetCustomRulePolicy")
    )
    input_: capo_config_service.types.get_custom_rule_policy_request.GetCustomRulePolicyRequest = {}
    if config_rule_name is not None:
        input_["config_rule_name"] = config_rule_name

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output