5
2

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.

[AWS]EC2インスタンスを作成し、SSH接続できるまでにつまづいたこと[ドラフト]

Posted at

AWS初心者の私が、EC2インスタンスを作成し、SSH接続できるまでにつまづいたことです。

さらにいうと、秀和システムの「Amazon Web Service アプリ開発運用」という本の第3章をやっている際に、つまづいたところです。

VPCのサブネット、Internet Gatewayを自分で作る必要があった

本では、VPC作成時にサブネットおよびInternet Gateway は自動で作られているようでしたが、2019/09/08現在、それらは自分で作る必要があるようでした。

  • サブネットに関しては、EC2インスタンス作成時ににVPCを設定する際に、怒られます。

// TODO VPC Dashboard -> Subnets といって作成しましょう。

  • Internet Gatewayに関しては、Elastic IPをインスタンスに割り当てるときに、「Network vpc-0408fe634bf38c9a9 is not attached to any internet gateway」と怒られます。

// TODO VPC Dashboard -> Internet Gateways といって作成しましょう。

Screen Shot 2019-09-08 at 18.00.05.png

Route Table に作成したInternet Gatewayを設定する必要がある

EC2にSSH接続する際に、これをしないと繋がりませんでした。

//TODO VPC Dashboard -> Route Tables と進み、EC2インスタンス(に紐づいているVPC)に紐づいているRoute Tableを選択し、 [Edit route]でrouteを追加しましょう。 "Target"に"Internet Gateway"を選択すると、手持ちのGatewayが選択できます。

Screen Shot 2019-09-08 at 18.16.09.png Screen Shot 2019-09-08 at 18.12.05.png

Destinationはなどは0.0.0.0/0で良いのか正直わかりませんが、とりあえず私の設定ではこれで繋がりました。
適宜設定してください。

以上です!

5
2
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
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?