Starts a scan of the resources in this account in this Region. You can the status of a scan using the ListResourceScans API action.
Parameters:
-
client_request_token
(Optional[ClientRequestToken], default:
None
)
–
A unique identifier for this StartResourceScan request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to start a new resource scan.
-
scan_filters
(Optional[ScanFilters], default:
None
)
–
Raises:
-
ResourceScanInProgressException
–
A resource scan is currently in progress. Only one can be run at a time for an account in a Region.
-
ResourceScanLimitExceededException
–
The limit on resource scans has been exceeded. Reasons include:
-
Exceeded the daily quota for resource scans.
-
A resource scan recently failed. You must wait 10 minutes before starting a new resource scan.
-
The last resource scan failed after exceeding 100,000 resources. When this happens, you must wait 24 hours before starting a new resource scan.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
To start a resource scan
This example shows how to start a new resource scan
>>> await client.start_resource_scan()
Source code in docs_src/capo_cloudformation/_services/async_cloud_formation.py
| async def start_resource_scan(
self,
*,
config_overrides: Optional[AsyncCloudFormationClientConfig] = None,
client_request_token: Optional[
"capo_cloudformation.types.client_request_token.ClientRequestToken"
] = None,
scan_filters: Optional[
"capo_cloudformation.types.scan_filters.ScanFilters"
] = None,
) -> "capo_cloudformation.types.start_resource_scan_output.StartResourceScanOutput":
"""<p>Starts a scan of the resources in this account in this Region. You can the status of a scan using the <code>ListResourceScans</code> API action.</p>
Args:
client_request_token: <p>A unique identifier for this <code>StartResourceScan</code> request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to start a new resource scan.</p>
scan_filters: <p>The scan filters to use.</p>
Raises:
capo_cloudformation.errors.resource_scan_in_progress_exception.ResourceScanInProgressException: <p>A resource scan is currently in progress. Only one can be run at a time for an account in a Region.</p>
capo_cloudformation.errors.resource_scan_limit_exceeded_exception.ResourceScanLimitExceededException: <p>The limit on resource scans has been exceeded. Reasons include:</p> <ul> <li> <p>Exceeded the daily quota for resource scans.</p> </li> <li> <p>A resource scan recently failed. You must wait 10 minutes before starting a new resource scan.</p> </li> <li> <p>The last resource scan failed after exceeding 100,000 resources. When this happens, you must wait 24 hours before starting a new resource scan.</p> </li> </ul>
capo_cloudformation.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To start a resource scan
This example shows how to start a new resource scan
>>> await client.start_resource_scan()
"""
async def _handler(
req: "AsyncOperationRequest[capo_cloudformation.types.start_resource_scan_input.StartResourceScanInput]",
) -> AsyncOperationResponse[
"capo_cloudformation.types.start_resource_scan_output.StartResourceScanOutput"
]:
import capo_cloudformation._operations.cloud_formation.start_resource_scan
(
output,
http_response,
) = await capo_cloudformation._operations.cloud_formation.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_cloudformation.types.start_resource_scan_input.StartResourceScanInput = {}
if client_request_token is not None:
input_["client_request_token"] = client_request_token
if scan_filters is not None:
input_["scan_filters"] = scan_filters
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|