I want to troubleshoot environment operation failures in AWS Elastic Beanstalk because of an AWS CloudFormation stack that's in a non-operational state.
Short description
Elastic Beanstalk creates an CloudFormation stack to manage the resources that are associated with the Elastic Beanstalk environment. You can check this stack in the CloudFormation console with the stack name awseb-envID-stack.
When the Elastic Beanstalk environment enters a non-operational state, the CloudFormation stack shows a FAILED status. You also receive the following error message:
"The stack stack_id associated with environment environment-ID is in stack-status state."
Resolution
Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're using the most recent AWS CLI version.
To change your Elastic Beanstalk environment to an operational state, use the following table to take actions depending on your CloudFormation stack status:
| | |
|---|
| CloudFormation stack status | CloudFormation action | Elastic Beanstalk action |
| CREATE_FAILED | None | Run the Rebuild environment or Terminate environment operations. |
| UPDATE_ROLLBACK_FAILED | Bring the stack to a UPDATE_ROLLBACK_COMPLETE status. | Retry the operation. |
| DELETE_FAILED | Bring the stack to a DELETE_COMPLETE status. | Retry the operation. |
| UPDATE_ROLLBACK_COMPLETE | None | Retry the operation. |
| UPDATE_COMPLETE | None | If the stack's previous state was CREATE_FAILED, then run the Rebuild or Terminate operation. Otherwise, retry the operation. |
| DELETE_COMPLETE | None | Retry the operation. |
| ROLLBACK_COMPLETE | None | Run the Rebuild environment or Terminate environment operations. |
If your CloudFormation stack has a FAILED status, then use one of the following resolutions.
CREATE_FAILED status
When the stack has a CREATE_FAILED status, the environment can't recover. The environment continues to have issues, even if the stack status changes to UPDATE_COMPLETE. If your stack has the CREATE_FAILED status, then you must create a new Elastic Beanstalk environment.
To recreate the environment, select one of the following options:
UPDATE_ROLLBACK_FAILED status
To change the Elastic Beanstalk environment to an operational state, complete the following steps:
- Open the CloudFormation console.
- Identify the resource that failed to update during the rollback from the stack event, and then address the failure.
- Change the stack to the UPDATE_ROLLBACK_COMPLETE status. To do so, perform an update rollback in the CloudFormation console.
- In the Continue update rollback dialog box, expand Advanced troubleshooting.
- In the Resources to skip - optional section, select the resource that failed to update.
- Choose Continue update rollback. The stack now shows the UPDATE_ROLLBACK_COMPLETE status.
- Retry the operation that returned the error.
DELETE_FAILED status
To change the Elastic Beanstalk environment to an operational state, complete the following steps:
- Open the CloudFormation console.
- Identify the resource that failed to delete during the stack event.
- Manually delete the resource. For example, if the resource is a security group, then delete the security group from the Amazon Elastic Compute Cloud (Amazon EC2) console.
- Delete the CloudFormation stack from the CloudFormation console. The deleted stack shows a DELETE_COMPLETE status.
- Retry the Terminate environment or Rebuild environment operations.
For more information, see How do I terminate or rebuild my Elastic Beanstalk environment when the AWSEBSecurityGroup fails to delete?
Related information
Recovering your Elastic Beanstalk environment from an invalid state