gpt4 book ai didi

amazon-web-services - AWS 云信息 : Outputs ServiceName for Unnamed ECS Service

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

我通过cloudformation创建ECS堆栈。一切正常。由于某种原因,我在定义中没有为ECS服务指定ServiceName(名称:Service)。但是,我希望在 Cloudformation 创建堆栈后将其包含在输出中。因此,为了这个目的,我定义了这样的输出:

Outputs:
ECSServiceName:
Description: Service Name I want to see
Value: !GetAtt Service.ServiceName

当我运行更新 CF Stack 时,我收到来自 AWS 的错误:

Requested attribute ServiceName must be a readonly property in schema for AWS::ECS::Service

如果之前没有严格指定,这是否意味着我无法在输出中接收它?或者我在输出定义中的某个地方犯了错误?

最佳答案

你必须export模板中的 ECSServiceName。另外,获取ECS服务名称的正确方法是 !GetAtt Service.Name:


Outputs:
ECSServiceName:
Description: Service Name I want to see
Value: !GetAtt Service.Name
Export:
Name: ECSServiceName

然后,在其他模板中,您可以使用ImportValue引用导出的输出:

!ImportValue ECSClusterName

关于amazon-web-services - AWS 云信息 : Outputs ServiceName for Unnamed ECS Service,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65783278/

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