importDiskImage method
- required String infrastructureConfigurationArn,
- required String name,
- required String osVersion,
- required String platform,
- required String semanticVersion,
- required String uri,
- String? clientToken,
- String? description,
- String? executionRole,
- ImageLoggingConfiguration? loggingConfiguration,
- RegisterImageOptions? registerImageOptions,
- Map<
String, String> ? tags, - WindowsConfiguration? windowsConfiguration,
Import a Windows operating system image from a verified Microsoft ISO disk file. The following disk images are supported:
- Windows 11 Enterprise
May throw AccessDeniedException.
May throw ClientException.
May throw ServiceException.
May throw ServiceUnavailableException.
May throw TooManyRequestsException.
Parameter infrastructureConfigurationArn :
The Amazon Resource Name (ARN) of the infrastructure configuration
resource that's used for launching the EC2 instance on which the ISO image
is built.
Parameter name :
The name of the image resource that's created from the import.
Parameter osVersion :
The operating system version for the imported image. Allowed values
include the following: Microsoft Windows 11.
Parameter platform :
The operating system platform for the imported image. Allowed values
include the following: Windows.
Parameter semanticVersion :
The semantic version to attach to the image that's created during the
import process. This version follows the semantic version syntax.
Parameter uri :
The uri of the ISO disk file that's stored in Amazon S3.
Parameter clientToken :
Unique, case-sensitive identifier you provide to ensure idempotency of the
request. For more information, see Ensuring
idempotency in the Amazon EC2 API Reference.
Parameter description :
The description for your disk image import.
Parameter executionRole :
The name or Amazon Resource Name (ARN) for the IAM role you create that
grants Image Builder access to perform workflow actions to import an image
from a Microsoft ISO file.
Parameter loggingConfiguration :
Define logging configuration for the image build process.
Parameter registerImageOptions :
Configures Secure Boot and UEFI settings for the imported image.
Parameter tags :
Tags that are attached to image resources created from the import.
Parameter windowsConfiguration :
Specifies Windows settings for ISO imports.
Implementation
Future<ImportDiskImageResponse> importDiskImage({
required String infrastructureConfigurationArn,
required String name,
required String osVersion,
required String platform,
required String semanticVersion,
required String uri,
String? clientToken,
String? description,
String? executionRole,
ImageLoggingConfiguration? loggingConfiguration,
RegisterImageOptions? registerImageOptions,
Map<String, String>? tags,
WindowsConfiguration? windowsConfiguration,
}) async {
final $payload = <String, dynamic>{
'infrastructureConfigurationArn': infrastructureConfigurationArn,
'name': name,
'osVersion': osVersion,
'platform': platform,
'semanticVersion': semanticVersion,
'uri': uri,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'description': description,
if (executionRole != null) 'executionRole': executionRole,
if (loggingConfiguration != null)
'loggingConfiguration': loggingConfiguration,
if (registerImageOptions != null)
'registerImageOptions': registerImageOptions,
if (tags != null) 'tags': tags,
if (windowsConfiguration != null)
'windowsConfiguration': windowsConfiguration,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/ImportDiskImage',
exceptionFnMap: _exceptionFns,
);
return ImportDiskImageResponse.fromJson(response);
}