"--user-data" (string)
The user data to make available to the instance. For more
information, see Running Commands on Your Linux Instance at Launch
(Linux) and Adding User Data (Windows). If you are using a command
line tool, base64-encoding is performed for you, and you can load
the text from a file. Otherwise, you must provide base64-encoded
text. User data is limited to 16 KB.
[-UserDataFile <System.String>] [-EncodeUserData <System.Management.Automation.SwitchParameter>]
AMIに事前にシェル本体を埋め込み、ユーザデータにそのシェルを実行するコードを埋め込むことでも可能です。
例えば AMI の "C:\InitializeScript\ConfigEnviroment.ps1" に初期化データを設定します。
そしてユーザデータから以下のようにこのシェルを呼び出します。
<Powershell>
C:\InitializeScript\ConfigEnviroment.ps1
</Powershell>
【超重要】本ページは情報が古くなっている可能性があります。参考程度にしてください。
[ 一覧に戻る]