Skip to content

update_environment

update_environment(
    environment_id: EnvironmentId,
    *,
    config_overrides: Optional[ContinuumClientConfig] = None,
    name: Optional[EnvironmentName] = None,
    configuration: Optional[UpdateEnvironmentConfiguration] = None,
) -> UpdateEnvironmentOutput

Updates the customer-controlled mutable properties of an environment. Only the name, the environment's S3 integration source and repository selections, its scan frequency, its network policy, and its patch creation policy can be changed.

Parameters:

Raises:

  • AccessDeniedException –

    The request is not authorized. Verify that your credentials and request signature are valid and that you have permission to perform this action.

  • ConflictException –

    The request could not be completed due to a conflict with the current state of the resource.

  • InternalServerException –

    The request couldn't be processed because of an internal server issue. Try again later. If the problem persists, contact AWS Support.

  • ResourceNotFoundException –

    The specified resource was not found. Verify that the resource identifier is correct and that the resource exists.

  • ThrottlingException –

    The request was denied due to request throttling.

  • UnknownServiceError –

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

Source code in docs_src/capo_continuum/_services/continuum.py
def update_environment(
    self,
    environment_id: "capo_continuum.types.environment_id.EnvironmentId",
    *,
    config_overrides: Optional[ContinuumClientConfig] = None,
    name: Optional["capo_continuum.types.environment_name.EnvironmentName"] = None,
    configuration: Optional[
        "capo_continuum.types.update_environment_configuration.UpdateEnvironmentConfiguration"
    ] = None,
) -> "capo_continuum.types.update_environment_output.UpdateEnvironmentOutput":
    """Updates the customer-controlled mutable properties of an environment. Only the name, the environment's S3 integration source and repository selections, its scan frequency, its network policy, and its patch creation policy can be changed.

    Args:
        environment_id: The unique identifier of the environment to update.
        name: The new customer-visible name.
        configuration: Type-specific configuration changes. Omission preserves the configuration.

    Raises:
        capo_continuum.errors.access_denied_exception.AccessDeniedException: The request is not authorized. Verify that your credentials and request signature are valid and that you have permission to perform this action.
        capo_continuum.errors.conflict_exception.ConflictException: The request could not be completed due to a conflict with the current state of the resource.
        capo_continuum.errors.internal_server_exception.InternalServerException: The request couldn't be processed because of an internal server issue. Try again later. If the problem persists, contact AWS Support.
        capo_continuum.errors.resource_not_found_exception.ResourceNotFoundException: The specified resource was not found. Verify that the resource identifier is correct and that the resource exists.
        capo_continuum.errors.throttling_exception.ThrottlingException: The request was denied due to request throttling.
        capo_continuum.errors.validation_exception.ValidationException
        capo_continuum.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_continuum.types.update_environment_input.UpdateEnvironmentInput]",
    ) -> OperationResponse[
        "capo_continuum.types.update_environment_output.UpdateEnvironmentOutput"
    ]:
        import capo_continuum._operations.continuum_control_plane.update_environment

        output, http_response = (
            capo_continuum._operations.continuum_control_plane.update_environment.update_environment(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateEnvironment")
    )
    input_: capo_continuum.types.update_environment_input.UpdateEnvironmentInput = {
        "environment_id": environment_id
    }
    if name is not None:
        input_["name"] = name
    if configuration is not None:
        input_["configuration"] = configuration

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