前回の続きです。
GitLabをAWS上で動かす(1/3)
☞ GitLabをAWS上で動かす(2/3)
GitLabをAWS上で動かす(3/3)
IPv4パブリックIPを設定
ElasticIPを設定


「ElasticIPを割り当てます」をクリック

新しいアドレス割当の画面に遷移するので右下「割り当て」ボタンをクリック

成功した場合は問題なく、そのまま「閉じる」ボタンをクリックしてもらって大丈夫ですが、失敗したときは下のようなエラー画面がでます。

私が遭遇したエラーはリージョンあたりのElasticIPの割り当て数が上限に達したとのエラーでした。
その場合は、Amazon EC2 Elastic IP アドレスリクエストフォームから問い合わせて上限を上げてもらいましょう。
上記のエラーを対策したときの記事: AWSでEC2インスタンス作成してElasticIPを割り当てようとしたら怒られた話
ElasticIPの確認

ElasticIP一覧に追加されています。
何に使用しているかわかりやすいように適宜名前をつけてあげましょう。
アドレスの関連付け

雑に名前をつけたら今度は関連付けをします。
選択して右クリック(またはアクション)から「アドレスの関連付け」を選択
アドレスの関連付けの画面に遷移しますので、画像のように前回作ったインスタンスを選択
プライベートIPも選択しましょう。
そして右下の「関連付け」をクリック

これで作成したインスタンスとの関連付けができました。
ssh接続確認
IPv4パブリックIPでssh接続

インスタンスに戻って確認すると先程割り当てたElasticIPがIPv4パブリックIPに表示されています。(確認終了
今回は以上です。
次回はGitLabをインストールするところから