0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AlibabaCloudのAutoScalingのユーザーデータについて

Last updated at Posted at 2018-07-01

はじめに

前回のAlibabaCloudのECSのユーザーデータについてではECSのユーザーデータに触れました。
さて、今回はAutoScalingでのユーザーデータの使い方についてさらっと触れます。

起動するユーザーデータはコチラ

#!/bin/sh
yum update -y
yum install -y nginx
systemctl enable nginx.service
systemctl start nginx.service

コンソールからECSを起動するとき

e5c8811c.png

と入れるだけでOKです。
あ、すいません。同じ画像なので全く変えてません。(笑)

ROSからECSを起動するとき

"ALIYUN::ESS::ScalingConfiguration"
のパラメータで

        "UserData": {
          "Fn::Base64": {
            "Fn::Join": [
              "\n",
              [
                "#!/bin/sh",
                "yum update -y",
                "yum install -y nginx",
                "systemctl enable nginx.service",
                "systemctl start nginx.service"
              ]
            ]
          }
        }

といれればOKです。

User data - User Guide| Alibaba Cloud Documentation Center

まとめ

これで、Auto Scalingでもnginx起動するためにSSHせずできるようになりました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?