启动 ec2 实例时的用户数据应该始终是字符串吗?那不能是字节数组吗? Java API:我使用 ec2Client.runInstance(TEST_IMAGE_ID, instanceType, "USER_DATA");
最佳答案
根据 Amazon :
The user data must be base64 encoded before being submitted to the API. The API command line tools perform the base64 encoding for you. The data is in base64 and is decoded before being presented to the instance.
您需要确定您的 Java API 是否会为您执行此 base-64 编码,或者您是否必须自己执行。 [请参阅下面 Matt Solnit 的评论。]
在任何情况下,请注意不要超过 16KB 的用户数据限制。
关于amazon-ec2 - 带有用户数据的 AmazonEC2 启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7491839/