create_launch_template_version
async
¶
create_launch_template_version(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = 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.
>>> await 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/async_ec2.py
10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 | |