2016-04-28 84 views

回答

0

是的,用戶數據在Ubuntu上受支持。他是如何通過構建出一個新的實例時,它看起來的一個例子:實例可用

$ cat > init.sh 
apt-get -y install mypackage 
^D 
$ aws ec2 run-instances \ 
    --iam-instance-profile Name=my-ec2-profile \ 
    --image-id ami-fa82739a \ 
    --count 1 \ 
    --instance-type t2.nano \ 
    --key-name my-ssh-key \ 
    --security-groups my-security-group \ 
    --user-data file://init.sh 

後,您可以檢查日誌,以確保程序包安裝工作正常:

$ ssh -i my-ssh-key.pem [email protected] 
$ cat /var/log/cloud-init-output.log