Skip to content

start_configuration_policy_disassociation

start_configuration_policy_disassociation(
    *,
    config_overrides: Optional[SecurityHubClientConfig] = None,
    target: Optional[Target] = None,
    configuration_policy_identifier: Optional[NonEmptyString] = None,
) -> StartConfigurationPolicyDisassociationResponse

Disassociates a target account, organizational unit, or the root from a specified configuration. When you disassociate a configuration from its target, the target inherits the configuration of the closest parent. If there’s no configuration to inherit, the target retains its settings but becomes a self-managed account. A target can be disassociated from a configuration policy or self-managed behavior. Only the Security Hub CSPM delegated administrator can invoke this operation from the home Region.

Parameters:

  • target (Optional[Target], default: None ) –

    The identifier of the target account, organizational unit, or the root to disassociate from the specified configuration.

  • configuration_policy_identifier (Optional[NonEmptyString], default: None ) –

    The Amazon Resource Name (ARN) of a configuration policy, the universally unique identifier (UUID) of a configuration policy, or a value of SELF_MANAGED_SECURITY_HUB for a self-managed configuration.

Raises:

  • AccessDeniedException –

    You don't have permission to perform the action specified in the request.

  • InternalException –

    Internal server error.

  • InvalidAccessException –

    The account doesn't have permission to perform this action.

  • InvalidInputException –

    The request was rejected because you supplied an invalid or out-of-range value for an input parameter.

  • LimitExceededException –

    The request was rejected because it attempted to create resources beyond the current Amazon Web Services account or throttling limits. The error code describes the limit exceeded.

  • ResourceNotFoundException –

    The request was rejected because we can't find the specified resource.

  • UnknownServiceError –

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

Examples:

To disassociate a configuration from a target This operation disassociates a configuration policy or self-managed behavior from the target account, organizational unit, or the root.

>>> client.start_configuration_policy_disassociation(target={'RootId': 'r-f6g7h8i9j0example'}, configuration_policy_identifier='SELF_MANAGED_SECURITY_HUB')
Source code in docs_src/capo_securityhub/_services/security_hub.py
def start_configuration_policy_disassociation(
    self,
    *,
    config_overrides: Optional[SecurityHubClientConfig] = None,
    target: Optional["capo_securityhub.types.target.Target"] = None,
    configuration_policy_identifier: Optional[
        "capo_securityhub.types.non_empty_string.NonEmptyString"
    ] = None,
) -> "capo_securityhub.types.start_configuration_policy_disassociation_response.StartConfigurationPolicyDisassociationResponse":
    """<p> Disassociates a target account, organizational unit, or the root from a specified configuration. When you disassociate a configuration from its target, the target inherits the configuration of the closest parent. If there’s no configuration to inherit, the target retains its settings but becomes a self-managed account. A target can be disassociated from a configuration policy or self-managed behavior. Only the Security Hub CSPM delegated administrator can invoke this operation from the home Region. </p>

    Args:
        target: <p> The identifier of the target account, organizational unit, or the root to disassociate from the specified configuration. </p>
        configuration_policy_identifier: <p> The Amazon Resource Name (ARN) of a configuration policy, the universally unique identifier (UUID) of a configuration policy, or a value of <code>SELF_MANAGED_SECURITY_HUB</code> for a self-managed configuration. </p>

    Raises:
        capo_securityhub.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform the action specified in the request.</p>
        capo_securityhub.errors.internal_exception.InternalException: <p>Internal server error.</p>
        capo_securityhub.errors.invalid_access_exception.InvalidAccessException: <p>The account doesn't have permission to perform this action.</p>
        capo_securityhub.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because you supplied an invalid or out-of-range value for an input parameter.</p>
        capo_securityhub.errors.limit_exceeded_exception.LimitExceededException: <p>The request was rejected because it attempted to create resources beyond the current Amazon Web Services account or throttling limits. The error code describes the limit exceeded.</p>
        capo_securityhub.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was rejected because we can't find the specified resource.</p>
        capo_securityhub.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To disassociate a configuration from a target
        This operation disassociates a configuration policy or self-managed behavior from the target account, organizational unit, or the root.

        >>> client.start_configuration_policy_disassociation(target={'RootId': 'r-f6g7h8i9j0example'}, configuration_policy_identifier='SELF_MANAGED_SECURITY_HUB')
    """

    def _handler(
        req: "OperationRequest[capo_securityhub.types.start_configuration_policy_disassociation_request.StartConfigurationPolicyDisassociationRequest]",
    ) -> OperationResponse[
        "capo_securityhub.types.start_configuration_policy_disassociation_response.StartConfigurationPolicyDisassociationResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.start_configuration_policy_disassociation

        output, http_response = (
            capo_securityhub._operations.security_hub_api_service.start_configuration_policy_disassociation.start_configuration_policy_disassociation(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartConfigurationPolicyDisassociation")
    )
    input_: capo_securityhub.types.start_configuration_policy_disassociation_request.StartConfigurationPolicyDisassociationRequest = {}
    if target is not None:
        input_["target"] = target
    if configuration_policy_identifier is not None:
        input_["configuration_policy_identifier"] = configuration_policy_identifier

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