create_launch_template_version
¶
create_launch_template_version(
*,
config_overrides: Optional[EC2ClientConfig] = None,
dry_run: Optional[Boolean] = None,
client_token: Optional[String] = None,
launch_template_id: Optional[LaunchTemplateId] = None,
launch_template_name: Optional[LaunchTemplateName] = None,
source_version: Optional[String] = None,
version_description: Optional[VersionDescription] = None,
launch_template_data: Optional[RequestLaunchTemplateData] = None,
resolve_alias: Optional[Boolean] = None,
) -> CreateLaunchTemplateVersionResult
Creates a new version of a launch template. You must specify an existing launch template, either by name or ID. You can determine whether the new version inherits parameters from a source version, and add or overwrite parameters as needed.
Launch template versions are numbered in the order in which they are created. You can't specify, change, or replace the numbering of launch template versions.
Launch templates are immutable; after you create a launch template, you can't modify it. Instead, you can create a new version of the launch template that includes the changes that you require.
For more information, see Modify a launch template (manage launch template versions) in the Amazon EC2 User Guide.
Parameters:
-
dry_run(Optional[Boolean], default:None) –Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is
DryRunOperation. Otherwise, it isUnauthorizedOperation. -
client_token(Optional[String], default:None) –Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If a client token isn't specified, a randomly generated token is used in the request to ensure idempotency.
For more information, see Ensuring idempotency.
Constraint: Maximum 128 ASCII characters.
-
launch_template_id(Optional[LaunchTemplateId], default:None) –The ID of the launch template.
You must specify either the launch template ID or the launch template name, but not both.
-
launch_template_name(Optional[LaunchTemplateName], default:None) –The name of the launch template.
You must specify either the launch template ID or the launch template name, but not both.
-
source_version(Optional[String], default:None) –The version of the launch template on which to base the new version. Snapshots applied to the block device mapping are ignored when creating a new version unless they are explicitly included.
If you specify this parameter, the new version inherits the launch parameters from the source version. If you specify additional launch parameters for the new version, they overwrite any corresponding launch parameters inherited from the source version.
If you omit this parameter, the new version contains only the launch parameters that you specify for the new version.
-
version_description(Optional[VersionDescription], default:None) –A description for the version of the launch template.
-
launch_template_data(Optional[RequestLaunchTemplateData], default:None) –The information for the launch template.
-
resolve_alias(Optional[Boolean], default:None) –If
true, and if a Systems Manager parameter is specified forImageId, the AMI ID is displayed in the response forimageID. For more information, see Use a Systems Manager parameter instead of an AMI ID in the Amazon EC2 User Guide.Default:
false
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To create a launch template version This example creates a new launch template version based on version 1 of the specified launch template and specifies a different AMI ID.
>>> client.create_launch_template_version(launch_template_id='lt-0abcd290751193123', source_version='1', version_description='WebVersion2', launch_template_data={'ImageId': 'ami-c998b6b2'})
Source code in docs_src/capo_ec2/_services/ec2.py
9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 | |