create_microvm_image
¶
create_microvm_image(
base_image_arn: NonBlankString,
build_role_arn: RoleArn,
code_artifact: CodeArtifact,
name: ImageName,
*,
config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
base_image_version: Optional[Version] = None,
description: Optional[str] = None,
logging: Optional[Logging] = None,
egress_network_connectors: Optional[NetworkConnectorList] = None,
cpu_configurations: Optional[CpuConfigurationList] = None,
resources: Optional[ResourcesList] = None,
additional_os_capabilities: Optional[CapabilityList] = None,
hooks: Optional[Hooks] = None,
environment_variables: Optional[EnvironmentVariableMap] = None,
tags: Optional[Tags] = None,
client_token: Optional[str] = None,
) -> CreateMicrovmImageResponse
Creates a MicroVM image from the specified code artifact and base image. The build is asynchronous — the image transitions from CREATING to CREATED on success, or CREATE_FAILED on failure. Use GetMicrovmImage to poll for completion.
Parameters:
-
base_image_arn(NonBlankString) –The ARN of the Lambda-managed base MicroVM image to build upon. Use ListManagedMicrovmImages to discover available base images.
-
base_image_version(Optional[Version], default:None) –The specific version of the base MicroVM image to use.
-
build_role_arn(RoleArn) –The ARN of the IAM role assumed during the image build process. This role must have permissions to access the code artifact and any required resources.
-
description(Optional[str], default:None) –A description of the MicroVM image.
-
code_artifact(CodeArtifact) –The code artifact containing the application code and metadata for the MicroVM image.
-
logging(Optional[Logging], default:None) –The logging configuration for build-time and runtime logs. Specify {"cloudWatch": {"logGroup": "..."}} to stream logs to a custom CloudWatch log group, or {"disabled": {}} to turn off logging.
-
egress_network_connectors(Optional[NetworkConnectorList], default:None) –The list of egress network connectors available to the MicroVM at runtime.
-
cpu_configurations(Optional[CpuConfigurationList], default:None) –The list of supported CPU configurations for the MicroVM.
-
resources(Optional[ResourcesList], default:None) –The resource requirements for the MicroVM.
-
additional_os_capabilities(Optional[CapabilityList], default:None) –Additional OS capabilities granted to the MicroVM runtime environment.
-
environment_variables(Optional[EnvironmentVariableMap], default:None) –Environment variables set in the MicroVM runtime environment.
-
name(ImageName) –The name of the MicroVM image. Must be unique within the AWS account.
-
tags(Optional[Tags], default:None) –A set of key-value pairs that you can attach to the resource. Use tags to categorize resources for cost allocation, access control (ABAC), and organization.
-
client_token(Optional[str], default:None) –A unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client token, the operation returns the successful response without performing any further actions.
Raises:
-
AccessDeniedException–You do not have sufficient access to perform this action.
-
InternalServerException–An internal server error occurred. Retry the request later.
-
ThrottlingException–The request was denied due to request throttling. Retry the request later.
-
ValidationException–The input does not satisfy the constraints specified by the service.
-
ConflictException–The request could not be completed due to a conflict with the current state of the resource.
-
ResourceNotFoundException–The specified resource does not exist.
-
ServiceQuotaExceededException–You have exceeded a service quota for Lambda MicroVMs.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_lambda_microvms/_services/lambda_microvms.py
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | |