ElasticBeanstalkに限った話ではないですが、トレーニング不足だとエラーに遭遇しやすいです。
遭遇したものの対処方法をいくつか記載します。
証明書エラー
ERROR Creating Load Balancer listener failed Reason: Resource handler returned message: "The certificate 'arn:aws:acm:ap-northeast-1:123456789012:certificate/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' must have a fully-qualified domain name, a supported signature, and a supported key size. (Service: ElasticLoadBalancingV2, Status Code: 400, Request ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)" (RequestToken: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, HandlerErrorCode: InvalidRequest)
ERROR Stack named 'awseb-x-xxxxxxxxxx-stack' aborted operation. Current state: 'CREATE_FAILED' Reason: The following resource(s) failed to create: [AWSEBV2LoadBalancerListener443].
原因
発行前のSSL証明書をアタッチして443ポートのリスナーを追加したためでした。
対応
リスナーを削除しようとしましたが、不正な状態になると設定変更ができないようでした。
仕方がないので構成を削除してから再作成すると回避しました。
VPCエラー
WARN Environment health has transitioned from Pending to Severe. ELB processes ar
ERROR Stack named 'awseb-e-km6mb5kc3j-stack' aborted operation. Current state: 'CREATE_FAILED' Reason: The following resource(s) failed to create: [AWSEBInstanceLaunchWaitCondition].
ERROR The EC2 instances failed to communicate with AWS Elastic Beanstalk, either because of configuration problems with the VPC or a failed EC2 instance. Check your VPC configuration and try launching the environment again.
INFO Launched environment: jp-kinako-production. However, there were issues during launch. See event log for details.
原因
アプリケーションコードが不正なものが指定されていたためでした。
対応
構成を一旦削除してから正しいアプリケーションコードを指定したところクリアしました。
補足
今回は非該当でしたが本来はVPCに問題があるケースの方が多いと思います。
下記を調べましたがどれも該当せずエラー文言と異なるため解析に時間がかかりました。。
- https://repost.aws/ja/knowledge-center/elastic-beanstalk-instance-failure
- https://blog.ottijp.com/2022/02/11/eb-error/
以上です。
誰かのお役に立てれば幸いです。