imagebuilder / Client / create_image

create_image#

imagebuilder.Client.create_image(**kwargs)#

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.

See also: AWS API Documentation

Request Syntax

response = client.create_image(
    imageRecipeArn='string',
    containerRecipeArn='string',
    distributionConfigurationArn='string',
    infrastructureConfigurationArn='string',
    imageTestsConfiguration={
        'imageTestsEnabled': True|False,
        'timeoutMinutes': 123
    },
    enhancedImageMetadataEnabled=True|False,
    tags={
        'string': 'string'
    },
    clientToken='string',
    imageScanningConfiguration={
        'imageScanningEnabled': True|False,
        'ecrConfiguration': {
            'repositoryName': 'string',
            'containerTags': [
                'string',
            ]
        }
    },
    workflows=[
        {
            'workflowArn': 'string',
            'parameters': [
                {
                    'name': 'string',
                    'value': [
                        'string',
                    ]
                },
            ],
            'parallelGroup': 'string',
            'onFailure': 'CONTINUE'|'ABORT'
        },
    ],
    executionRole='string'
)
Parameters:
  • imageRecipeArn (string) – The Amazon Resource Name (ARN) of the image recipe that defines how images are configured, tested, and assessed.

  • containerRecipeArn (string) – The Amazon Resource Name (ARN) of the container recipe that defines how images are configured and tested.

  • distributionConfigurationArn (string) – The Amazon Resource Name (ARN) of the distribution configuration that defines and configures the outputs of your pipeline.

  • infrastructureConfigurationArn (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) of the infrastructure configuration that defines the environment in which your image will be built and tested.

  • imageTestsConfiguration (dict) –

    The image tests configuration of the image.

    • imageTestsEnabled (boolean) –

      Determines if tests should run after building the image. Image Builder defaults to enable tests to run following the image build, before image distribution.

    • timeoutMinutes (integer) –

      The maximum time in minutes that tests are permitted to run.

      Note

      The timeoutMinutes attribute is not currently active. This value is ignored.

  • enhancedImageMetadataEnabled (boolean) – 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.

  • tags (dict) –

    The tags of the image.

    • (string) –

      • (string) –

  • clientToken (string) –

    [REQUIRED]

    Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see Ensuring idempotency in the Amazon EC2 API Reference.

    This field is autopopulated if not provided.

  • imageScanningConfiguration (dict) –

    Contains settings for vulnerability scans.

    • imageScanningEnabled (boolean) –

      A setting that indicates whether Image Builder keeps a snapshot of the vulnerability scans that Amazon Inspector runs against the build instance when you create a new image.

    • ecrConfiguration (dict) –

      Contains Amazon ECR settings for vulnerability scans.

      • repositoryName (string) –

        The name of the container repository that Amazon Inspector scans to identify findings for your container images. The name includes the path for the repository location. If you don’t provide this information, Image Builder creates a repository in your account named image-builder-image-scanning-repository for vulnerability scans of your output container images.

      • containerTags (list) –

        Tags for Image Builder to apply to the output container image that &INS; scans. Tags can help you identify and manage your scanned images.

        • (string) –

  • workflows (list) –

    Contains an array of workflow configuration objects.

    • (dict) –

      Contains control settings and configurable inputs for a workflow resource.

      • workflowArn (string) – [REQUIRED]

        The Amazon Resource Name (ARN) of the workflow resource.

      • parameters (list) –

        Contains parameter values for each of the parameters that the workflow document defined for the workflow resource.

        • (dict) –

          Contains a key/value pair that sets the named workflow parameter.

          • name (string) – [REQUIRED]

            The name of the workflow parameter to set.

          • value (list) – [REQUIRED]

            Sets the value for the named workflow parameter.

            • (string) –

      • parallelGroup (string) –

        Test workflows are defined within named runtime groups called parallel groups. The parallel group is the named group that contains this test workflow. Test workflows within a parallel group can run at the same time. Image Builder starts up to five test workflows in the group at the same time, and starts additional workflows as others complete, until all workflows in the group have completed. This field only applies for test workflows.

      • onFailure (string) –

        The action to take if the workflow fails.

  • executionRole (string) – The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to perform workflow actions.

Return type:

dict

Returns:

Response Syntax

{
    'requestId': 'string',
    'clientToken': 'string',
    'imageBuildVersionArn': 'string'
}

Response Structure

  • (dict) –

    • requestId (string) –

      The request ID that uniquely identifies this request.

    • clientToken (string) –

      The client token that uniquely identifies the request.

    • imageBuildVersionArn (string) –

      The Amazon Resource Name (ARN) of the image that the request created.

Exceptions

  • imagebuilder.Client.exceptions.ServiceException

  • imagebuilder.Client.exceptions.ClientException

  • imagebuilder.Client.exceptions.ServiceUnavailableException

  • imagebuilder.Client.exceptions.InvalidRequestException

  • imagebuilder.Client.exceptions.IdempotentParameterMismatchException

  • imagebuilder.Client.exceptions.ForbiddenException

  • imagebuilder.Client.exceptions.CallRateLimitExceededException

  • imagebuilder.Client.exceptions.ResourceInUseException

  • imagebuilder.Client.exceptions.ServiceQuotaExceededException