Returns the association between a configuration and a target account, organizational unit, or the root. The configuration can be 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 target account ID, organizational unit ID, or the root ID to retrieve the association for.
Raises:
Examples:
To get details about a configuration association
This operation provides details about configuration associations for a specific target account, organizational unit, or the root.
>>> client.get_configuration_policy_association(target={'AccountId': '111122223333'})
Source code in docs_src/capo_securityhub/_services/security_hub.py
| def get_configuration_policy_association(
self,
*,
config_overrides: Optional[SecurityHubClientConfig] = None,
target: Optional["capo_securityhub.types.target.Target"] = None,
) -> "capo_securityhub.types.get_configuration_policy_association_response.GetConfigurationPolicyAssociationResponse":
"""<p> Returns the association between a configuration and a target account, organizational unit, or the root. The configuration can be 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 target account ID, organizational unit ID, or the root ID to retrieve the association for. </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 get details about a configuration association
This operation provides details about configuration associations for a specific target account, organizational unit, or the root.
>>> client.get_configuration_policy_association(target={'AccountId': '111122223333'})
"""
def _handler(
req: "OperationRequest[capo_securityhub.types.get_configuration_policy_association_request.GetConfigurationPolicyAssociationRequest]",
) -> OperationResponse[
"capo_securityhub.types.get_configuration_policy_association_response.GetConfigurationPolicyAssociationResponse"
]:
import capo_securityhub._operations.security_hub_api_service.get_configuration_policy_association
output, http_response = (
capo_securityhub._operations.security_hub_api_service.get_configuration_policy_association.get_configuration_policy_association(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetConfigurationPolicyAssociation")
)
input_: capo_securityhub.types.get_configuration_policy_association_request.GetConfigurationPolicyAssociationRequest = {}
if target is not None:
input_["target"] = target
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|