Create an RDS Opsworks Layer by a Cloudformation template

好久不见. 提交于 2019-12-25 08:27:19

问题


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

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


回答1:


Learning more on cfn-init would be my best bet. Hope this helps you out




回答2:


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.

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

  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.


来源:https://stackoverflow.com/questions/41359327/create-an-rds-opsworks-layer-by-a-cloudformation-template

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!