I want to troubleshoot environment operation failures in AWS Elastic Beanstalk due to 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, and you 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 bring your Elastic Beanstalk environment to an operational state, perform the actions associated with your CloudFormation stack status in the following table:
| | |
---|
CloudFormation stack status | CloudFormation action | Elastic Beanstalk action |
CREATE_FAILED | None | Run the Rebuild environment or Terminate environment operations |
UDPATE_ROLLBACK_FAILED | Bring stack to UPDATE_ROLLBACK_COMPLETE status | Retry the operation |
DELETE_FAILED | Bring stack to 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 choose one of the following resolutions.
CREATE_FAILED status
When the stack has a CREATE_FAILED status, the environment can't recover. The environment will continue 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.
Choose one of the following options to recreate the environment:
If you still can't create a new environment, then complete the following steps:
- Address the root cause of the stack failure, if there's an issue that prevents the creation of a new environment.
- Create a new environment. To do so, terminate the current environment, and then perform the CreateEnvironment operation again. Or, rebuild the environment through the console or run the rebuild-environment command.
UPDATE_ROLLBACK_FAILED status
To bring 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 respective stack event, and then address the failure.
- Bring the stack to the UPDATE_ROLLBACK_COMPLETE status. To do so, choose the Continue update rollback option 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 bring 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 respective 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?