Skip to content

update_launch_configuration

update_launch_configuration(
    source_server_id: SourceServerID,
    *,
    config_overrides: Optional[drsClientConfig] = None,
    name: Optional[SmallBoundedString] = None,
    launch_disposition: Optional[LaunchDisposition] = None,
    target_instance_type_right_sizing_method: Optional[
        TargetInstanceTypeRightSizingMethod
    ] = None,
    copy_private_ip: Optional[bool] = None,
    copy_tags: Optional[bool] = None,
    licensing: Optional[Licensing] = None,
    post_launch_enabled: Optional[bool] = None,
    launch_into_instance_properties: Optional[LaunchIntoInstanceProperties] = None,
    recovery_mode: Optional[RecoveryMode] = None,
) -> LaunchConfiguration

Updates a LaunchConfiguration by Source Server ID.

Parameters:

  • source_server_id (SourceServerID) –

    The ID of the Source Server that we want to retrieve a Launch Configuration for.

  • name (Optional[SmallBoundedString], default: None ) –

    The name of the launch configuration.

  • launch_disposition (Optional[LaunchDisposition], default: None ) –

    The state of the Recovery Instance in EC2 after the recovery operation.

  • target_instance_type_right_sizing_method (Optional[TargetInstanceTypeRightSizingMethod], default: None ) –

    Whether Elastic Disaster Recovery should try to automatically choose the instance type that best matches the OS, CPU, and RAM of your Source Server.

  • copy_private_ip (Optional[bool], default: None ) –

    Whether we should copy the Private IP of the Source Server to the Recovery Instance.

  • copy_tags (Optional[bool], default: None ) –

    Whether we want to copy the tags of the Source Server to the EC2 machine of the Recovery Instance.

  • licensing (Optional[Licensing], default: None ) –

    The licensing configuration to be used for this launch configuration.

  • post_launch_enabled (Optional[bool], default: None ) –

    Whether we want to enable post-launch actions for the Source Server.

  • launch_into_instance_properties (Optional[LaunchIntoInstanceProperties], default: None ) –

    Launch into existing instance properties.

  • recovery_mode (Optional[RecoveryMode], default: None ) –

    Recovery mode.

Raises:

Source code in docs_src/capo_drs/_services/drs.py
def update_launch_configuration(
    self,
    source_server_id: "capo_drs.types.source_server_id.SourceServerID",
    *,
    config_overrides: Optional[drsClientConfig] = None,
    name: Optional["capo_drs.types.small_bounded_string.SmallBoundedString"] = None,
    launch_disposition: Optional[
        "capo_drs.types.launch_disposition.LaunchDisposition"
    ] = None,
    target_instance_type_right_sizing_method: Optional[
        "capo_drs.types.target_instance_type_right_sizing_method.TargetInstanceTypeRightSizingMethod"
    ] = None,
    copy_private_ip: Optional[bool] = None,
    copy_tags: Optional[bool] = None,
    licensing: Optional["capo_drs.types.licensing.Licensing"] = None,
    post_launch_enabled: Optional[bool] = None,
    launch_into_instance_properties: Optional[
        "capo_drs.types.launch_into_instance_properties.LaunchIntoInstanceProperties"
    ] = None,
    recovery_mode: Optional["capo_drs.types.recovery_mode.RecoveryMode"] = None,
) -> "capo_drs.types.launch_configuration.LaunchConfiguration":
    """<p>Updates a LaunchConfiguration by Source Server ID.</p>

    Args:
        source_server_id: <p>The ID of the Source Server that we want to retrieve a Launch Configuration for.</p>
        name: <p>The name of the launch configuration.</p>
        launch_disposition: <p>The state of the Recovery Instance in EC2 after the recovery operation.</p>
        target_instance_type_right_sizing_method: <p>Whether Elastic Disaster Recovery should try to automatically choose the instance type that best matches the OS, CPU, and RAM of your Source Server.</p>
        copy_private_ip: <p>Whether we should copy the Private IP of the Source Server to the Recovery Instance.</p>
        copy_tags: <p>Whether we want to copy the tags of the Source Server to the EC2 machine of the Recovery Instance.</p>
        licensing: <p>The licensing configuration to be used for this launch configuration.</p>
        post_launch_enabled: <p>Whether we want to enable post-launch actions for the Source Server.</p>
        launch_into_instance_properties: <p>Launch into existing instance properties.</p>
        recovery_mode: <p>Recovery mode.</p>

    Raises:
        capo_drs.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the target resource.</p>
        capo_drs.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_drs.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource for this operation was not found.</p>
        capo_drs.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_drs.errors.uninitialized_account_exception.UninitializedAccountException: <p>The account performing the request has not been initialized.</p>
        capo_drs.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the AWS service.</p>
        capo_drs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_drs.types.update_launch_configuration_request.UpdateLaunchConfigurationRequest]",
    ) -> OperationResponse[
        "capo_drs.types.launch_configuration.LaunchConfiguration"
    ]:
        import capo_drs._operations.elastic_disaster_recovery_service.update_launch_configuration

        output, http_response = (
            capo_drs._operations.elastic_disaster_recovery_service.update_launch_configuration.update_launch_configuration(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateLaunchConfiguration")
    )
    input_: capo_drs.types.update_launch_configuration_request.UpdateLaunchConfigurationRequest = {
        "source_server_id": source_server_id
    }
    if name is not None:
        input_["name"] = name
    if launch_disposition is not None:
        input_["launch_disposition"] = launch_disposition
    if target_instance_type_right_sizing_method is not None:
        input_["target_instance_type_right_sizing_method"] = (
            target_instance_type_right_sizing_method
        )
    if copy_private_ip is not None:
        input_["copy_private_ip"] = copy_private_ip
    if copy_tags is not None:
        input_["copy_tags"] = copy_tags
    if licensing is not None:
        input_["licensing"] = licensing
    if post_launch_enabled is not None:
        input_["post_launch_enabled"] = post_launch_enabled
    if launch_into_instance_properties is not None:
        input_["launch_into_instance_properties"] = launch_into_instance_properties
    if recovery_mode is not None:
        input_["recovery_mode"] = recovery_mode

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