Skip to content

update_configuration

update_configuration(
    *,
    config_overrides: Optional[Inspector2ClientConfig] = None,
    account_id: Optional[AccountId] = None,
    ecr_configuration: Optional[EcrConfiguration] = None,
    ec2_configuration: Optional[Ec2Configuration] = None,
    update_configuration_inheritance: Optional[UpdateConfigurationInheritance] = None,
) -> UpdateConfigurationResponse

Updates the scan configuration for your Amazon Inspector account. If you don't specify an accountId, this operation updates the delegated administrator's configuration and propagates it to member accounts that have not been individually configured. If you specify an accountId, this operation updates that member account's configuration. Only the delegated administrator can specify an accountId; member accounts cannot call this operation.

Parameters:

  • account_id (Optional[AccountId], default: None ) –

    The 12-digit Amazon Web Services account ID of the member account whose scan configuration you want to update. When specified, you must be the delegated administrator for this member account. If not specified, the operation updates your own configuration and propagates changes to any member accounts that have not been individually configured.

  • ecr_configuration (Optional[EcrConfiguration], default: None ) –

    Specifies how the ECR automated re-scan will be updated for your environment.

  • ec2_configuration (Optional[Ec2Configuration], default: None ) –

    Specifies how the Amazon EC2 automated scan will be updated for your environment.

  • update_configuration_inheritance (Optional[UpdateConfigurationInheritance], default: None ) –

    Specifies which scan-type configurations to reset to the delegated administrator's inherited values for the targeted member account. Each member of this structure is independently optional. When specified, ec2Configuration and ecrConfiguration must be absent, and accountId must also be present. Only INHERIT_FROM_ADMIN is valid for each member. If not specified, the operation uses the ec2Configuration and ecrConfiguration parameters instead.

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.

  • 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.

Source code in docs_src/capo_inspector2/_services/inspector2.py
def update_configuration(
    self,
    *,
    config_overrides: Optional[Inspector2ClientConfig] = None,
    account_id: Optional["capo_inspector2.types.account_id.AccountId"] = None,
    ecr_configuration: Optional[
        "capo_inspector2.types.ecr_configuration.EcrConfiguration"
    ] = None,
    ec2_configuration: Optional[
        "capo_inspector2.types.ec2_configuration.Ec2Configuration"
    ] = None,
    update_configuration_inheritance: Optional[
        "capo_inspector2.types.update_configuration_inheritance.UpdateConfigurationInheritance"
    ] = None,
) -> "capo_inspector2.types.update_configuration_response.UpdateConfigurationResponse":
    """<p>Updates the scan configuration for your Amazon Inspector account. If you don't specify an <code>accountId</code>, this operation updates the delegated administrator's configuration and propagates it to member accounts that have not been individually configured. If you specify an <code>accountId</code>, this operation updates that member account's configuration. Only the delegated administrator can specify an <code>accountId</code>; member accounts cannot call this operation.</p>

    Args:
        account_id: <p>The 12-digit Amazon Web Services account ID of the member account whose scan configuration you want to update. When specified, you must be the delegated administrator for this member account. If not specified, the operation updates your own configuration and propagates changes to any member accounts that have not been individually configured.</p>
        ecr_configuration: <p>Specifies how the ECR automated re-scan will be updated for your environment.</p>
        ec2_configuration: <p>Specifies how the Amazon EC2 automated scan will be updated for your environment.</p>
        update_configuration_inheritance: <p>Specifies which scan-type configurations to reset to the delegated administrator's inherited values for the targeted member account. Each member of this structure is independently optional. When specified, <code>ec2Configuration</code> and <code>ecrConfiguration</code> must be absent, and <code>accountId</code> must also be present. Only <code>INHERIT_FROM_ADMIN</code> is valid for each member. If not specified, the operation uses the <code>ec2Configuration</code> and <code>ecrConfiguration</code> parameters instead.</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.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.
    """

    def _handler(
        req: "OperationRequest[capo_inspector2.types.update_configuration_request.UpdateConfigurationRequest]",
    ) -> OperationResponse[
        "capo_inspector2.types.update_configuration_response.UpdateConfigurationResponse"
    ]:
        import capo_inspector2._operations.inspector2.update_configuration

        output, http_response = (
            capo_inspector2._operations.inspector2.update_configuration.update_configuration(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateConfiguration")
    )
    input_: capo_inspector2.types.update_configuration_request.UpdateConfigurationRequest = {}
    if account_id is not None:
        input_["account_id"] = account_id
    if ecr_configuration is not None:
        input_["ecr_configuration"] = ecr_configuration
    if ec2_configuration is not None:
        input_["ec2_configuration"] = ec2_configuration
    if update_configuration_inheritance is not None:
        input_["update_configuration_inheritance"] = (
            update_configuration_inheritance
        )

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output