简体   繁体   English

AWS Ec2-需要在EC2实例之前创建VPC和Su.nets吗?

[英]AWS Ec2- need to create VPC and Subnets before Ec2 instance?

I am trying to create a basic ec2 instance on which I will run a docker container that runs a spring boot web app.我正在尝试创建一个基本的ec2实例,我将在该实例上运行一个运行 spring 启动 web 应用程序的docker容器。

When I go to create the instance I see the below screen.当我 go 创建实例时,我看到下面的屏幕。

Do I need to create a VPC and su.nets first before I can create an Ec2 instance?是否需要先创建VPCsu.nets才能创建Ec2实例? And is this a new feature of AWS ?这是AWS的新功能吗?

I want my instance and docker container to be accessible via http and https on the public inte.net as spring boot exposes a rest api.我希望我的实例和 docker 容器可以通过 public https上的http和 https 访问,因为 spring 引导公开了 rest api。

在此处输入图像描述

If you don't already have one, you can create your own VPC or use the default one then create a public su.net (with auto-assigned public addresses) in this VPC.如果您还没有,您可以创建自己的 VPC 或使用默认 VPC,然后在此 VPC 中创建一个公共 su.net(具有自动分配的公共地址)。

I would recommend to directly create your own VPC.我建议直接创建您自己的 VPC。

Since you want your instance being reachable on http and https you want to create a security group that allows connections on ports 80 & 443 and allows connection on port 22 from your personal IP address only .由于您希望您的实例可以在 http 和 https 上访问,因此您希望创建一个安全组,允许端口 80 和 443 上的连接,并仅允许从您的个人 IP 地址连接到端口 22。

The port 22 will allow you to connect via SSH in the instance to set up your docker container.端口 22 将允许您通过实例中的 SSH 进行连接,以设置您的 docker 容器。

Hope it helped!希望它有所帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM