[英]Can I use AWS CloudFormation with a custom AMI?
I want to use an AMI that have not been created from a snapshot. 我想使用尚未从快照创建的AMI。 The AMI was created using a virtual machine and then I used CLI tools to create the instance and the AMI. AMI是使用虚拟机创建的,然后我使用CLI工具创建实例和AMI。
This instance have installed cloud-init. 此实例已安装cloud-init。 Could I use this AMI to create instances using cloudformation? 我可以使用此AMI使用cloudformation创建实例吗? Do I need to install more software to use that service? 我是否需要安装更多软件才能使用该服务?
Thanks! 谢谢!
Yes, definitely, that is a very common use case: 是的,当然,这是一个非常常见的用例:
Amazon Web Services (AWS) publishes many Amazon Machine Images (AMIs) that contain common software configurations for public use. 亚马逊网络服务(AWS)发布了许多包含用于公共用途的通用软件配置的亚马逊机器映像(AMI)。 In addition, the AWS developer community has published many custom AMIs. 此外,AWS开发人员社区已发布了许多自定义AMI。 You can also create your own custom AMIs so that you can quickly and easily start new instances that have everything you need for your application. 您还可以创建自己的自定义AMI,以便快速轻松地启动具有应用程序所需一切的新实例。 For example, if your application is a website or a web service, your AMI could include a web server, the associated static content, and the code for the dynamic pages. 例如,如果您的应用程序是网站或Web服务,则您的AMI可能包括Web服务器,关联的静态内容以及动态页面的代码。 After you launch an instance with this AMI, your application is running and ready to accept requests. 使用此AMI启动实例后,您的应用程序正在运行并准备接受请求。
https://s3.amazonaws.com/cloudformation-examples/BoostrappingApplicationsWithAWSCloudFormation.pdf https://s3.amazonaws.com/cloudformation-examples/BoostrappingApplicationsWithAWSCloudFormation.pdf
Should you plan to use Cloudformation:Init inside your template to add additional configuration when your instance will start, be sure to install cfn tools as well (cfn-init, cfn-hup, cfn-signal...) 如果您打算在模板中使用Cloudformation:Init来在实例启动时添加其他配置,请务必同时安装cfn工具(cfn-init,cfn-hup,cfn-signal ......)
More details about Cloudformation:Init : http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-init.html 有关Cloudformation的更多详细信息:Init: http ://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-init.html
How to install cfn helper scripts : http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-helper-scripts-reference.html 如何安装cfn帮助程序脚本: http ://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-helper-scripts-reference.html
Yes. 是。
When you are specifying the instance in the cloud formation script you can use "ImageID": "" <- put in the AMI ID 在云编队脚本中指定实例时,可以使用“ImageID”:“”< - 放入AMI ID
ImageId 图像标识
Provides the unique ID of the Amazon Machine Image (AMI) that was assigned during registration.
Required: Yes
Type: String
Update requires: Replacement
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.