Skip to content

get_security_control_definition async

get_security_control_definition(
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    security_control_id: Optional[NonEmptyString] = None,
) -> GetSecurityControlDefinitionResponse

Retrieves the definition of a security control. The definition includes the control title, description, Region availability, parameter definitions, and other details.

Parameters:

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

    The ID of the security control to retrieve the definition for. This field doesn’t accept an Amazon Resource Name (ARN).

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.

  • 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 get the definition of a security control. The following example retrieves definition details for the specified security control.

>>> await client.get_security_control_definition(security_control_id='EC2.4')
Source code in docs_src/capo_securityhub/_services/async_security_hub.py
async def get_security_control_definition(
    self,
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    security_control_id: Optional[
        "capo_securityhub.types.non_empty_string.NonEmptyString"
    ] = None,
) -> "capo_securityhub.types.get_security_control_definition_response.GetSecurityControlDefinitionResponse":
    """<p> Retrieves the definition of a security control. The definition includes the control title, description, Region availability, parameter definitions, and other details. </p>

    Args:
        security_control_id: <p> The ID of the security control to retrieve the definition for. This field doesn’t accept an Amazon Resource Name (ARN). </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.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 the definition of a security control.
        The following example retrieves definition details for the specified security control.

        >>> await client.get_security_control_definition(security_control_id='EC2.4')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_securityhub.types.get_security_control_definition_request.GetSecurityControlDefinitionRequest]",
    ) -> AsyncOperationResponse[
        "capo_securityhub.types.get_security_control_definition_response.GetSecurityControlDefinitionResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.get_security_control_definition

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetSecurityControlDefinition")
    )
    input_: capo_securityhub.types.get_security_control_definition_request.GetSecurityControlDefinitionRequest = {}
    if security_control_id is not None:
        input_["security_control_id"] = security_control_id

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