本文介绍了环境无法启动,因为它进入终止状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
安装
Serverless.com框架
目标
通过无服务器创建AWS弹性豆茎槽
代码
serverless.yml
service: aws-beanstalk-sls
description: Test stack deployment 😀
provider:
name: aws
stage: running
region: eu-central-1
profile: beanstalk-test-deployment
resources:
Resources:
sampleApplication:
Type: AWS::ElasticBeanstalk::Application
Properties:
Description: AWS Elastic Beanstalk Sample Application
sampleApplicationVersion:
Type: AWS::ElasticBeanstalk::ApplicationVersion
Properties:
ApplicationName:
Ref: sampleApplication
Description: AWS ElasticBeanstalk Sample Application Version
SourceBundle:
S3Bucket: elasticbeanstalk-samples-eu-central-1
S3Key: nodejs-sample.zip
sampleConfigurationTemplate:
Type: AWS::ElasticBeanstalk::ConfigurationTemplate
Properties:
SolutionStackName: 64bit Amazon Linux 2018.03 v4.7.0 running Node.js
Description: AWS ElasticBeanstalk Sample Configuration Template
ApplicationName:
Ref: sampleApplication
OptionSettings:
- Namespace: aws:autoscaling:asg
OptionName: MinSize
Value: '2'
- Namespace: aws:autoscaling:asg
OptionName: MaxSize
Value: '6'
- Namespace: aws:elasticbeanstalk:environment
OptionName: EnvironmentType
Value: LoadBalanced
sampleEnvironment:
Type: AWS::ElasticBeanstalk::Environment
Properties:
ApplicationName:
Ref: sampleApplication
Description: AWS ElasticBeanstalk Sample Environment
TemplateName:
Ref: sampleConfigurationTemplate
VersionLabel:
Ref: sampleApplicationVersion
错误
出现错误:sampleEnvironment-Environment无法启动,因为它进入了终止状态。
注意:
配置文件beanstak-test-部署已具有IAM角色:
- AWSElasticBeanstalkFullAccess
- 管理员访问
推荐答案
您需要创建aws::iam::InstanceProfile aws::iam::InstanceProfile并在sampleConfigurationTemplate的选项设置中提供它 角色可以使用以下托管策略Arn: 如果添加此角色无济于事,则该错误还可能指示.eb扩展失败。我曾经在ebExpanses中调用了一个不存在的KeyName,从而得到了这个错误。 这篇关于环境无法启动,因为它进入终止状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!- Namespace: aws:autoscaling:launchconfiguration
OptionName: IamInstanceProfile
Value: aws-elasticbeanstalk-ec2-role
- arn:aws:iam::aws:policy/AWSElasticBeanstalkWebTier
- arn:aws:iam::aws:policy/AWSElasticBeanstalkWorkerTier
- arn:aws:iam::aws:policy/AWSElasticBeanstalkMulticontainerDocker