ruby-on-rails - 云形成中 "Rails App Server"的类型是什么?

标签 ruby-on-rails amazon-web-services aws-cloudformation aws-opsworks

我正在使用云形成创建 AWS OpsWorks 堆栈。

文档指出要设置图层类型的“AWS::OpsWorks::Layer”属性“Type”值。

来自AWS::OpsWorks::Layer :

Type The layer type. A stack cannot have more than one layer of the same type, except for the custom type. You can have any number of custom types. For more information, see CreateLayer in the AWS OpsWorks API Reference.

Important If you update a property that requires the layer to be replaced, you must specify a new type unless you have a custom type. You can have any number of custom types.

Required: Yes

Type: String

但是,这并没有列出任何名称。

在教程中我看到:

MySQL: "db-master"
PHP App Server: "php-app"

有完整的列表吗?

以及用于配置它们的属性列表?

最佳答案

我找到了答案,我认为它对于任何类型的 OpsWorks 堆栈来说都是一个很好的解决方案:

首先在 OpsWorks 中创建您想要的堆栈类型。设置它,完全根据需要部署您的应用程序,然后使用 AWS CLI以 JSON 格式描述堆栈、层、实例和应用程序的工具。

例如:

$ aws opsworks --region us-east-1 describe-stacks
$ aws opsworks --region us-east-1 describe-layers --stack-id <stack-id>
$ aws opsworks --region us-east-1 describe-instances --stack-id <stack-id>
$ aws opsworks --region us-east-1 describe-apps --stack-id <stack-id>

这些值将位于 JSON 中,您可以将其用作您自己的 Cloudformation OpsWorks 模板的基础。

专门针对我有关 Rails 的问题,这是我的 Rails 应用程序层的样子:

"RailsLayer": {
  "Type": "AWS::OpsWorks::Layer",
  "DependsOn": "App",
  "Properties": {
    "StackId": {"Ref": "Stack"},
    "Type": "rails-app",
    "Name": "Rails App Server", 
    "Shortname": "rails-app", 
    "Packages": [
        "imagemagick"
    ], 
    "EnableAutoHealing": true, 
    "AutoAssignElasticIps": false, 
    "AutoAssignPublicIps": true,
    "Attributes": {
        "RailsStack": "apache_passenger", 
        "RubyVersion": "2.1", 
        "BundlerVersion": "1.5.3", 
        "PassengerVersion": "4.0.46", 
        "ManageBundler": "true", 
        "RubygemsVersion": "2.3.0"
    }, 
  }

关于ruby-on-rails - 云形成中 "Rails App Server"的类型是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36884396/

相关文章:

ruby-on-rails - 在 RubyOnRails 应用程序中实现 25K 并发连接

ruby-on-rails - TimeCop 在生产中基于每个请求

php - 亚马逊 s3 存储桶上传图像 curl 异常 'data rewind wasn' t 可能 '

python - 在 Python 的 boto.cfg 中获取凭证文件

python - 需要将 lambda 函数(python)加入 YAML 中的 CloudFormation 模板,我怎样才能实现这一点?

amazon-web-services - 如何在监听器规则上创建多个条件

ruby-on-rails - Nginx + Phusion 乘客 try_files

ruby-on-rails - 将数组或参数传递给 Rails 中的 hstore 范围时出错

css - 是否可以在 ec2 实例中使用 css

amazon-web-services - 运行状况检查失败,代码为 : [502] - Cloudformation