Skip to content

update_image_pipeline

update_image_pipeline(
    image_pipeline_arn: ImagePipelineArn,
    infrastructure_configuration_arn: InfrastructureConfigurationArn,
    client_token: ClientToken,
    *,
    config_overrides: Optional[imagebuilderClientConfig] = None,
    description: Optional[NonEmptyString] = None,
    image_recipe_arn: Optional[ImageRecipeArn] = None,
    container_recipe_arn: Optional[ContainerRecipeArn] = None,
    distribution_configuration_arn: Optional[DistributionConfigurationArn] = None,
    image_tests_configuration: Optional[ImageTestsConfiguration] = None,
    enhanced_image_metadata_enabled: Optional[NullableBoolean] = None,
    schedule: Optional[Schedule] = None,
    status: Optional[PipelineStatus] = None,
    image_scanning_configuration: Optional[ImageScanningConfiguration] = None,
    workflows: Optional[WorkflowConfigurationList] = None,
    logging_configuration: Optional[PipelineLoggingConfiguration] = None,
    execution_role: Optional[RoleNameOrArn] = None,
    image_tags: Optional[TagMap] = None,
) -> UpdateImagePipelineResponse

Updates an image pipeline. Use image pipelines to automate the creation and distribution of images. You must specify exactly one recipe for your image, using either a containerRecipeArn or an imageRecipeArn. The recipe must be the same type, image or container, as the pipeline's current recipe.

UpdateImagePipeline does not support selective updates. The request replaces the pipeline's entire configuration, so include every setting that you want to keep. Any optional property that you omit is removed or reset to its default.

Parameters:

  • image_pipeline_arn (ImagePipelineArn) –

    The Amazon Resource Name (ARN) of the image pipeline that you want to update.

  • description (Optional[NonEmptyString], default: None ) –

    The description of the image pipeline.

  • image_recipe_arn (Optional[ImageRecipeArn], default: None ) –

    The Amazon Resource Name (ARN) of the image recipe that configures images created by this image pipeline. You must specify either this property or containerRecipeArn, but not both.

  • container_recipe_arn (Optional[ContainerRecipeArn], default: None ) –

    The Amazon Resource Name (ARN) of the container recipe that is used to configure images created by this container pipeline. You must specify either this property or imageRecipeArn, but not both.

  • infrastructure_configuration_arn (InfrastructureConfigurationArn) –

    The Amazon Resource Name (ARN) of the infrastructure configuration that Image Builder uses to build images created by this image pipeline.

  • distribution_configuration_arn (Optional[DistributionConfigurationArn], default: None ) –

    The Amazon Resource Name (ARN) of the distribution configuration that Image Builder uses to configure and distribute images created by this image pipeline.

  • image_tests_configuration (Optional[ImageTestsConfiguration], default: None ) –

    Specifies the test settings that Image Builder applies to images that this pipeline creates. If you don't provide test settings, Image Builder stores a default configuration with image tests enabled.

  • enhanced_image_metadata_enabled (Optional[NullableBoolean], default: None ) –

    Specifies whether to collect additional information about the image being created, including the operating system (OS) version and package list. Defaults to true.

  • schedule (Optional[Schedule], default: None ) –

    The schedule of the image pipeline. Because the update replaces the entire configuration, omitting this property removes any existing schedule. The pipeline then runs only when you call StartImagePipelineExecution.

  • status (Optional[PipelineStatus], default: None ) –

    The status of the image pipeline. Defaults to ENABLED when omitted. To keep a pipeline disabled, include this property set to DISABLED in your update request.

  • client_token (ClientToken) –

    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.

  • image_scanning_configuration (Optional[ImageScanningConfiguration], default: None ) –

    Contains settings for vulnerability scans that Amazon Inspector runs against the test instance during image creation.

  • workflows (Optional[WorkflowConfigurationList], default: None ) –

    The array of workflow configuration objects for builds that this pipeline starts. You must also specify executionRole when you provide workflows.

  • logging_configuration (Optional[PipelineLoggingConfiguration], default: None ) –

    Specifies the logging configuration for the image pipeline. Use this to define custom CloudWatch Logs log groups for your pipeline execution logs and image build logs. The service manages log groups with names starting with /aws/imagebuilder/ using the service-linked role. For custom log group names outside of this prefix, you must also provide an executionRole.

  • execution_role (Optional[RoleNameOrArn], default: None ) –

    The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to perform workflow actions. If you omit this property, the pipeline reverts to the Image Builder service-linked role.

  • image_tags (Optional[TagMap], default: None ) –

    The tags that Image Builder applies to the Image Builder image resource that this pipeline's scheduled executions create. These tags don't apply to the output AMI. To tag output AMIs, use amiTags in the pipeline's distribution configuration.

Raises:

  • CallRateLimitExceededException –

    You have exceeded the permitted request rate for the Amazon EC2 APIs that Image Builder calls on your behalf. Retry with an increasing or variable delay between requests.

  • ClientException –

    A generic client error. This error usually indicates that the request failed a validation check, such as when a downstream service rejects a configured value.

  • ForbiddenException –

    You are not authorized to perform the requested operation.

  • IdempotentParameterMismatchException –

    You have specified a client token for an operation using parameter values that differ from a previous request that used the same client token.

  • InvalidRequestException –

    The request is malformed or otherwise invalid. Verify the request and try again.

  • ResourceInUseException –

    The resource that you are trying to operate on is currently in use. Review the message details and retry later.

  • ServiceException –

    An internal server error occurred while Image Builder processed the request. Retrying the request may succeed.

  • ServiceUnavailableException –

    The service is unable to process your request at this time.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

Update an image pipeline The following example changes the pipeline's schedule to build every day at 6:00 AM UTC.

>>> client.update_image_pipeline(image_pipeline_arn='arn:aws:imagebuilder:us-west-2:111122223333:image-pipeline/my-example-pipeline', image_recipe_arn='arn:aws:imagebuilder:us-west-2:111122223333:image-recipe/my-example-recipe/1.0.0', infrastructure_configuration_arn='arn:aws:imagebuilder:us-west-2:111122223333:infrastructure-configuration/my-example-infrastructure', schedule={'scheduleExpression': 'cron(0 6 * * ? *)', 'pipelineExecutionStartCondition': 'EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE'}, status='ENABLED', client_token='a1b2c3d4-5678-90ab-cdef-EXAMPLEddddd')
Source code in docs_src/capo_imagebuilder/_services/imagebuilder.py
def update_image_pipeline(
    self,
    image_pipeline_arn: "capo_imagebuilder.types.image_pipeline_arn.ImagePipelineArn",
    infrastructure_configuration_arn: "capo_imagebuilder.types.infrastructure_configuration_arn.InfrastructureConfigurationArn",
    client_token: "capo_imagebuilder.types.client_token.ClientToken",
    *,
    config_overrides: Optional[imagebuilderClientConfig] = None,
    description: Optional[
        "capo_imagebuilder.types.non_empty_string.NonEmptyString"
    ] = None,
    image_recipe_arn: Optional[
        "capo_imagebuilder.types.image_recipe_arn.ImageRecipeArn"
    ] = None,
    container_recipe_arn: Optional[
        "capo_imagebuilder.types.container_recipe_arn.ContainerRecipeArn"
    ] = None,
    distribution_configuration_arn: Optional[
        "capo_imagebuilder.types.distribution_configuration_arn.DistributionConfigurationArn"
    ] = None,
    image_tests_configuration: Optional[
        "capo_imagebuilder.types.image_tests_configuration.ImageTestsConfiguration"
    ] = None,
    enhanced_image_metadata_enabled: Optional[
        "capo_imagebuilder.types.nullable_boolean.NullableBoolean"
    ] = None,
    schedule: Optional["capo_imagebuilder.types.schedule.Schedule"] = None,
    status: Optional[
        "capo_imagebuilder.types.pipeline_status.PipelineStatus"
    ] = None,
    image_scanning_configuration: Optional[
        "capo_imagebuilder.types.image_scanning_configuration.ImageScanningConfiguration"
    ] = None,
    workflows: Optional[
        "capo_imagebuilder.types.workflow_configuration_list.WorkflowConfigurationList"
    ] = None,
    logging_configuration: Optional[
        "capo_imagebuilder.types.pipeline_logging_configuration.PipelineLoggingConfiguration"
    ] = None,
    execution_role: Optional[
        "capo_imagebuilder.types.role_name_or_arn.RoleNameOrArn"
    ] = None,
    image_tags: Optional["capo_imagebuilder.types.tag_map.TagMap"] = None,
) -> "capo_imagebuilder.types.update_image_pipeline_response.UpdateImagePipelineResponse":
    """<p>Updates an image pipeline. Use image pipelines to automate the creation and distribution of images. You must specify exactly one recipe for your image, using either a <code>containerRecipeArn</code> or an <code>imageRecipeArn</code>. The recipe must be the same type, image or container, as the pipeline's current recipe.</p> <note> <p>UpdateImagePipeline does not support selective updates. The request replaces the pipeline's entire configuration, so include every setting that you want to keep. Any optional property that you omit is removed or reset to its default.</p> </note>

    Args:
        image_pipeline_arn: <p>The Amazon Resource Name (ARN) of the image pipeline that you want to update.</p>
        description: <p>The description of the image pipeline.</p>
        image_recipe_arn: <p>The Amazon Resource Name (ARN) of the image recipe that configures images created by this image pipeline. You must specify either this property or <code>containerRecipeArn</code>, but not both.</p>
        container_recipe_arn: <p>The Amazon Resource Name (ARN) of the container recipe that is used to configure images created by this container pipeline. You must specify either this property or <code>imageRecipeArn</code>, but not both.</p>
        infrastructure_configuration_arn: <p>The Amazon Resource Name (ARN) of the infrastructure configuration that Image Builder uses to build images created by this image pipeline.</p>
        distribution_configuration_arn: <p>The Amazon Resource Name (ARN) of the distribution configuration that Image Builder uses to configure and distribute images created by this image pipeline.</p>
        image_tests_configuration: <p>Specifies the test settings that Image Builder applies to images that this pipeline creates. If you don't provide test settings, Image Builder stores a default configuration with image tests enabled.</p>
        enhanced_image_metadata_enabled: <p>Specifies whether to collect additional information about the image being created, including the operating system (OS) version and package list. Defaults to <code>true</code>.</p>
        schedule: <p>The schedule of the image pipeline. Because the update replaces the entire configuration, omitting this property removes any existing schedule. The pipeline then runs only when you call <a>StartImagePipelineExecution</a>.</p>
        status: <p>The status of the image pipeline. Defaults to <code>ENABLED</code> when omitted. To keep a pipeline disabled, include this property set to <code>DISABLED</code> in your update request.</p>
        client_token: <p>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 <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the <i>Amazon EC2 API Reference</i>.</p>
        image_scanning_configuration: <p>Contains settings for vulnerability scans that Amazon Inspector runs against the test instance during image creation.</p>
        workflows: <p>The array of workflow configuration objects for builds that this pipeline starts. You must also specify <code>executionRole</code> when you provide workflows.</p>
        logging_configuration: <p>Specifies the logging configuration for the image pipeline. Use this to define custom CloudWatch Logs log groups for your pipeline execution logs and image build logs. The service manages log groups with names starting with <code>/aws/imagebuilder/</code> using the service-linked role. For custom log group names outside of this prefix, you must also provide an <code>executionRole</code>.</p>
        execution_role: <p>The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to perform workflow actions. If you omit this property, the pipeline reverts to the Image Builder service-linked role.</p>
        image_tags: <p>The tags that Image Builder applies to the Image Builder image resource that this pipeline's scheduled executions create. These tags don't apply to the output AMI. To tag output AMIs, use <code>amiTags</code> in the pipeline's distribution configuration.</p>

    Raises:
        capo_imagebuilder.errors.call_rate_limit_exceeded_exception.CallRateLimitExceededException: <p>You have exceeded the permitted request rate for the Amazon EC2 APIs that Image Builder calls on your behalf. Retry with an increasing or variable delay between requests.</p>
        capo_imagebuilder.errors.client_exception.ClientException: <p>A generic client error. This error usually indicates that the request failed a validation check, such as when a downstream service rejects a configured value.</p>
        capo_imagebuilder.errors.forbidden_exception.ForbiddenException: <p>You are not authorized to perform the requested operation.</p>
        capo_imagebuilder.errors.idempotent_parameter_mismatch_exception.IdempotentParameterMismatchException: <p>You have specified a client token for an operation using parameter values that differ from a previous request that used the same client token.</p>
        capo_imagebuilder.errors.invalid_request_exception.InvalidRequestException: <p>The request is malformed or otherwise invalid. Verify the request and try again.</p>
        capo_imagebuilder.errors.resource_in_use_exception.ResourceInUseException: <p>The resource that you are trying to operate on is currently in use. Review the message details and retry later.</p>
        capo_imagebuilder.errors.service_exception.ServiceException: <p>An internal server error occurred while Image Builder processed the request. Retrying the request may succeed.</p>
        capo_imagebuilder.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is unable to process your request at this time.</p>
        capo_imagebuilder.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Update an image pipeline
        The following example changes the pipeline's schedule to build every day at 6:00 AM UTC.

        >>> client.update_image_pipeline(image_pipeline_arn='arn:aws:imagebuilder:us-west-2:111122223333:image-pipeline/my-example-pipeline', image_recipe_arn='arn:aws:imagebuilder:us-west-2:111122223333:image-recipe/my-example-recipe/1.0.0', infrastructure_configuration_arn='arn:aws:imagebuilder:us-west-2:111122223333:infrastructure-configuration/my-example-infrastructure', schedule={'scheduleExpression': 'cron(0 6 * * ? *)', 'pipelineExecutionStartCondition': 'EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE'}, status='ENABLED', client_token='a1b2c3d4-5678-90ab-cdef-EXAMPLEddddd')
    """

    def _handler(
        req: "OperationRequest[capo_imagebuilder.types.update_image_pipeline_request.UpdateImagePipelineRequest]",
    ) -> OperationResponse[
        "capo_imagebuilder.types.update_image_pipeline_response.UpdateImagePipelineResponse"
    ]:
        import capo_imagebuilder._operations.imagebuilder.update_image_pipeline

        output, http_response = (
            capo_imagebuilder._operations.imagebuilder.update_image_pipeline.update_image_pipeline(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateImagePipeline")
    )
    input_: capo_imagebuilder.types.update_image_pipeline_request.UpdateImagePipelineRequest = {
        "image_pipeline_arn": image_pipeline_arn,
        "infrastructure_configuration_arn": infrastructure_configuration_arn,
        "client_token": client_token,
    }
    if description is not None:
        input_["description"] = description
    if image_recipe_arn is not None:
        input_["image_recipe_arn"] = image_recipe_arn
    if container_recipe_arn is not None:
        input_["container_recipe_arn"] = container_recipe_arn
    if distribution_configuration_arn is not None:
        input_["distribution_configuration_arn"] = distribution_configuration_arn
    if image_tests_configuration is not None:
        input_["image_tests_configuration"] = image_tests_configuration
    if enhanced_image_metadata_enabled is not None:
        input_["enhanced_image_metadata_enabled"] = enhanced_image_metadata_enabled
    if schedule is not None:
        input_["schedule"] = schedule
    if status is not None:
        input_["status"] = status
    if image_scanning_configuration is not None:
        input_["image_scanning_configuration"] = image_scanning_configuration
    if workflows is not None:
        input_["workflows"] = workflows
    if logging_configuration is not None:
        input_["logging_configuration"] = logging_configuration
    if execution_role is not None:
        input_["execution_role"] = execution_role
    if image_tags is not None:
        input_["image_tags"] = image_tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output