Skip to content

batch_get_standards_control_associations async

batch_get_standards_control_associations(
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    standards_control_association_ids: Optional[StandardsControlAssociationIds] = None,
) -> BatchGetStandardsControlAssociationsResponse

For a batch of security controls and standards, identifies whether each control is currently enabled or disabled in a standard.

Calls to this operation return a RESOURCE_NOT_FOUND_EXCEPTION error when the standard subscription for the association has a NOT_READY_FOR_UPDATES value for StandardsControlsUpdatable.

Parameters:

  • standards_control_association_ids (Optional[StandardsControlAssociationIds], default: None ) –

    An array with one or more objects that includes a security control (identified with SecurityControlId, SecurityControlArn, or a mix of both parameters) and the Amazon Resource Name (ARN) of a standard. This field is used to query the enablement status of a control in a specified standard. The security control ID or ARN is the same across standards.

Raises:

  • 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.

  • UnknownServiceError –

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

Source code in docs_src/capo_securityhub/_services/async_security_hub.py
async def batch_get_standards_control_associations(
    self,
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    standards_control_association_ids: Optional[
        "capo_securityhub.types.standards_control_association_ids.StandardsControlAssociationIds"
    ] = None,
) -> "capo_securityhub.types.batch_get_standards_control_associations_response.BatchGetStandardsControlAssociationsResponse":
    """<p> For a batch of security controls and standards, identifies whether each control is currently enabled or disabled in a standard. </p> <p> Calls to this operation return a <code>RESOURCE_NOT_FOUND_EXCEPTION</code> error when the standard subscription for the association has a <code>NOT_READY_FOR_UPDATES</code> value for <code>StandardsControlsUpdatable</code>. </p>

    Args:
        standards_control_association_ids: <p> An array with one or more objects that includes a security control (identified with <code>SecurityControlId</code>, <code>SecurityControlArn</code>, or a mix of both parameters) and the Amazon Resource Name (ARN) of a standard. This field is used to query the enablement status of a control in a specified standard. The security control ID or ARN is the same across standards. </p>

    Raises:
        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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_securityhub.types.batch_get_standards_control_associations_request.BatchGetStandardsControlAssociationsRequest]",
    ) -> AsyncOperationResponse[
        "capo_securityhub.types.batch_get_standards_control_associations_response.BatchGetStandardsControlAssociationsResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.batch_get_standards_control_associations

        (
            output,
            http_response,
        ) = await capo_securityhub._operations.security_hub_api_service.batch_get_standards_control_associations.async_batch_get_standards_control_associations(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("BatchGetStandardsControlAssociations")
    )
    input_: capo_securityhub.types.batch_get_standards_control_associations_request.BatchGetStandardsControlAssociationsRequest = {}
    if standards_control_association_ids is not None:
        input_["standards_control_association_ids"] = (
            standards_control_association_ids
        )

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output