createImage method
- required String infrastructureConfigurationArn,
- String? clientToken,
- String? containerRecipeArn,
- String? distributionConfigurationArn,
- bool? enhancedImageMetadataEnabled,
- String? executionRole,
- String? imageRecipeArn,
- ImageScanningConfiguration? imageScanningConfiguration,
- ImageTestsConfiguration? imageTestsConfiguration,
- ImageLoggingConfiguration? loggingConfiguration,
- Map<
String, String> ? tags, - List<
WorkflowConfiguration> ? workflows,
Creates a new image. This request will create a new image along with all of the configured output resources defined in the distribution configuration. You must specify exactly one recipe for your image, using either a ContainerRecipeArn or an ImageRecipeArn.
May throw CallRateLimitExceededException.
May throw ClientException.
May throw ForbiddenException.
May throw IdempotentParameterMismatchException.
May throw InvalidRequestException.
May throw ResourceInUseException.
May throw ServiceException.
May throw ServiceQuotaExceededException.
May throw ServiceUnavailableException.
Parameter infrastructureConfigurationArn :
The Amazon Resource Name (ARN) of the infrastructure configuration that
defines the environment in which your image will be built and tested.
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 containerRecipeArn :
The Amazon Resource Name (ARN) of the container recipe that defines how
images are configured and tested.
Parameter distributionConfigurationArn :
The Amazon Resource Name (ARN) of the distribution configuration that
defines and configures the outputs of your pipeline.
Parameter enhancedImageMetadataEnabled :
Collects additional information about the image being created, including
the operating system (OS) version and package list. This information is
used to enhance the overall experience of using EC2 Image Builder. Enabled
by default.
Parameter executionRole :
The name or Amazon Resource Name (ARN) for the IAM role you create that
grants Image Builder access to perform workflow actions.
Parameter imageRecipeArn :
The Amazon Resource Name (ARN) of the image recipe that defines how images
are configured, tested, and assessed.
Parameter imageScanningConfiguration :
Contains settings for vulnerability scans.
Parameter imageTestsConfiguration :
The image tests configuration of the image.
Parameter loggingConfiguration :
Define logging configuration for the image build process.
Parameter tags :
The tags of the image.
Parameter workflows :
Contains an array of workflow configuration objects.
Implementation
Future<CreateImageResponse> createImage({
required String infrastructureConfigurationArn,
String? clientToken,
String? containerRecipeArn,
String? distributionConfigurationArn,
bool? enhancedImageMetadataEnabled,
String? executionRole,
String? imageRecipeArn,
ImageScanningConfiguration? imageScanningConfiguration,
ImageTestsConfiguration? imageTestsConfiguration,
ImageLoggingConfiguration? loggingConfiguration,
Map<String, String>? tags,
List<WorkflowConfiguration>? workflows,
}) async {
final $payload = <String, dynamic>{
'infrastructureConfigurationArn': infrastructureConfigurationArn,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (containerRecipeArn != null) 'containerRecipeArn': containerRecipeArn,
if (distributionConfigurationArn != null)
'distributionConfigurationArn': distributionConfigurationArn,
if (enhancedImageMetadataEnabled != null)
'enhancedImageMetadataEnabled': enhancedImageMetadataEnabled,
if (executionRole != null) 'executionRole': executionRole,
if (imageRecipeArn != null) 'imageRecipeArn': imageRecipeArn,
if (imageScanningConfiguration != null)
'imageScanningConfiguration': imageScanningConfiguration,
if (imageTestsConfiguration != null)
'imageTestsConfiguration': imageTestsConfiguration,
if (loggingConfiguration != null)
'loggingConfiguration': loggingConfiguration,
if (tags != null) 'tags': tags,
if (workflows != null) 'workflows': workflows,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/CreateImage',
exceptionFnMap: _exceptionFns,
);
return CreateImageResponse.fromJson(response);
}