updateMicrovmImage method
- required String baseImageArn,
- required String buildRoleArn,
- required CodeArtifact codeArtifact,
- required String imageIdentifier,
- List<
Capability> ? additionalOsCapabilities, - String? baseImageVersion,
- String? clientToken,
- List<
CpuConfiguration> ? cpuConfigurations, - String? description,
- List<
String> ? egressNetworkConnectors, - Map<
String, String> ? environmentVariables, - Hooks? hooks,
- Logging? logging,
- List<
Resources> ? resources,
Updates the configuration of a MicroVM image and triggers a new version build. This operation uses PUT semantics — all required fields (codeArtifact, baseImageArn, buildRoleArn) must be provided with every request.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter baseImageArn :
The ARN of the base MicroVM image.
Parameter buildRoleArn :
The ARN of the IAM build role.
Parameter codeArtifact :
The code artifact containing the application code and metadata for the
MicroVM image.
Parameter imageIdentifier :
The unique identifier (ARN or ID) of the MicroVM image to update.
Parameter additionalOsCapabilities :
Additional OS capabilities granted to the MicroVM runtime environment.
Parameter baseImageVersion :
The specific version of the base MicroVM image to use.
Parameter clientToken :
A unique, case-sensitive identifier you provide to ensure the idempotency
of the request.
Parameter cpuConfigurations :
The list of supported CPU configurations for the MicroVM.
Parameter description :
The description of the MicroVM image.
Parameter egressNetworkConnectors :
The list of egress network connectors available to the MicroVM at runtime.
Parameter environmentVariables :
Environment variables set in the MicroVM runtime environment.
Parameter logging :
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.
Parameter resources :
The resource requirements for the MicroVM.
Implementation
Future<UpdateMicrovmImageResponse> updateMicrovmImage({
required String baseImageArn,
required String buildRoleArn,
required CodeArtifact codeArtifact,
required String imageIdentifier,
List<Capability>? additionalOsCapabilities,
String? baseImageVersion,
String? clientToken,
List<CpuConfiguration>? cpuConfigurations,
String? description,
List<String>? egressNetworkConnectors,
Map<String, String>? environmentVariables,
Hooks? hooks,
Logging? logging,
List<Resources>? resources,
}) async {
final $payload = <String, dynamic>{
'baseImageArn': baseImageArn,
'buildRoleArn': buildRoleArn,
'codeArtifact': codeArtifact,
if (additionalOsCapabilities != null)
'additionalOsCapabilities':
additionalOsCapabilities.map((e) => e.value).toList(),
if (baseImageVersion != null) 'baseImageVersion': baseImageVersion,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (cpuConfigurations != null) 'cpuConfigurations': cpuConfigurations,
if (description != null) 'description': description,
if (egressNetworkConnectors != null)
'egressNetworkConnectors': egressNetworkConnectors,
if (environmentVariables != null)
'environmentVariables': environmentVariables,
if (hooks != null) 'hooks': hooks,
if (logging != null) 'logging': logging,
if (resources != null) 'resources': resources,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/2025-09-09/microvm-images/${Uri.encodeComponent(imageIdentifier)}',
exceptionFnMap: _exceptionFns,
);
return UpdateMicrovmImageResponse.fromJson(response);
}