Skip to content

update_cis_scan_configuration async

update_cis_scan_configuration(
    scan_configuration_arn: CisScanConfigurationArn,
    *,
    config_overrides: Optional[AsyncInspector2ClientConfig] = None,
    scan_name: Optional[CisScanName] = None,
    security_level: Optional[CisSecurityLevel] = None,
    schedule: Optional[Schedule] = None,
    targets: Optional[UpdateCisTargets] = None,
) -> UpdateCisScanConfigurationResponse

Updates a CIS scan configuration.

Parameters:

  • scan_configuration_arn (CisScanConfigurationArn) –

    The CIS scan configuration ARN.

  • scan_name (Optional[CisScanName], default: None ) –

    The scan name for the CIS scan configuration.

  • security_level (Optional[CisSecurityLevel], default: None ) –

    The security level for the CIS scan configuration. Security level refers to the Benchmark levels that CIS assigns to a profile.

  • schedule (Optional[Schedule], default: None ) –

    The schedule for the CIS scan configuration.

  • targets (Optional[UpdateCisTargets], default: None ) –

    The targets for the CIS scan configuration.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

    For Enable, you receive this error if you attempt to use a feature in an unsupported Amazon Web Services Region.

  • InternalServerException –

    The request has failed due to an internal failure of the Amazon Inspector service.

  • ResourceNotFoundException –

    The operation tried to access an invalid resource. Make sure the resource is specified correctly.

  • ThrottlingException –

    The limit on the number of requests per second was exceeded.

  • ValidationException –

    The request has failed validation due to missing required fields or having invalid inputs.

  • UnknownServiceError –

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

Examples:

Sample UpdateCisScanConfiguration Call

>>> await client.update_cis_scan_configuration(scan_configuration_arn='arn:aws:inspector2:us-east-1:123412341234:owner/123412341234/cis-configuration/624b746d-e080-44ae-8c1d-48e653365a38', scan_name='sample_new', security_level='LEVEL_2', schedule={'daily': {'startTime': {'timeOfDay': '12:56', 'timezone': 'UTC'}}}, targets={'accountIds': ['SELF'], 'targetResourceTags': {'key2': ['value2']}})
Source code in docs_src/capo_inspector2/_services/async_inspector2.py
async def update_cis_scan_configuration(
    self,
    scan_configuration_arn: "capo_inspector2.types.cis_scan_configuration_arn.CisScanConfigurationArn",
    *,
    config_overrides: Optional[AsyncInspector2ClientConfig] = None,
    scan_name: Optional["capo_inspector2.types.cis_scan_name.CisScanName"] = None,
    security_level: Optional[
        "capo_inspector2.types.cis_security_level.CisSecurityLevel"
    ] = None,
    schedule: Optional["capo_inspector2.types.schedule.Schedule"] = None,
    targets: Optional[
        "capo_inspector2.types.update_cis_targets.UpdateCisTargets"
    ] = None,
) -> "capo_inspector2.types.update_cis_scan_configuration_response.UpdateCisScanConfigurationResponse":
    """<p>Updates a CIS scan configuration.</p>

    Args:
        scan_configuration_arn: <p>The CIS scan configuration ARN.</p>
        scan_name: <p>The scan name for the CIS scan configuration.</p>
        security_level: <p> The security level for the CIS scan configuration. Security level refers to the Benchmark levels that CIS assigns to a profile. </p>
        schedule: <p>The schedule for the CIS scan configuration.</p>
        targets: <p>The targets for the CIS scan configuration.</p>

    Raises:
        capo_inspector2.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p> <p> For <code>Enable</code>, you receive this error if you attempt to use a feature in an unsupported Amazon Web Services Region. </p>
        capo_inspector2.errors.internal_server_exception.InternalServerException: <p>The request has failed due to an internal failure of the Amazon Inspector service.</p>
        capo_inspector2.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access an invalid resource. Make sure the resource is specified correctly.</p>
        capo_inspector2.errors.throttling_exception.ThrottlingException: <p>The limit on the number of requests per second was exceeded.</p>
        capo_inspector2.errors.validation_exception.ValidationException: <p>The request has failed validation due to missing required fields or having invalid inputs.</p>
        capo_inspector2.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Sample UpdateCisScanConfiguration Call

        >>> await client.update_cis_scan_configuration(scan_configuration_arn='arn:aws:inspector2:us-east-1:123412341234:owner/123412341234/cis-configuration/624b746d-e080-44ae-8c1d-48e653365a38', scan_name='sample_new', security_level='LEVEL_2', schedule={'daily': {'startTime': {'timeOfDay': '12:56', 'timezone': 'UTC'}}}, targets={'accountIds': ['SELF'], 'targetResourceTags': {'key2': ['value2']}})
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_inspector2.types.update_cis_scan_configuration_request.UpdateCisScanConfigurationRequest]",
    ) -> AsyncOperationResponse[
        "capo_inspector2.types.update_cis_scan_configuration_response.UpdateCisScanConfigurationResponse"
    ]:
        import capo_inspector2._operations.inspector2.update_cis_scan_configuration

        (
            output,
            http_response,
        ) = await capo_inspector2._operations.inspector2.update_cis_scan_configuration.async_update_cis_scan_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateCisScanConfiguration")
    )
    input_: capo_inspector2.types.update_cis_scan_configuration_request.UpdateCisScanConfigurationRequest = {
        "scan_configuration_arn": scan_configuration_arn
    }
    if scan_name is not None:
        input_["scan_name"] = scan_name
    if security_level is not None:
        input_["security_level"] = security_level
    if schedule is not None:
        input_["schedule"] = schedule
    if targets is not None:
        input_["targets"] = targets

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