Amazon EC2 实例可以使用“用户数据”(一个长字符串)或元数据标签(一些键/值对)创建。
它们之间有什么区别?为什么这两个系统并行存在?
特别是,我希望在启动时将某些自定义数据(即连接字符串和两个资源 URL)传递给 EC2 机器,以便它可以自行配置。大概这些最好作为三个键/值对发送?
最佳答案
根据 this文档页面、亚马逊提供的元数据和用户指定的用户数据:
Amazon EC2 instances can access instance-specific metadata as well as data supplied when launching the instances.
You can use this data to build more generic AMIs that can be modified by configuration files supplied at launch time. For example, if you run web servers for various small businesses, they can all use the same AMI and retrieve their content from the Amazon S3 bucket you specify at launch. To add a new customer at any time, simply create a bucket for the customer, add their content, and launch your AMI.
关于amazon-web-services - AWS : Difference between User data and Metadata tags when creating EC2 instance,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12820275/