{"id":12379,"date":"2014-03-24T16:00:25","date_gmt":"2014-03-24T10:30:25","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=12379"},"modified":"2014-04-15T16:00:28","modified_gmt":"2014-04-15T10:30:28","slug":"vpc-with-a-public-subnet-only","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/vpc-with-a-public-subnet-only\/","title":{"rendered":"VPC Explained Part -1 : VPC with a Public Subnet Only"},"content":{"rendered":"<p><span style=\"color: #000000\">A virtual private cloud is a virtual network that is logically isolated from other virtual networks in the AWS cloud. One can launch AWS resources in a virtual network that you define and customize it accordingly at the time of\u00a0vpc\u00a0creation. Basically, VPC is a virtual network that resembles a network in your own data center, with the benefits of using the scalable infrastructure of AWS.<\/span><\/p>\n<p><a name=\"spans0e0\"><\/a><a name=\"spans0e1\"><\/a><a name=\"spans0e4\"><\/a><\/p>\n<p><a name=\"spans0e0\"><\/a><a name=\"spans0e1\"><\/a><a name=\"spans0e4\"><\/a> <span style=\"color: #000000\"><span style=\"font-family: Arial, serif\"><span>We will be going through a series of blogs dedicated to Amazon VPC each demonstrating a scenario of VPC. Many a times we need a cloud space to launch web applications that is\u00a0<\/span><\/span><span style=\"font-family: Arial, serif\"><span>publicly<\/span><\/span>\u00a0<span style=\"font-family: Arial, serif\"><span>accessible and scalable too. And this is what scenario 1 accomplishes.<\/span><\/span><br \/>\n<span style=\"font-family: Arial, serif\"><span>Here we will be focusing more on\u00a0<\/span><\/span><span style=\"font-family: Arial, serif\"><span>implementation<\/span><\/span>\u00a0<span style=\"font-family: Arial, serif\"><span>part, hence you must have some basic understanding of subnets, internet gateways, NAT, security groups, Elastic IP before starting\u00a0<\/span><\/span><span style=\"font-family: Arial, serif\"><span>implementation<\/span><\/span><span style=\"font-family: Arial, serif\"><span>.<\/span><\/span><\/span><\/p>\n<p><strong><span style=\"color: #000000\">Scenario 1 : VPC with a Public Subnet Only<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">The configuration for this scenario includes a VPC with a single public subnet, and an Internet gateway to enable communication over the Internet. It is recommended to run a single-tier, public-facing web application, such as a blog or a simple website.<\/span><\/p>\n<p><strong><span style=\"color: #000000\">Lets implement scenario 1 using the VPC wizard:<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">1. Create a vpc with single public subnet.<\/span><\/p>\n<ul>\n<li>\u00a0Login to AWS Management console.<\/li>\n<li>\u00a0Go to <em>VPC dashboard<\/em>.<\/li>\n<\/ul>\n<p style=\"text-align: center\"><a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/03\/11.png\"><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-12381 aligncenter\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/03\/11.png\" alt=\"\" width=\"897\" height=\"336\" \/><\/a><\/p>\n<ul>\n<li>\u00a0Click on <em>Start VPC Wizard<\/em> button.<\/li>\n<li>\u00a0Select a VPC configuration. Here we selected VPC with a Single Subnet Only as \u00a0per our scenario 1.<\/li>\n<li>\u00a0Click <em>Continue<\/em>.<\/li>\n<\/ul>\n<p style=\"text-align: center\"><a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/03\/2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter  wp-image-12382\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/03\/2.png\" alt=\"\" width=\"562\" height=\"348\" \/><\/a><\/p>\n<ul>\n<li>\u00a0Now, put in the information about to create a VPC plus its subnets, gateways and \u00a0the Hardware tendency.Inside VPC with Internet Gateway,IP CIDR block lets you \u00a0decide number of private IP that will be available for you inside your VPC. We left \u00a0everything Default here.<\/li>\n<li>\u00a0Click Create VPC.<\/li>\n<\/ul>\n<p style=\"text-align: center\"><a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/03\/3.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter  wp-image-12383\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/03\/3.png\" alt=\"\" width=\"563\" height=\"267\" \/><\/a><\/p>\n<ul>\n<li>\u00a0Your custom( non default) VPC ( VPC ID: vpc-507dda35) will be visible on your \u00a0VPC panel with value of <em>Default VPC<\/em> set to False.<\/li>\n<\/ul>\n<p style=\"text-align: center\"><a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/03\/5.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter  wp-image-12384\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/03\/5.png\" alt=\"\" width=\"893\" height=\"180\" \/><\/a><\/p>\n<p><span style=\"color: #000000\">2. Now, create a VPC security group to control inbound and outbound traffic.<\/span><\/p>\n<ul>\n<li>\u00a0Click on <em>Security Groups<\/em> (VPC).<\/li>\n<li>\u00a0Click on <em>Create Security Group<\/em> button.<\/li>\n<li>\u00a0Fill in the information(Name, Description) and select the VPC ID with which this \u00a0security group is associated. And click <em>Yes,Create<\/em>.<\/li>\n<li><span style=\"color: #333333;font-family: 'Helvetica Neue', Helvetica, Arial, 'Nimbus Sans L', sans-serif;font-style: normal\">\u00a0Now add security policies to the group( here vpc1group).<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000\"> # <strong>Note<\/strong> that VPC automatically comes with a default security group. Each EC2 instance that you launch in your VPC is automatically associated with the default security group if you don&#8217;t specify a different security group when you launch the instance.<\/span><\/p>\n<p><span style=\"color: #000000\"> #Another nice detail is that VPC allows you to switch security groups on-the-fly for running instances.<\/span><\/p>\n<p style=\"text-align: center\"><a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/03\/81.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter  wp-image-12386\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/03\/81.png\" alt=\"\" width=\"896\" height=\"437\" \/><\/a><\/p>\n<p><span style=\"color: #000000\">3. Launch an EC2 Instance within VPC.<\/span><\/p>\n<ul>\n<li>\u00a0Go to EC2 dashboard.<\/li>\n<li>\u00a0Click <em>launch Instance<\/em>.<\/li>\n<li>\u00a0Choose a desired AMI. Here we have chosen a community AMI. Click <em>Next<\/em>.<\/li>\n<li>\u00a0Choose Instance Type and click <em>N<\/em><em>ext.<\/em><\/li>\n<li>\u00a0Now fill in the information regarding configuration of Instance. For Network, choose \u00a0your non-default VPC just created.<\/li>\n<li>\u00a0Select the checkbox of <em>Public IP<\/em> to assign a public IP to your Instance. ( An Instance \u00a0launched in a VPC doesn&#8217;t have Public IP by default). Otherwise you can also \u00a0attach an Elastic IP to your Instance after launch.<\/li>\n<\/ul>\n<p style=\"text-align: center\"><a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/03\/7.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter  wp-image-12387\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/03\/7.png\" alt=\"\" width=\"898\" height=\"437\" \/><\/a><\/p>\n<ul>\n<li>\u00a0Click next to Add storage as per requirement of application.<\/li>\n<li>\u00a0Click next and fill in some tag values to identify instance.<\/li>\n<li>\u00a0Click next and select the security group just created four your non-default VPC.<\/li>\n<\/ul>\n<p style=\"text-align: center\"><a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/03\/9.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter  wp-image-12388\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/03\/9.png\" alt=\"\" width=\"903\" height=\"435\" \/><\/a><\/p>\n<ul>\n<li>\u00a0Click <em>Review and Launch<\/em> to launch your Instance inside your non-default VPC.<\/li>\n<\/ul>\n<p><span style=\"color: #000000\">Now this Instance can be accessed over the network ( as per configuration, you can restrict access ).<\/span><\/p>\n<p>Three more scenarios are yet to be covered which i shall be covering in my next blogs. So , much more to come. Stay on !!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A virtual private cloud is a virtual network that is logically isolated from other virtual networks in the AWS cloud. One can launch AWS resources in a virtual network that you define and customize it accordingly at the time of\u00a0vpc\u00a0creation. Basically, VPC is a virtual network that resembles a network in your own data center, [&hellip;]<\/p>\n","protected":false},"author":97,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":7},"categories":[1174],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/12379"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/97"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=12379"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/12379\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=12379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=12379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=12379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}