简体   繁体   English

通过Cloudformation模板创建RDS Opsworks层

[英]Create an RDS Opsworks Layer by a Cloudformation template

I'm making a CloudFormation template that creates an opsworks stack, layers and few applications. 我正在制作一个CloudFormation模板,该模板创建一个opsworks堆栈,层和少量应用程序。 Within my layers, I have opsworks ones and RDS ones. 在我的图层中,我有opsworks和RDS。 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: 在AWS文档中,只有如何创建Opsworks::Layer但我不知道如何制作Amazon RDS服务层:

在此处输入图片说明

{
  "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, ... ]
  }
}

My aim is to automate the creation of my opsworks resources by cloudformation. 我的目标是通过cloudformation自动创建opsworks资源。 Any idea how to do this ? 任何想法如何做到这一点? Thank you 谢谢

Learning more on cfn-init would be my best bet. 了解更多关于cfn-init的信息是我最好的选择。 Hope this helps you out 希望可以帮助您

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. 不幸的是,根据截至2015年12月9日的Richard @ AWS的说法,未通过官方CloudFormation资源实现将RDS实例注册为OpsWorks服务层的RegisterRdsDbInstance API ,并且没有计划的计划。

You can contact AWS to request adding this to their roadmap, but in the meantime here are some alternatives you can try: 您可以联系AWS请求将其添加到他们的路线图中,但是与此同时,您可以尝试以下替代方法:

  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. 从CloudFormation模板创建RDS实例和其余的OpsWorks堆栈,然后使用AWS控制台,AWS CLI或任何其他平台的AWS开发工具包将RDS服务层手动附加到OpsWorks堆栈。
  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 . AWS OpsWorks模板代码片段中所述,使用运行在EC2实例上的自管理数据库实例层,该实例使用带有db-master TypeAWS::OpsWorks::Layer
  3. Create a Custom CloudFormation Resource that performs the RegisterRdsDbInstance API call, eg, using a Lambda function and the NodeJS AWS SDK. 创建一个自定义CloudFormation资源 ,以执行RegisterRdsDbInstance API调用,例如,使用Lambda函数和NodeJS AWS开发工具包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM