createImageRecipe method
- required String name,
- required String parentImage,
- required String semanticVersion,
- AdditionalInstanceConfiguration? additionalInstanceConfiguration,
- Map<
String, String> ? amiTags, - List<
InstanceBlockDeviceMapping> ? blockDeviceMappings, - String? clientToken,
- List<
ComponentConfiguration> ? components, - String? description,
- Map<
String, String> ? tags, - String? workingDirectory,
Creates a new image recipe. Image recipes define how images are configured, tested, and assessed.
May throw CallRateLimitExceededException.
May throw ClientException.
May throw ForbiddenException.
May throw IdempotentParameterMismatchException.
May throw InvalidRequestException.
May throw InvalidVersionNumberException.
May throw ResourceAlreadyExistsException.
May throw ResourceInUseException.
May throw ServiceException.
May throw ServiceQuotaExceededException.
May throw ServiceUnavailableException.
Parameter name :
The name of the image recipe.
Parameter parentImage :
The base image for customizations specified in the image recipe. You can
specify the parent image using one of the following options:
- AMI ID
- Image Builder image Amazon Resource Name (ARN)
-
Amazon Web Services Systems Manager (SSM) Parameter Store Parameter,
prefixed by
ssm:, followed by the parameter name or ARN. - Amazon Web Services Marketplace product ID
Parameter semanticVersion :
The semantic version of the image recipe. This version follows the
semantic version syntax.
Assignment: For the first three nodes you can assign any positive integer value, including zero, with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the fourth node.
Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as 2021.01.01.
Parameter additionalInstanceConfiguration :
Specify additional settings and launch scripts for your build instances.
Parameter amiTags :
Tags that are applied to the AMI that Image Builder creates during the
Build phase prior to image distribution.
Parameter blockDeviceMappings :
The block device mappings of the image recipe.
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 components :
The components included in the image recipe.
Parameter description :
The description of the image recipe.
Parameter tags :
The tags of the image recipe.
Parameter workingDirectory :
The working directory used during build and test workflows.
Implementation
Future<CreateImageRecipeResponse> createImageRecipe({
required String name,
required String parentImage,
required String semanticVersion,
AdditionalInstanceConfiguration? additionalInstanceConfiguration,
Map<String, String>? amiTags,
List<InstanceBlockDeviceMapping>? blockDeviceMappings,
String? clientToken,
List<ComponentConfiguration>? components,
String? description,
Map<String, String>? tags,
String? workingDirectory,
}) async {
final $payload = <String, dynamic>{
'name': name,
'parentImage': parentImage,
'semanticVersion': semanticVersion,
if (additionalInstanceConfiguration != null)
'additionalInstanceConfiguration': additionalInstanceConfiguration,
if (amiTags != null) 'amiTags': amiTags,
if (blockDeviceMappings != null)
'blockDeviceMappings': blockDeviceMappings,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (components != null) 'components': components,
if (description != null) 'description': description,
if (tags != null) 'tags': tags,
if (workingDirectory != null) 'workingDirectory': workingDirectory,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/CreateImageRecipe',
exceptionFnMap: _exceptionFns,
);
return CreateImageRecipeResponse.fromJson(response);
}