ECS CFT错误:遇到不受支持的属性链接

时间:2018-03-27 18:59:15

标签: amazon-web-services docker amazon-cloudformation amazon-ecs

我正在尝试创建一个在同一网络中运行2个容器的ECS任务。我试图将我的cft更新为以下内容:

"EcsTask": {
        "Type": "AWS::ECS::TaskDefinition",
        "Properties": {
            "Family": "...",
            "NetworkMode": "bridge",
            "ContainerDefinitions": [
                {
                    "Name": "exampleA",
                    "Essential": "true",
                    "Image": "...",
                    "PortMappings": [
                        {
                            "HostPort": 8000,
                            "ContainerPort": 8000,
                            "Protocol": "tcp"
                        }
                    ],
                    "links": ["exampleB"],
                    "MemoryReservation": 256
                },
                {
                    "Name": "exampleB",
                    "Essential": "true",
                    "Image": "...",
                    "MemoryReservation": 256
                }
            ],
            "TaskRoleArn": "..."
        }
    }

但我遇到错误 UPDATE_FAILED遇到不支持的属性链接。这是在ECS上在同一网络中创建两个容器的正确方法吗?

1 个答案:

答案 0 :(得分:0)

你的teamplate中只有一个小错字。该属性需要调用Links而不是links: - )

查看documentation了解详情

(如果您仔细阅读了错误消息,那么您将自己解决此问题)