Unable to terminate elastic beanstalk environment

0

I deployed beanstalc env and application with terraform to eu-central-1 (Frankfurt). I can't delete it. I tried both Deletion failed with this log:

ERROR	A Service Role is required in this region. Please add a Service Role option to the environment. Refer to the Elastic Beanstalk documentation for more information.
INFO	Finished validating environment's EC2 instances for termination protection.
INFO	Validating environment's EC2 instances have termination protection disabled before performing termination.
INFO	terminateEnvironment is starting.

I'm not sure what's about region. Aren't service roles global?

After multiple attemps to fix permissions (including admin roles), recreate service roles (both customizable and default) etc. I finally decided to "Rebuild environment". Now it fails with following error:

ERROR	You must specify an Instance Profile for your EC2 instance in this region. See [Managing Elastic Beanstalk Instance Profiles](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/iam-instanceprofile.html) for more information.
INFO	Finished validating environment's EC2 instances for termination protection.
INFO	Validating environment's EC2 instances have termination protection disabled before performing termination.
INFO	terminateEnvironment is starting.

I created new role as instructed in the log message, but this error keeps showing.

How can I terminate the environment?

EDIT: I can't add "EC2 instance role" in Environment -> Configuration -> Configure service access due to "Environment named <some-name> is in an invalid state for this operation. Must be Ready". But cli command

aws elasticbeanstalk describe-environments

returns ""Status": "Ready""

Michal
질문됨 6달 전215회 조회
1개 답변
0

Hello.

Isn't termination protection set on EC2?
If it is set, try removing it.

Finished validating environment's EC2 instances for termination protection.
Validating environment's EC2 instances have termination protection disabled before performing termination.

Please check the following document for information on configuring termination protection for EC2.
https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/terminating-instances.html#Using_ChangingDisableAPITermination

Also, CloudFormation is running behind the scenes in Elastic Beanstalk, so if the CloudFormation status is "CREATE_FAILED", the following error may occur.
Therefore, you can understand better by checking which resource creation caused the problem from the CloudFormation console.

Environment named <some-name> is in an invalid state for this operation. Must be Ready

It may also be possible to delete the stack directly from the CloudFormation console.
https://repost.aws/knowledge-center/elastic-beanstalk-deletion-failure

profile picture
전문가
답변함 6달 전
  • Thanks for your suggestions. Unfortunately, there are no EC2 instances nor a CloudFormation environment. No application was ever deployed to this environment. Is there something else worth checking?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠