问题描述
我正在制作一个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:
- 从CloudFormation模板创建RDS实例和OpsWorks堆栈的其余部分,然后使用AWS控制台,AWS CLI或任何其他平台的AWS开发工具包将RDS服务层手动附加到OpsWorks堆栈.
- 使用
AWS::OpsWorks::Layer
和Type
(来自db-master
),如 AWS OpsWorks模板代码段. - 创建自定义CloudFormation资源可以执行
RegisterRdsDbInstance
API调用,例如使用Lambda函数和NodeJS AWS SDK.
- 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.
- Use a self-managed database instance layer running on an EC2 instance using an
AWS::OpsWorks::Layer
with aType
ofdb-master
, as described in the AWS OpsWorks Template Snippet. - 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层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!