Skip to content

get_violation_details async

get_violation_details(
    policy_id: PolicyId,
    member_account: AWSAccountId,
    resource_id: ResourceId,
    resource_type: ResourceType,
    *,
    config_overrides: Optional[AsyncFMSClientConfig] = None,
) -> GetViolationDetailsResponse

Retrieves violations for a resource based on the specified Firewall Manager policy and Amazon Web Services account.

Parameters:

  • policy_id (PolicyId) –

    The ID of the Firewall Manager policy that you want the details for. You can get violation details for the following policy types:

    • WAF

    • DNS Firewall

    • Imported Network Firewall

    • Network Firewall

    • Security group content audit

    • Network ACL

    • Third-party firewall

  • member_account (AWSAccountId) –

    The Amazon Web Services account ID that you want the details for.

  • resource_id (ResourceId) –

    The ID of the resource that has violations.

  • resource_type (ResourceType) –

    The resource type. This is in the format shown in the Amazon Web Services Resource Types Reference. Supported resource types are: AWS::WAFv2::WebACL, AWS::EC2::Instance, AWS::EC2::NetworkInterface, AWS::EC2::SecurityGroup, AWS::NetworkFirewall::FirewallPolicy, and AWS::EC2::Subnet.

Raises:

Source code in docs_src/capo_fms/_services/async_fms.py
async def get_violation_details(
    self,
    policy_id: "capo_fms.types.policy_id.PolicyId",
    member_account: "capo_fms.types.aws_account_id.AWSAccountId",
    resource_id: "capo_fms.types.resource_id.ResourceId",
    resource_type: "capo_fms.types.resource_type.ResourceType",
    *,
    config_overrides: Optional[AsyncFMSClientConfig] = None,
) -> "capo_fms.types.get_violation_details_response.GetViolationDetailsResponse":
    """<p>Retrieves violations for a resource based on the specified Firewall Manager policy and Amazon Web Services account.</p>

    Args:
        policy_id: <p>The ID of the Firewall Manager policy that you want the details for. You can get violation details for the following policy types:</p> <ul> <li> <p>WAF</p> </li> <li> <p>DNS Firewall</p> </li> <li> <p>Imported Network Firewall</p> </li> <li> <p>Network Firewall</p> </li> <li> <p>Security group content audit</p> </li> <li> <p>Network ACL</p> </li> <li> <p>Third-party firewall</p> </li> </ul>
        member_account: <p>The Amazon Web Services account ID that you want the details for.</p>
        resource_id: <p>The ID of the resource that has violations.</p>
        resource_type: <p>The resource type. This is in the format shown in the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html">Amazon Web Services Resource Types Reference</a>. Supported resource types are: <code>AWS::WAFv2::WebACL</code>, <code>AWS::EC2::Instance</code>, <code>AWS::EC2::NetworkInterface</code>, <code>AWS::EC2::SecurityGroup</code>, <code>AWS::NetworkFirewall::FirewallPolicy</code>, and <code>AWS::EC2::Subnet</code>. </p>

    Raises:
        capo_fms.errors.internal_error_exception.InternalErrorException: <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
        capo_fms.errors.invalid_input_exception.InvalidInputException: <p>The parameters of the request were invalid.</p>
        capo_fms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_fms.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_fms.types.get_violation_details_request.GetViolationDetailsRequest]",
    ) -> AsyncOperationResponse[
        "capo_fms.types.get_violation_details_response.GetViolationDetailsResponse"
    ]:
        import capo_fms._operations.awsfms_20180101.get_violation_details

        (
            output,
            http_response,
        ) = await capo_fms._operations.awsfms_20180101.get_violation_details.async_get_violation_details(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetViolationDetails")
    )
    input_: capo_fms.types.get_violation_details_request.GetViolationDetailsRequest = {
        "policy_id": policy_id,
        "member_account": member_account,
        "resource_id": resource_id,
        "resource_type": resource_type,
    }

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