createContainerRecipe method
- required ContainerType containerType,
- required String name,
- required String parentImage,
- required String semanticVersion,
- required TargetContainerRepository targetRepository,
- String? clientToken,
- List<
ComponentConfiguration> ? components, - String? description,
- String? dockerfileTemplateData,
- String? dockerfileTemplateUri,
- String? imageOsVersionOverride,
- InstanceConfiguration? instanceConfiguration,
- String? kmsKeyId,
- Platform? platformOverride,
- Map<
String, String> ? tags, - String? workingDirectory,
Creates a new container recipe. Container 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 containerType :
The type of container to create.
Parameter name :
The name of the container recipe.
Parameter parentImage :
The base image for the container recipe.
Parameter semanticVersion :
The semantic version of the container 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 targetRepository :
The destination repository for the container image.
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 container recipe.
Parameter description :
The description of the container recipe.
Parameter dockerfileTemplateData :
The Dockerfile template used to build your image as an inline data blob.
Parameter dockerfileTemplateUri :
The Amazon S3 URI for the Dockerfile that will be used to build your
container image.
Parameter imageOsVersionOverride :
Specifies the operating system version for the base image.
Parameter instanceConfiguration :
A group of options that can be used to configure an instance for building
and testing container images.
Parameter kmsKeyId :
The Amazon Resource Name (ARN) that uniquely identifies which KMS key is
used to encrypt the Dockerfile template. This can be either the Key ARN or
the Alias ARN. For more information, see Key
identifiers (KeyId) in the Key Management Service Developer
Guide.
Parameter platformOverride :
Specifies the operating system platform when you use a custom base image.
Parameter tags :
Tags that are attached to the container recipe.
Parameter workingDirectory :
The working directory for use during build and test workflows.
Implementation
Future<CreateContainerRecipeResponse> createContainerRecipe({
required ContainerType containerType,
required String name,
required String parentImage,
required String semanticVersion,
required TargetContainerRepository targetRepository,
String? clientToken,
List<ComponentConfiguration>? components,
String? description,
String? dockerfileTemplateData,
String? dockerfileTemplateUri,
String? imageOsVersionOverride,
InstanceConfiguration? instanceConfiguration,
String? kmsKeyId,
Platform? platformOverride,
Map<String, String>? tags,
String? workingDirectory,
}) async {
final $payload = <String, dynamic>{
'containerType': containerType.value,
'name': name,
'parentImage': parentImage,
'semanticVersion': semanticVersion,
'targetRepository': targetRepository,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (components != null) 'components': components,
if (description != null) 'description': description,
if (dockerfileTemplateData != null)
'dockerfileTemplateData': dockerfileTemplateData,
if (dockerfileTemplateUri != null)
'dockerfileTemplateUri': dockerfileTemplateUri,
if (imageOsVersionOverride != null)
'imageOsVersionOverride': imageOsVersionOverride,
if (instanceConfiguration != null)
'instanceConfiguration': instanceConfiguration,
if (kmsKeyId != null) 'kmsKeyId': kmsKeyId,
if (platformOverride != null) 'platformOverride': platformOverride.value,
if (tags != null) 'tags': tags,
if (workingDirectory != null) 'workingDirectory': workingDirectory,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/CreateContainerRecipe',
exceptionFnMap: _exceptionFns,
);
return CreateContainerRecipeResponse.fromJson(response);
}