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.

1 Antwort
2
Akzeptierte Antwort

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
EXPERTE
beantwortet vor 3 Monaten
profile picture
EXPERTE
überprüft vor 2 Monaten
  • 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.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen