Provides information about the associations for your configuration policies and self-managed behavior. Only the Security Hub CSPM delegated administrator can invoke this operation from the home Region.
Parameters:
-
next_token
(Optional[NextToken], default:
None
)
–
The NextToken value that's returned from a previous paginated ListConfigurationPolicyAssociations request where MaxResults was used but the results exceeded the value of that parameter. Pagination continues from the end of the previous response that returned the NextToken value. This value is null when there are no more results to return.
-
max_results
(Optional[MaxResults], default:
None
)
–
The maximum number of results that's returned by ListConfigurationPolicies in each page of the response. When this parameter is used, ListConfigurationPolicyAssociations returns the specified number of results in a single page and a NextToken response element. You can see the remaining results of the initial request by sending another ListConfigurationPolicyAssociations request with the returned NextToken value. A valid range for MaxResults is between 1 and 100.
-
filters
(Optional[AssociationFilters], default:
None
)
–
Options for filtering the ListConfigurationPolicyAssociations response. You can filter by the Amazon Resource Name (ARN) or universally unique identifier (UUID) of a configuration, AssociationType, or AssociationStatus.
Raises:
-
AccessDeniedException
–
You don't have permission to perform the action specified in the request.
-
InternalException
–
-
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.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
To list configuration associations
This operation lists all of the associations between targets and configuration policies or self-managed behavior. Targets can include accounts, organizational units, or the root.
>>> client.list_configuration_policy_associations(next_token='U1FsdGVkX19nBV2zoh+Gou9NgnulLJHWpn9xnG4hqSOhvw3o2JqjI86QDxdf', max_results=1, filters={'AssociationType': 'APPLIED'})
Source code in docs_src/capo_securityhub/_services/security_hub.py
| def list_configuration_policy_associations(
self,
*,
config_overrides: Optional[SecurityHubClientConfig] = None,
next_token: Optional["capo_securityhub.types.next_token.NextToken"] = None,
max_results: Optional["capo_securityhub.types.max_results.MaxResults"] = None,
filters: Optional[
"capo_securityhub.types.association_filters.AssociationFilters"
] = None,
) -> "capo_securityhub.types.list_configuration_policy_associations_response.ListConfigurationPolicyAssociationsResponse":
"""<p> Provides information about the associations for your configuration policies and self-managed behavior. Only the Security Hub CSPM delegated administrator can invoke this operation from the home Region. </p>
Args:
next_token: <p> The <code>NextToken</code> value that's returned from a previous paginated <code>ListConfigurationPolicyAssociations</code> request where <code>MaxResults</code> was used but the results exceeded the value of that parameter. Pagination continues from the end of the previous response that returned the <code>NextToken</code> value. This value is <code>null</code> when there are no more results to return. </p>
max_results: <p> The maximum number of results that's returned by <code>ListConfigurationPolicies</code> in each page of the response. When this parameter is used, <code>ListConfigurationPolicyAssociations</code> returns the specified number of results in a single page and a <code>NextToken</code> response element. You can see the remaining results of the initial request by sending another <code>ListConfigurationPolicyAssociations</code> request with the returned <code>NextToken</code> value. A valid range for <code>MaxResults</code> is between 1 and 100. </p>
filters: <p> Options for filtering the <code>ListConfigurationPolicyAssociations</code> response. You can filter by the Amazon Resource Name (ARN) or universally unique identifier (UUID) of a configuration, <code>AssociationType</code>, or <code>AssociationStatus</code>. </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.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To list configuration associations
This operation lists all of the associations between targets and configuration policies or self-managed behavior. Targets can include accounts, organizational units, or the root.
>>> client.list_configuration_policy_associations(next_token='U1FsdGVkX19nBV2zoh+Gou9NgnulLJHWpn9xnG4hqSOhvw3o2JqjI86QDxdf', max_results=1, filters={'AssociationType': 'APPLIED'})
"""
def _handler(
req: "OperationRequest[capo_securityhub.types.list_configuration_policy_associations_request.ListConfigurationPolicyAssociationsRequest]",
) -> OperationResponse[
"capo_securityhub.types.list_configuration_policy_associations_response.ListConfigurationPolicyAssociationsResponse"
]:
import capo_securityhub._operations.security_hub_api_service.list_configuration_policy_associations
output, http_response = (
capo_securityhub._operations.security_hub_api_service.list_configuration_policy_associations.list_configuration_policy_associations(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListConfigurationPolicyAssociations")
)
input_: capo_securityhub.types.list_configuration_policy_associations_request.ListConfigurationPolicyAssociationsRequest = {}
if next_token is not None:
input_["next_token"] = next_token
if max_results is not None:
input_["max_results"] = max_results
if filters is not None:
input_["filters"] = filters
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|