本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
从中更新容器镜像管道 AWS CLI
可以使用 JSON 文件作为 AWS CLI中 update-image-pipeline
-
要更新的映像管道
-
容器配方
-
基础设施配置
-
分配设置(如果包含在当前管道中)
注意
如果包含分配设置资源,则在运行命令的区域(区域 1)的分配设置中指定为目标存储库的 ECR 存储库优先级将高于容器配方中指定的目标存储库。
按照以下步骤使用 AWS CLI中的 update-image-pipeline 命令更新容器映像管道:
注意
UpdateImagePipeline 不支持对管道进行选择性更新。您必须在更新请求中指定所有必需的属性,而不仅仅是已更改的属性。
-
创建 CLI 输入 JSON 文件
使用您常用的文件编辑工具创建 JSON 文件,其中包含以下密钥以及对您的环境有效的值。此示例使用名为
create-component.json
的文件:{ "imagePipelineArn": "arn:aws:imagebuilder:us-west-
2:123456789012
:image-pipeline/my-example-pipeline
", "containerRecipeArn": "arn:aws:imagebuilder:us-west-2:123456789012
:container-recipe/my-example-recipe
/2020.12.08", "infrastructureConfigurationArn": "arn:aws:imagebuilder:us-west-2:123456789012
:infrastructure-configuration/my-example-infrastructure-configuration
", "distributionConfigurationArn": "arn:aws:imagebuilder:us-west-2:123456789012
:distribution-configuration/my-example-distribution-configuration
", "imageTestsConfiguration": { "imageTestsEnabled": true, "timeoutMinutes": 120 }, "schedule": { "scheduleExpression": "cron(0 0 * * MON *)", "pipelineExecutionStartCondition": "EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE" }, "status": "DISABLED" }注意
-
JSON 文件路径开头必须包含
file://
符号。 -
JSON 文件的路径应遵循运行命令的基本操作系统的相应约定。例如,Windows 使用反斜杠 (\) 引用目录路径,而 Linux 和 macOS 使用正斜杠 (/)。
-
-
使用创建的文件作为输入,运行以下命令。
aws imagebuilder update-image-pipeline --cli-input-json file://
update-image-pipeline.json