You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

AWS CloudFormation模板无法获取ElasticBeanstalk环境EndpointURL报错

解决CloudFormation中ElasticBeanstalk环境EndpointURL属性不存在的错误

你遇到的错误是因为模板使用了AWS::Serverless-2016-10-31 Transform,该转换会修改AWS::ElasticBeanstalk::Environment资源的可用输出属性名称。

在原生CloudFormation中,AWS::ElasticBeanstalk::Environment确实有EndpointURL输出属性,但当通过Serverless Transform部署时,这个属性被重命名为Endpoint。

修复步骤

修改模板的Outputs部分,将!GetAtt environment.EndpointURL替换为!GetAtt environment.Endpoint:

Outputs:
  endpoint:
    Description: Website URL
    Value: !GetAtt environment.Endpoint
    Export:
      Name: !Join ["-", [!Ref "AWS::StackName","endpoint"]]

额外说明

如果你不需要Serverless Transform的功能(比如模板里的Lambda可以改用原生AWS::Lambda::Function定义),也可以移除模板顶部的Transform: AWS::Serverless-2016-10-31行,这样就能继续使用EndpointURL属性。但因为你的模板中包含AWS::Serverless::Function资源,保留Transform并修改属性名是更适配的方案。

内容的提问来源于stack exchange,提问作者Vitor Moraes

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.12 13:18:29