Creates a new image along with all configured output resources defined in the distribution configuration¶
Description¶
Creates a new image along with all configured output resources defined in the distribution configuration. You must specify exactly one recipe for your image, using either a containerRecipeArn or an imageRecipeArn.
The response returns as soon as Image Builder creates the new image resource. The image build process runs asynchronously. To check its progress, call get_image and check the image status.
Usage¶
imagebuilder_create_image(imageRecipeArn, containerRecipeArn,
distributionConfigurationArn, infrastructureConfigurationArn,
imageTestsConfiguration, enhancedImageMetadataEnabled, tags,
clientToken, imageScanningConfiguration, workflows, executionRole,
loggingConfiguration)
Arguments¶
-
imageRecipeArnThe Amazon Resource Name (ARN) of the image recipe that defines how images are configured, tested, and assessed. You must specify either this property or
containerRecipeArn, but not both. -
containerRecipeArnThe Amazon Resource Name (ARN) of the container recipe that defines how images are configured and tested. You must specify either this property or
imageRecipeArn, but not both. -
distributionConfigurationArnThe Amazon Resource Name (ARN) of the distribution configuration that defines and configures the outputs of the image build. If you don't specify a distribution configuration, Image Builder creates the output image only in the account and Amazon Web Services Region where the build runs.
-
infrastructureConfigurationArn[required] The Amazon Resource Name (ARN) of the infrastructure configuration that defines the environment in which your image will be built and tested.
-
imageTestsConfigurationSettings that determine whether Image Builder runs tests on the image after building it. Image tests are enabled by default.
-
enhancedImageMetadataEnabledSpecifies whether to collect additional information about the image being created, including the operating system (OS) version and package list. Defaults to
true. -
tagsThe tags of the image.
-
clientToken[required] A unique, case-sensitive identifier you provide to ensure that the operation runs no more than one time. If you retry a request with the same client token, Image Builder returns the original response without running the operation again. For more information, see Ensuring idempotency in the Amazon EC2 API Reference.
-
imageScanningConfigurationSettings for vulnerability scans that Amazon Inspector runs during image creation. For AMI output, Amazon Inspector scans the test instance. For container output, Amazon Inspector scans the container image that Image Builder pushes to the Amazon ECR repository specified in
ecrConfiguration. -
workflowsThe array of workflow configuration objects for the build. If you specify workflows, they replace the default workflows that Image Builder otherwise runs for the build, and you must also provide an
executionRole. -
executionRoleThe name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to perform workflow actions. This property is required if you specify
workflows. If you don't provide a role, Image Builder uses the Image Builder service-linked role in your account, and creates it if it doesn't exist. -
loggingConfigurationThe CloudWatch Logs log group where Image Builder sends the image build logs. If you specify a log group name outside of the
/aws/imagebuilder/namespace, you must also provide anexecutionRolethat has permission to write to that log group.
Value¶
A list with the following syntax:
list(
requestId = "string",
clientToken = "string",
imageBuildVersionArn = "string",
latestVersionReferences = list(
latestVersionArn = "string",
latestMajorVersionArn = "string",
latestMinorVersionArn = "string",
latestPatchVersionArn = "string"
)
)
Request syntax¶
svc$create_image(
imageRecipeArn = "string",
containerRecipeArn = "string",
distributionConfigurationArn = "string",
infrastructureConfigurationArn = "string",
imageTestsConfiguration = list(
imageTestsEnabled = TRUE|FALSE,
timeoutMinutes = 123
),
enhancedImageMetadataEnabled = TRUE|FALSE,
tags = list(
"string"
),
clientToken = "string",
imageScanningConfiguration = list(
imageScanningEnabled = TRUE|FALSE,
ecrConfiguration = list(
repositoryName = "string",
containerTags = list(
"string"
)
)
),
workflows = list(
list(
workflowArn = "string",
parameters = list(
list(
name = "string",
value = list(
"string"
)
)
),
parallelGroup = "string",
onFailure = "CONTINUE"|"ABORT"
)
),
executionRole = "string",
loggingConfiguration = list(
logGroupName = "string"
)
)