本文介绍了通过Cloudformation模板创建RDS Opsworks层的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个CloudFormation模板,该模板创建一个opsworks堆栈,层和少量应用程序.在我的层中,我有opsworks层和RDS层.在AWS文档中,只有如何创建Opsworks::Layer,但我不知道如何创建Amazon RDS服务层:

I'm making a CloudFormation template that creates an opsworks stack, layers and few applications. Within my layers, I have opsworks ones and RDS ones. In the AWS documentation, there is only how to create Opsworks::Layer but I don't know how to make an Amazon RDS service layer:

{
  "Type": "AWS::OpsWorks::Layer",
  "Properties": {
    "Attributes" : { String:String },
    "AutoAssignElasticIps" : Boolean,
    "AutoAssignPublicIps" : Boolean,
    "CustomInstanceProfileArn" : String,
    "CustomJson" : JSON object,
    "CustomRecipes" : Recipes,
    "CustomSecurityGroupIds" :  [ String, ... ],
    "EnableAutoHealing" : Boolean,
    "InstallUpdatesOnBoot" : Boolean,
    "LifecycleEventConfiguration" : LifeCycleEventConfiguration,
    "LoadBasedAutoScaling" : LoadBasedAutoScaling,
    "Name" : String,
    "Packages" : [ String, ... ],
    "Shortname" : String,
    "StackId" : String,
    "Type" : String,
    "VolumeConfigurations" : [ VolumeConfiguration, ... ]
  }
}

我的目标是通过cloudformation自动化创建opsworks资源.任何想法如何做到这一点?谢谢

My aim is to automate the creation of my opsworks resources by cloudformation.Any idea how to do this ?Thank you

推荐答案

不幸的是,根据 Richard @ AWS,截至2015年12月9日将RDS实例注册为OpsWorks服务层的API 并未通过官方CloudFormation资源实现,并且没有计划的计划.

Unfortunately, according to Richard@AWS as of Dec 9 2015, the RegisterRdsDbInstance API which registers an RDS instance as an OpsWorks service layer is not implemented through an official CloudFormation resource, and there are no scheduled plans to do so.

您可以联系AWS要求将其添加到他们的路线图中,但是与此同时,您可以尝试以下替代方法:

You can contact AWS to request adding this to their roadmap, but in the meantime here are some alternatives you can try:

  1. 从CloudFormation模板创建RDS实例和OpsWorks堆栈的其余部分,然后使用AWS控制台,AWS CLI或任何其他平台的AWS开发工具包将RDS服务层手动附加到OpsWorks堆栈.
  2. 使用 AWS::OpsWorks::Layer Type (来自db-master),如 AWS OpsWorks模板代码段.
  3. 创建自定义CloudFormation资源可以执行RegisterRdsDbInstance API调用,例如使用Lambda函数和NodeJS AWS SDK.
  1. Create your RDS instance and the rest of your OpsWorks stack from a CloudFormation template, then manually attach the RDS service layer to the OpsWorks stack using the AWS Console, AWS CLI, or any another platform's AWS SDK.
  2. Use a self-managed database instance layer running on an EC2 instance using an AWS::OpsWorks::Layer with a Type of db-master, as described in the AWS OpsWorks Template Snippet.
  3. Create a Custom CloudFormation Resource that performs the RegisterRdsDbInstance API call, e.g., using a Lambda function and the NodeJS AWS SDK.

这篇关于通过Cloudformation模板创建RDS Opsworks层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 03:29