gpt4 book ai didi

amazon-web-services - AWS ECS : Severe bug in ECS Service Cloudformation template

转载 作者:行者123 更新时间:2023-12-03 07:18:19 25 4
gpt4 key购买 nike

尝试通过以下具有适当导入的 list 使用 cloudformation 创建 ECS 服务

 UIService:
Type: AWS::ECS::Service
Properties:
Cluster: !ImportValue ECSClusterName
DesiredCount: 1
LaunchType: EC2
LoadBalancers:
- ContainerName: !ImportValue UIContainerName
ContainerPort: '80'
TargetGroupArn: !ImportValue UITGArn
ServiceName: ui-service
ServiceRegistries:
- RegistryArn: arn:aws:servicediscovery:eu-west-1:944094092130:service/srv-oIclu40KCKM3esez7
TaskDefinition: !ImportValue UITaskArn

此操作失败并显示以下消息:

When specifying 'host' or 'bridge' for networkMode, values for 'containerName' and 'containerPort' must be specified from the task definition.

但是,当我添加所需的值时(在 serviceregistry 属性中,它让我假设需要它们?)

  UIService:
Type: AWS::ECS::Service
Properties:
Cluster: !ImportValue ECSClusterName
DesiredCount: 1
LaunchType: EC2
LoadBalancers:
- ContainerName: !ImportValue UIContainerName
ContainerPort: '80'
TargetGroupArn: !ImportValue UITGArn
ServiceName: ui-service
ServiceRegistries:
- RegistryArn: arn:aws:servicediscovery:eu-west-1:944094092130:service/srv-oIclu40KCKM3esez7
ContainerName: !ImportValue UIContainerName
ContainerPort: '80'
TaskDefinition: !ImportValue UITaskArn

...我遇到以下失败:

Encountered unsupported property ContainerName

最佳答案

这是 AWS 的一个错误,其中 cloudformation 目前不支持 containerNamecontainerPort 属性。这里是官方docs对于 ServiceRegistry,这里是 docs用于云形成。如果我没记错的话,当服务发现发布时,它只支持awsvpc网络模式,bridge/host是后来添加的。它解释了为什么我们会出现这样的差异。

目前,您可以创建基本的 ECS 云信息,并使用 CLI/API/SDK 进行相应更新,或者您可以等待一段时间,以便 AWS 团队添加对此的支持。

更新:根据此 new feature (于 2018 年 9 月 24 日推出),现在您可以在 Service Registry 中指定 containerNamecontainerPort .

关于amazon-web-services - AWS ECS : Severe bug in ECS Service Cloudformation template,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52270322/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com