Environment failed to launch as it entered Terminated state
darkn3rd opened this issue · comments
DESCRIPTION
Create stack (using required KeyName), and after 8 minutes, run into this:
11:34:57 UTC-0700 | CREATE_FAILED | AWS::ElasticBeanstalk::Environment | ChatEnvironment | Environment failed to launch as it entered Terminated state |
---|
I don't know enough about the internals to test this locally and find out why it was terminating. Nothing in the UI is showing why/how it failed, so I don't know how to further troubleshoot and provide something useful.
Any instructions how to run NodeJS + Nginx + Redis locally? Maybe could reproduce locally.
Same here
That worked for me: amanjuman@89b6628
From AWS Support:
You need a role used in the template: aws-elasticbeanstalk-ec2-role
Role name : aws-elasticbeanstalk-ec2-role
Managed policy :
- AWSElasticBeanstalkWebTier
- AWSElasticBeanstalkMulticontainerDocker
- AWSElasticBeanstalkWorkerTier
That worked for me.
Thanks @cfcraspi for the help. Here is the cloudformation template which worked just fine for me after long time fixing the issue.
Below is the EB environment i required for my docker application. Replace ApplicationName and EnvironmentName with your choice.
Resources:
RestApplication:
Type: AWS::ElasticBeanstalk::Application
Properties:
ApplicationName: ${self:provider.environment.RESTAPP_NAME}
RestAppDockerEnvironment:
Type: AWS::ElasticBeanstalk::Environment
Properties:
EnvironmentName: ${self:provider.environment.RESTAPP_ENVIRONMENT_NAME}
ApplicationName:
Ref: RestApplication
SolutionStackName: "64bit Amazon Linux 2 v3.1.2 running Docker"
OptionSettings:
- Namespace: aws:elasticbeanstalk:environment
OptionName: EnvironmentType
Value: SingleInstance
- Namespace: aws:autoscaling:launchconfiguration
OptionName: IamInstanceProfile
Value: aws-elasticbeanstalk-ec2-role
- Namespace: aws:elasticbeanstalk:environment
OptionName: ServiceRole
Value: aws-elasticbeanstalk-service-role
thank you this helped me a lot
I have added following lines in clodformatoin
- Namespace: aws:autoscaling:launchconfiguration
OptionName: IamInstanceProfile
Value: aws-elasticbeanstalk-ec2-role
- Namespace: aws:elasticbeanstalk:environment
OptionName: ServiceRole
Value: aws-elasticbeanstalk-service-role
Thanks @cfcraspi for the help. Here is the cloudformation template which worked just fine for me after long time fixing the issue.
Below is the EB environment i required for my docker application. Replace ApplicationName and EnvironmentName with your choice.
Resources: RestApplication: Type: AWS::ElasticBeanstalk::Application Properties: ApplicationName: ${self:provider.environment.RESTAPP_NAME} RestAppDockerEnvironment: Type: AWS::ElasticBeanstalk::Environment Properties: EnvironmentName: ${self:provider.environment.RESTAPP_ENVIRONMENT_NAME} ApplicationName: Ref: RestApplication SolutionStackName: "64bit Amazon Linux 2 v3.1.2 running Docker" OptionSettings: - Namespace: aws:elasticbeanstalk:environment OptionName: EnvironmentType Value: SingleInstance - Namespace: aws:autoscaling:launchconfiguration OptionName: IamInstanceProfile Value: aws-elasticbeanstalk-ec2-role - Namespace: aws:elasticbeanstalk:environment OptionName: ServiceRole Value: aws-elasticbeanstalk-service-role
thanks this one helps me a lot.
Welcome @Uditmartyn