aws-samples / elasticache-refarch-chatapp

Example architecture for building a chat application using ElastiCache for Redis.
Apache License 2.0
151 stars 71 forks source link

Environment failed to launch as it entered Terminated state #5

Open darkn3rd opened 6 years ago

darkn3rd commented 6 years ago

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.

janlukasschroeder commented 6 years ago

Same here

janlukasschroeder commented 6 years ago

That worked for me: https://github.com/amanjuman/elasticache-refarch-chatapp/commit/89b662869fcebb13041d3970eedadda954431b59

cfcraspi commented 5 years ago

From AWS Support: You need a role used in the template: aws-elasticbeanstalk-ec2-role

Role name : aws-elasticbeanstalk-ec2-role Managed policy :

That worked for me.

saumilsdk commented 4 years ago

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
madankumar-t commented 3 years ago

thank you this helped me a lot

madankumar-t commented 3 years ago

I have added following lines in clodformatoin

Uditmartyn commented 3 years ago

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.

saumilsdk commented 3 years ago

Welcome @Uditmartyn