Skip to content

start_resource_scan async

start_resource_scan(
    analyzer_arn: AnalyzerArn,
    resource_arn: ResourceArn,
    *,
    config_overrides: Optional[AsyncAccessAnalyzerClientConfig] = None,
    resource_owner_account: Optional[str] = None,
) -> None

Immediately starts a scan of the policies applied to the specified resource.

This action is supported only for external access analyzers.

Parameters:

  • analyzer_arn (AnalyzerArn) –

    The ARN of the analyzer to use to scan the policies applied to the specified resource.

  • resource_arn (ResourceArn) –

    The ARN of the resource to scan.

  • resource_owner_account (Optional[str], default: None ) –

    The Amazon Web Services account ID that owns the resource. For most Amazon Web Services resources, the owning account is the account in which the resource was created.

Raises:

Source code in docs_src/capo_accessanalyzer/_services/async_access_analyzer.py
async def start_resource_scan(
    self,
    analyzer_arn: "capo_accessanalyzer.types.analyzer_arn.AnalyzerArn",
    resource_arn: "capo_accessanalyzer.types.resource_arn.ResourceArn",
    *,
    config_overrides: Optional[AsyncAccessAnalyzerClientConfig] = None,
    resource_owner_account: Optional[str] = None,
) -> None:
    """<p>Immediately starts a scan of the policies applied to the specified resource.</p> <note> <p>This action is supported only for external access analyzers.</p> </note>

    Args:
        analyzer_arn: <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN of the analyzer</a> to use to scan the policies applied to the specified resource.</p>
        resource_arn: <p>The ARN of the resource to scan.</p>
        resource_owner_account: <p>The Amazon Web Services account ID that owns the resource. For most Amazon Web Services resources, the owning account is the account in which the resource was created.</p>

    Raises:
        capo_accessanalyzer.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_accessanalyzer.errors.internal_server_exception.InternalServerException: <p>Internal server error.</p>
        capo_accessanalyzer.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource could not be found.</p>
        capo_accessanalyzer.errors.throttling_exception.ThrottlingException: <p>Throttling limit exceeded error.</p>
        capo_accessanalyzer.errors.validation_exception.ValidationException: <p>Validation exception error.</p>
        capo_accessanalyzer.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_accessanalyzer.types.start_resource_scan_request.StartResourceScanRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_accessanalyzer._operations.access_analyzer.start_resource_scan

        (
            output,
            http_response,
        ) = await capo_accessanalyzer._operations.access_analyzer.start_resource_scan.async_start_resource_scan(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartResourceScan")
    )
    input_: capo_accessanalyzer.types.start_resource_scan_request.StartResourceScanRequest = {
        "analyzer_arn": analyzer_arn,
        "resource_arn": resource_arn,
    }
    if resource_owner_account is not None:
        input_["resource_owner_account"] = resource_owner_account

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