ERROR: 2.0+ Platforms require a service role. You can provide one with --service-role option

ERROR: 2.0+ Platforms require a service role. You can provide one with --service-role option

我们最近将 EB CLI 工具升级到版本 3.6.2 (Python 2.7.6)。

现在当我们启动一个新的 eb 环境时...

eb create dev-env -p "64bit Amazon Linux 2015.09 v2.0.4 running Ruby 2.2 (Puma)" --single -i t2.micro --envvars SECRET_KEY_BASE=g5dh9cg61...

...我们收到这个新错误:

EB ERROR: 2.0+ Platforms require a service role. You can provide one with --service-role option

EB CLI 现在要求您指定 Service-Role。

如果您还没有,请在此处创建一个 'aws-elasticbeanstalk-service-role' 角色:https://console.aws.amazon.com/iam/home#roles

  1. Select 'Amazon EC2' Aws 服务角色类型;
  2. 分配一项或多项权限;
  3. 更新信任关系,粘贴(例如):

    { "Version": "2012-10-17", "Statement":[ { "Sid": "", "Effect": "Allow", "Principal":{ "Service": "elasticbeanstalk.amazonaws.com" }, "Action": "sts:AssumeRole", "Condition":{ "StringEquals":{ "sts:ExternalId": "elasticbeanstalk" } } } ] }

现在,当您启动新的 EB 环境时,包括 --service-role 选项:

eb create dev-env -p "64bit Amazon Linux 2015.09 v2.0.4 running Ruby 2.2 (Puma)" --single -i t2.micro 
--service-role aws-elasticbeanstalk-service-role --envvars SECRET_KEY_BASE=g5dh9cg614a37d4bd

对于其他想知道的人,有一个更简单的选择:您可以再次 运行 eb create 且不带任何参数,eb cli 将引导您完成创建新 --service- 的步骤角色(如果你还没有)。

Note In Windows, adding an .ebignore file causes the EB CLI to follow symbolic links and include the linked file when creating a source bundle. This is a known issue and will be fixed in a future update.

参考:Config of EB Cli - Aws website