AWS EB:未解决的资源依赖关系 [英] AWS EB: Unresolved resource dependencies

查看:96
本文介绍了AWS EB:未解决的资源依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

感谢以下精彩文章,我的Django应用已部署并正常运行:

My Django app is deployed and working thanks to this fantastic article: https://medium.com/@justaboutcloud/how-to-deploy-a-django3-application-on-elastic-beanstalk-python3-7-and-amazon-linux-2-bd9b8447b55

我到了项目的最后,正在设置HTTPS.为此,我在.ebextensions文件夹中创建了一个名为02_https.config

I'm to the end of the project and am setting up HTTPS. To do that, I've created a config file in my .ebextensions folder called 02_https.config

在此文件中,我复制并粘贴了文章中的代码:

In this file, I copy and pasted the code from the article:

option_settings:
  aws:elbv2:listener:443:
    SSLCertificateArns: <YourACMCertificateARN>
    Protocol: HTTPS
Resources:
    AWSEBV2LoadBalancerListener:
      Type: 'AWS::ElasticLoadBalancingV2::Listener'
      Properties:
        LoadBalancerArn: { "Ref" : "AWSEBV2LoadBalancer" }
        DefaultActions:
          - RedirectConfig:
              Port: 443
              Protocol: HTTPS
              StatusCode: HTTP_301
            Type: redirect
        Port: 80
        Protocol: HTTP

部署应用程序时,出现以下错误消息:

When I deploy the app, I get this error message:

Service:AmazonCloudFormation, Message:Template format error: Unresolved resource dependencies [AWSEBV2LoadBalancer] in the Resources block of the template

我有两种理论:

  1. 我没有以正确的格式粘贴ARN证书,这不符合我的YAML格式

  1. I'm not pasting the ARN Certificate in the correct format, which is throwing off my YAML formatting

此代码的格式存在问题.

There is something wrong about this code's formatting.

有人可以提供一些输入吗?

Could someone please provide some input?

推荐答案

对我来说,由于多种原因,您的理论似乎都不适合您收到的错误.

To me, none of your theory seems to be correct for the error you're receiving due to a couple of reasons.

首先,让我们仔细阅读错误.

First of all, let's read the error carefully.

Service:AmazonCloudFormation, Message:Template format error: Unresolved resource dependencies [AWSEBV2LoadBalancer] in the Resources block of the template

支持EB环境的CFN堆栈抱怨未解决的依赖性"AWSEBV2LoadBalancer".这意味着正在创建的堆栈不知道此逻辑ID"AWSEBV2LoadBalancer"的用途.

The CFN stack backing the EB environment complaining about the unresolved dependency "AWSEBV2LoadBalancer". This means that the stack being created doesn't know what this logical id "AWSEBV2LoadBalancer" is for.

仅当您的beantalk应用程序为以下任一情况时,这种情况才会发生:

This can only happen if your beanstalk application is either:

单个实例应用程序(无LB)

A single instance application (no LB)

使用EL CFN堆栈中逻辑ID为"AWSEBLoadBalancer"而不是"AWSEBV2LoadBalancer"的ELB(经典V1 LB).

Using ELB (classic V1 LB) whose logical id in EB CFN stack is "AWSEBLoadBalancer" and not "AWSEBV2LoadBalancer".

后来的"AWSEBV2LoadBalancer"被用作应用程序和网络LB的逻辑ID.

The later "AWSEBV2LoadBalancer" is being used as logical id for application and network LBs.

从您共享的中篇文章链接中,我看到作者使用应用程序负载平衡器创建了他的环境.你错过了吗?

From the medium article link you shared, I see that the author created his environment with application load balancer. Did you miss this?

eb create django3 --elb-type application --region eu-west-1 

您共享的代码段也是有效的YAML.

Also the code snippet you shared is a valid YAML.

这篇关于AWS EB:未解决的资源依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆