Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services 任务定义不支持启动类型FARGATE_Amazon Web Services_Aws Cli_Amazon Ecs - Fatal编程技术网

Amazon web services 任务定义不支持启动类型FARGATE

Amazon web services 任务定义不支持启动类型FARGATE,amazon-web-services,aws-cli,amazon-ecs,Amazon Web Services,Aws Cli,Amazon Ecs,我有一个在AWS ECS中运行的Fargate应用程序,我正试图通过AWS CLI(AWS CLI/1.16.96 Python/2.7.15 Darwin/18.0.0 botocore/1.12.86)对其进行更新 我已经成功构建并推送了映像,并创建了一个新的任务定义版本 当我尝试使用以下命令更新服务时: aws ecs update-service --cluster cluster-winquest-qa --service container-qa-ge-servi

我有一个在AWS ECS中运行的Fargate应用程序,我正试图通过AWS CLI(AWS CLI/1.16.96 Python/2.7.15 Darwin/18.0.0 botocore/1.12.86)对其进行更新

我已经成功构建并推送了映像,并创建了一个新的任务定义版本

当我尝试使用以下命令更新服务时:

aws ecs update-service 
    --cluster cluster-winquest-qa 
    --service container-qa-ge-service 
    --desired-count 0
抛出以下错误消息:

An error occurred (InvalidParameterException) when calling the UpdateService operation: Task definition does not support launch_type FARGATE
然后我尝试将--launch type“FARGATE”添加到上述命令中,生成以下命令:

aws ecs update-service 
    --cluster cluster-qa 
    --service container-service 
    --task-definition first-run-task-definition:5 
    --platform-version "LATEST" 
    --launch-type "FARGATE"  
    --desired-count 1
它抛出:
未知选项:--发射类型,远门


我知道错误消息称Fargate应用程序不支持任务定义,但我想知道如何使用AWS CLI将服务更新到最新的任务定义版本。我将感谢任何帮助。谢谢。

如果您查看ecs命令行参考
更新服务
不支持
--启动类型
标志。它不支持此标志的原因是您正在尝试更新已创建的服务。您只能在运行
create service
()时指定启动类型

出现第一个错误的原因可能是您没有使用AWS Fargate支持的群集类型创建群集。您使用的是
--平台版本
标志,该标志仅用于Fargate类型的集群(在AWS文档中提到)


此外,为了让您的服务使用最新的任务定义,您不能简单地使用
--task definition
标志,因为默认情况下,如果未指定修订,它将使用最新的活动修订。

我解决了它。问题是我如何创建任务定义的新版本,在那里我必须配置
requirecompatibility
param来指定它

我用了这个文件:

aws ecs update-service 
    --cluster cluster-qa 
    --service container-service 
    --task-definition first-run-task-definition:5 
    --platform-version "LATEST" 
    --launch-type "FARGATE"  
    --desired-count 1