Deploying EBS via EB CLI fails: ERROR

0

I'm using EB CLI to launch a django project on EBS; the process produces the following error:

2024-02-24 16:35:50 ERROR Creating load balancer failed Reason: Resource handler returned message: "At least two subnets in two different Availability Zones must be specified (Service: ElasticLoadBalancingV2, Status Code: 400, Request ID: ***********)" (RequestToken: *****, HandlerErrorCode: InvalidRequest)

. . . 2024-02-24 16:37:53 ERROR Stack named 'awseb-***' aborted operation. Current state: 'CREATE_FAILED' Reason: The following resource(s) failed to create: [AWSEBV2LoadBalancer].

My ".ebextensions" has the following file:

option_settings: aws:elasticbeanstalk:container:python: WSGIPath: ****.wsgi:application

=======================

I tried to add a VPC to the "django-config" file with no result.

已提問 3 個月前檢視次數 176 次
1 個回答
2
已接受的答案

Hello.

What commands are you running with "EB CLI"?
If you are running the "eb create" command, try specifying two subnets to be used by ALB with "--vpc.elbsubnets".
Also, please select a subnet in a different availability zone.
You may find the following documentation examples helpful.
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-create.html#eb3-createexample1

eb create dev-vpc --vpc.id vpc-0ce8dd99 --vpc.elbsubnets subnet-b356d7c6,subnet-02f74b0c --vpc.ec2subnets subnet-0bb7f0cd,subnet-3b6697c1 --vpc.securitygroup sg-70cff265
profile picture
專家
已回答 3 個月前
profile picture
專家
已審閱 2 個月前
  • I followed your comment and the problem was fixed, but another error states that the "security group doesnt exist in the VPC" even though it does:

    2024-02-26 00:08:31 ERROR Failed createEnvironment activity. Reason: Configuration validation exception: Invalid option value: 'sg-0d8e69 8f62e8e529b' (Namespace: 'aws:autoscaling:launchconfiguration', OptionName: 'SecurityGroups'): The security group 'sg-0d***' does not exist in vpc 'vpc-02a*****'

    I made sure it exists in the VPC.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南