我需要能够从我的一个 AMI 映像快速启动 AWS EC2 实例,并在启动时运行脚本来引导实例。我知道我可以使用用户数据执行此操作,但我需要能够向脚本传递一个参数,该参数在每次启动实例时都会有所不同。
如果我使用AWS 工具中的 Start-EC2Instance,我看不到将用户数据或 agrs 传递给启动脚本的方法。
任何帮助将非常感激。
谢谢
我需要能够从我的一个 AMI 映像快速启动 AWS EC2 实例,并在启动时运行脚本来引导实例。我知道我可以使用用户数据执行此操作,但我需要能够向脚本传递一个参数,该参数在每次启动实例时都会有所不同。
如果我使用AWS 工具中的 Start-EC2Instance,我看不到将用户数据或 agrs 传递给启动脚本的方法。
任何帮助将非常感激。
谢谢
您正在查看错误的命令。看看New-EC2Instance
Synopsis
Invokes the RunInstances method against Amazon Elastic Compute Cloud.
Syntax
New-EC2Instance
-ImageId <String>
....
-UserData <String>
-UserDataFile <String>
....
Description
Launches a specified number of instances of an AMI for which you have permissions.