获得;cli输入json';:接收到无效的json“;
我正在尝试在AWS ECS中使用Fargate启动类型运行服务。下面是我的service-definition.json文件获得;cli输入json';:接收到无效的json“;,json,amazon-web-services,amazon-ecs,amazon-vpc,aws-fargate,Json,Amazon Web Services,Amazon Ecs,Amazon Vpc,Aws Fargate,我正在尝试在AWS ECS中使用Fargate启动类型运行服务。下面是我的service-definition.json文件 { "serviceName": "MyService", "cluster": "arn of my cluster", "launchType": "FARGATE", "deploymentConfiguration": { "maximumPercent": 200, "minimumHealthyPercent": 0 },
{
"serviceName": "MyService",
"cluster": "arn of my cluster",
"launchType": "FARGATE",
"deploymentConfiguration": {
"maximumPercent": 200,
"minimumHealthyPercent": 0
},
"desiredCount": 1,
"networkConfiguration": {
"awsvpcConfiguration": {
"assignPublicIp": "DISABLED",
"securityGroups": [
"sec-group-id"
],
"subnets": [
"subnet-1",
"subnet-2"
]
}
},
"taskDefinition": "mytask",
"loadBalancers": [
{
"containerName": "mytask-container",
"containerPort": 8080,
"targetGroupArn": "arn to my target group"
}
]
}
运行此命令时:
aws ecs创建服务--cli输入json服务定义.json。我得到无效的json错误
我已经验证了json的语法。我只是想确认这个定义在逻辑上是否“可以”工作?如果没有,欢迎更正。当您想要使用文件时,您必须为
cli输入json使用以下格式(文件://):
aws ecs create-service --cli-input-json file://service-definition.json
示例在文档中