Skip to content

create_launch_configuration_template

create_launch_configuration_template(
    *,
    config_overrides: Optional[mgnClientConfig] = None,
    post_launch_actions: Optional[PostLaunchActions] = None,
    enable_map_auto_tagging: Optional[bool] = None,
    map_auto_tagging_mpe_id: Optional[TagValue] = None,
    tags: Optional[TagsMap] = None,
    launch_disposition: Optional[LaunchDisposition] = None,
    target_instance_type_right_sizing_method: Optional[
        TargetInstanceTypeRightSizingMethod
    ] = None,
    copy_private_ip: Optional[bool] = None,
    associate_public_ip_address: Optional[bool] = None,
    copy_tags: Optional[bool] = None,
    licensing: Optional[Licensing] = None,
    boot_mode: Optional[BootMode] = None,
    small_volume_max_size: Optional[PositiveInteger] = None,
    small_volume_conf: Optional[LaunchTemplateDiskConf] = None,
    large_volume_conf: Optional[LaunchTemplateDiskConf] = None,
    enable_parameters_encryption: Optional[bool] = None,
    parameters_encryption_key: Optional[KmsKeyArn] = None,
) -> LaunchConfigurationTemplate

Creates a new Launch Configuration Template.

Parameters:

Raises:

Source code in docs_src/capo_mgn/_services/mgn.py
def create_launch_configuration_template(
    self,
    *,
    config_overrides: Optional[mgnClientConfig] = None,
    post_launch_actions: Optional[
        "capo_mgn.types.post_launch_actions.PostLaunchActions"
    ] = None,
    enable_map_auto_tagging: Optional[bool] = None,
    map_auto_tagging_mpe_id: Optional["capo_mgn.types.tag_value.TagValue"] = None,
    tags: Optional["capo_mgn.types.tags_map.TagsMap"] = None,
    launch_disposition: Optional[
        "capo_mgn.types.launch_disposition.LaunchDisposition"
    ] = None,
    target_instance_type_right_sizing_method: Optional[
        "capo_mgn.types.target_instance_type_right_sizing_method.TargetInstanceTypeRightSizingMethod"
    ] = None,
    copy_private_ip: Optional[bool] = None,
    associate_public_ip_address: Optional[bool] = None,
    copy_tags: Optional[bool] = None,
    licensing: Optional["capo_mgn.types.licensing.Licensing"] = None,
    boot_mode: Optional["capo_mgn.types.boot_mode.BootMode"] = None,
    small_volume_max_size: Optional[
        "capo_mgn.types.positive_integer.PositiveInteger"
    ] = None,
    small_volume_conf: Optional[
        "capo_mgn.types.launch_template_disk_conf.LaunchTemplateDiskConf"
    ] = None,
    large_volume_conf: Optional[
        "capo_mgn.types.launch_template_disk_conf.LaunchTemplateDiskConf"
    ] = None,
    enable_parameters_encryption: Optional[bool] = None,
    parameters_encryption_key: Optional[
        "capo_mgn.types.kms_key_arn.KmsKeyArn"
    ] = None,
) -> "capo_mgn.types.launch_configuration_template.LaunchConfigurationTemplate":
    """<p>Creates a new Launch Configuration Template.</p>

    Args:
        post_launch_actions: <p>Launch configuration template post launch actions.</p>
        enable_map_auto_tagging: <p>Enable map auto tagging.</p>
        map_auto_tagging_mpe_id: <p>Launch configuration template map auto tagging MPE ID.</p>
        tags: <p>Request to associate tags during creation of a Launch Configuration Template.</p>
        launch_disposition: <p>Launch disposition.</p>
        target_instance_type_right_sizing_method: <p>Target instance type right-sizing method.</p>
        copy_private_ip: <p>Copy private Ip.</p>
        associate_public_ip_address: <p>Associate public Ip address.</p>
        copy_tags: <p>Copy tags.</p>
        boot_mode: <p>Launch configuration template boot mode.</p>
        small_volume_max_size: <p>Small volume maximum size.</p>
        small_volume_conf: <p>Small volume config.</p>
        large_volume_conf: <p>Large volume config.</p>
        enable_parameters_encryption: <p>Enable parameters encryption.</p>
        parameters_encryption_key: <p>Parameters encryption key.</p>

    Raises:
        capo_mgn.errors.access_denied_exception.AccessDeniedException: <p>Operation denied due to a file permission or access check error.</p>
        capo_mgn.errors.uninitialized_account_exception.UninitializedAccountException: <p>Uninitialized account exception.</p>
        capo_mgn.errors.validation_exception.ValidationException: <p>Validate exception.</p>
        capo_mgn.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_mgn.types.create_launch_configuration_template_request.CreateLaunchConfigurationTemplateRequest]",
    ) -> OperationResponse[
        "capo_mgn.types.launch_configuration_template.LaunchConfigurationTemplate"
    ]:
        import capo_mgn._operations.application_migration_service.create_launch_configuration_template

        output, http_response = (
            capo_mgn._operations.application_migration_service.create_launch_configuration_template.create_launch_configuration_template(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_mgn.types.create_launch_configuration_template_request.CreateLaunchConfigurationTemplateRequest",
    ) -> dict[str, Any]:
        import capo_mgn.types.create_launch_configuration_template_request

        return capo_mgn.types.create_launch_configuration_template_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_mgn.types.launch_configuration_template.LaunchConfigurationTemplate",
    ) -> dict[str, Any]:
        import capo_mgn.types.launch_configuration_template

        return capo_mgn.types.launch_configuration_template.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateLaunchConfigurationTemplate",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_mgn.types.create_launch_configuration_template_request.CreateLaunchConfigurationTemplateRequest = {}
    if post_launch_actions is not None:
        input_["post_launch_actions"] = post_launch_actions
    if enable_map_auto_tagging is not None:
        input_["enable_map_auto_tagging"] = enable_map_auto_tagging
    if map_auto_tagging_mpe_id is not None:
        input_["map_auto_tagging_mpe_id"] = map_auto_tagging_mpe_id
    if tags is not None:
        input_["tags"] = tags
    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 associate_public_ip_address is not None:
        input_["associate_public_ip_address"] = associate_public_ip_address
    if copy_tags is not None:
        input_["copy_tags"] = copy_tags
    if licensing is not None:
        input_["licensing"] = licensing
    if boot_mode is not None:
        input_["boot_mode"] = boot_mode
    if small_volume_max_size is not None:
        input_["small_volume_max_size"] = small_volume_max_size
    if small_volume_conf is not None:
        input_["small_volume_conf"] = small_volume_conf
    if large_volume_conf is not None:
        input_["large_volume_conf"] = large_volume_conf
    if enable_parameters_encryption is not None:
        input_["enable_parameters_encryption"] = enable_parameters_encryption
    if parameters_encryption_key is not None:
        input_["parameters_encryption_key"] = parameters_encryption_key

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