let's talk about VPC endpoint let's first understand why we need VPC endpoint and then we'll see implementation details on them hopefully by this time you have a better understanding of this architecture we have a VPC setup there are instances running net Gateway internet gateway all setup now the services which run inside VPC are less in number what I mean by that so if I put some of the services which are available to be running inside VPC is Amazon ec2 like we have ec2 instances another service we use within VPC is called your Amazon RDS relational
database Services then you may set up your Amazon EMR cluster inside it maybe you want to run your Amazon elastic cache service here so these services or maybe container Based Services these Services requires a VPC to operate on the other hand services do not require VPC which you can think runs outside of VPC and this list of services are huge these Services include things like Amazon S3 you have Amazon dynamodb then you have Cloud watch as a service maybe you want to talk to Athena as a service all these Services run outside of VPC so
how communication would happen let's see that so these are my services outside of VPC which are listed here some of them now they are still within the same region let's consider my machine here which is f has to store some data into S3 bucket here in the same region now these Services which are outside of VPC they all have a public endpoint public endpoint means they have a DNS name on which you connect and that is only accessible by default if you are coming from a public network so what happens now F has to communicate
to S3 so request from F will go through internet gateway will be sent over internet connection and then it will flow down to your service here into Amazon S3 now if machine G here has to communicate to Cloud watch how the request will go g is in private subnet so it can't directly access Internet so its request will be forwarded through this net Gateway through net Gateway the request will go to internet and from internet it would be then coming to the service here cloudwatch so you could see it is a very long path you
have to take you want to meet your next door neighbor but you go outside of the city and then come back and then go to them that is not fair we want a better way to connect them and that is where end points comes into picture once you set up an endpoint endpoint would establish a private connectivity like this so once the end point is established consider like if this was one house and this was second house you have to communicate to them and for that you have to go all over the city and then
come back now instead of this we have set up a backyard door and through this you should be able to communicate and meet that person shouldn't be a problem so that's what we are trying to do here through something called endpoints and these endpoint will keep your traffic private they won't send traffic outside to internet so it will save you cost and it will save you time and give you better performance because your traffic is not going outside internal it is communicating and it is must secure because you are not exposing your traffic at all
to internet these endpoints are of two type one is called a Gateway endpoint and another is called an interface endpoint Gateway endpoint is only for two specific Services which are named dynamodb and Amazon S3 on the other hand interface endpoint is available for all other supported Services which are having endpoints available so let me go ahead to console and show this thing that would be much easier for you to follow along let's go to Management console and we'll see how these endpoint actually works so I'll go to vpcs and there I would explore the available
line points which are there here is my endpoint options right so I'm going here on end points and so this end point I should be able to set up a endpoint I do not have any endpoint as of now that's completely fine let me click on create endpoint when I say it asks me to give a name now endpoint can be mostly used to talk to AWS services but if you want they can talk to private link Marketplace services and other endpoint services for our discussion I am just focusing on AWS Services as of now
and if you see the list there are 203 endpoints which I could use and here I could see the list of type owner who has provided that and if I try to sort it out I sorted it by the type and I only see Gateway for these two which is com Amazon AWS Us East one dynamodb which is a gateway endpoints and com Amazon AWS Us East one dot S3 that is a gateway endpoint so dynamodb and S3 both are available only as a Gateway remaining all other services as you could think of they would
be part of interface endpoint so let's say I want to talk to a service like Athena and that would be available here let's see this so Athena is the interface endpoint I want to talk to Cloud watch as a service now that is called a log service so here I have a logs which I would be connecting to service catalog and maybe this one is my log service which I could connect to I am looking for connecting to systems manager and that is called SSM so naming could be little different as you could see here
SSM service can be connected through a interface endpoint and see this a service may have it's a additional endpoint like if you are just trying to use SSM this is good if you are trying to use some contacts then this is this will require incident SSM messages so service may have multiple endpoint so the list here which we are getting it is not like 203 Services I would say it may be list of component within those Services also so let's keep it very simple I want to establish one connectivity to S3 and maybe another one
I want to set up with Athena Athena is a query service by which you could query data we won't use that service here but I'm just trying to establish a connectivity to that service let me first set up a S3 endpoint and I am selecting S3 as a Gateway endpoint so I selected S3 as a Gateway endpoint for us East 1 in the region which I am in right now and then I have to say which VPC it would get associated with so I do not have additional VPC I have just my default VPC that
is still fine I would go ahead and set up a VPC here now as soon as I go ahead and say I want to have a endpoint Gateway endpoint requires a entry into route table the idea here is as soon as the traffic will be generated which is destined for Amazon S3 service it would be forwarded through routing table to the end point so we have to add entry of this endpoint into our route table of that VPC I have only one rock table default VPC route table so I would just add entry there let
me show this route table first and once I add the entry I would again show you that how it looks like so it will give you idea that what changes would happen in your out table so current my route table is default route table if I go to the routes associated with it I have a 0 0 route which is going to igw which means we have public internet connection and then this one is the internal IP address range of the vpcs that is also accessible and these two entry only exist I'll go here and
I would say I want to add entry into an out table now if you see this is a checkbox so there are chances that you may have multiple route table in the within your VPC one may be for private maybe another one for VPN maybe another one for some other communication so you could add this entry into multiple endpoints sorry multiple without table shouldn't be a problem at all I am just adding it into the default route table this entry can be protected through a policy which is called VPC and point policy this is a
document in which I would specify who is allowed to access this endpoint for sake of this demo I am just using it as a full access otherwise I could have customized it and there are tools available to help you dictate and create your own policies right now I am keeping it simple but this VPC endpoint are protected by the policy which can be provided here I am keeping this thing simple and now I say let me create an end point so when I'm creating an end point what is going to happen I got a endpoint
ID I got which VPC it is associated let me rename it so I would say it will be a S3 Gateway endpoint so this is much easier for me to identify and this should have added its entry into the default route table as per the configuration I have done inside so this is my default route table in which entry should have been made now and if I go to my route table again let me refresh it and sometime it may take little bit of time to show up here but it should be there like currently
it is not displayed we'll give it few second and refresh it again hopefully this time the entry would be there so give it few seconds and it should be there I am pausing the video and I'll talk to you again in few seconds okay by the magic of pause and resume I am back and if I see now I reflect it and I get an entry here into the route table which we selected which is PL Dash some number and its Target is vpce and a number VPC stands for VPC endpoint so where is S3
mentioned how I would know that it has to send traffic only for S3 so that is done by here this is called prefix list this is represented by PL what basically this prefix list is this prefix list contains all the IP addresses which Amazon S3 is currently responding on so if I go into this prefix list and I check its entries this is the list of IP address on which Amazon S3 service is running so as soon as your packet would want to talk to Amazon S3 as a service it would reach out to any
of these IP address range and Route table would know that okay you are going to S3 and let me forward your traffic to the end point rather than sending you to the public network so this prefix list is there you could create your own 360 list for sums other services or some other type of traffic but this list is maintained by AWS and if let's say they later add more IP address or range for Amazon S3 prefix list will automatically get updated updated you do not have to manually do anything so because of this what
happened now I have a endpoint created and that end point will be forwarding my traffic to Amazon S3 service and that is through our route table so how this Gateway endpoint work Gateway endpoint adds entry into routing table by which your traffic will be redirected to the end point and then it will reach to the service this may not be very efficient design if you have hundreds of services to talk to because if your route table keeps on going longer and longer and longer it may take time for routers to decide how to forward the
packet and that's why they have to come up with a better approach because the services keeps on growing and the better approach they have come up with is called your interface endpoint so I hope this thing is clear what is the Gateway endpoint and now let me focus on end point which will be my uh interface endpoint I don't know why the name was not saved but let me click again and let's call it S3 Gateway endpoint and I say save hopefully this time it will be saved Let me refresh it again nope uh not
sure what I'm doing wrong here S3 Gateway endpoint maybe assist glitch in the system so I'll leave it as of now probably in some time it would get fixed or it should start reflecting okay okay so second endpoint I'm interested in creating is uh Athena endpoint I want to talk to a service which is let's say call Athena so I am searching for the service Athena and I should be able to see various options available for it so sorry not this this is the name I have given Athena and this is my interface endpoint I
would search for the service here Athena and here is the service AWS in I mean dot Us East dot Athena and I say okay I want to talk to you now in this case I have to select again a VPC this is my VPC but I have to add additional setting here that on which specific subnet I want this interface endpoint to be available and you could set up it to be available in all the subnet or you could be selective if the need be so I could say hey I want it to be available
in all the subnets no problem so I could select it all the availability is on and then select specific subnet within that availability Zone like I have this default VPC which has six interface 6 subnet and I am putting it on all six subnet but if I feel no I would only be needing it for one a and one B let me just add it here don't unnecessarily add it unless you know what you are doing once this thing is set up what I would have I would be having a IP address on this plus
this is doing what let me try to draw that behind the scene if this is my Subnet I'm representing in this subnet it is setting up a network interface or we can call it a eni and this eni would have IP address so if there are machines here in this subnet and now they say hey we want to send traffic to Athena what would happen this eni would be listening to the request which is coming up which is going to Athena as a service and then forward it so internal mechanism to the service which is
your Athena service right so our interface endpoints uh eni is provisioned into the subnet of your choice you select which subnet you want that connectivity to and then we would establish a network interface on it and it will take IP so whatever your IP address range was available within that subnet one of the IP would be consumed and this one is made highly available by Design AWS takes care of its availability so you do not have to worry you just select which subnet you wanted most probably you would keep it into multiple Subnet in multiple
EAS so that even if one AC fails you would still have connectivity right so this would be using what if this is a eni it would also be protected using a security group we remember security group right Security Group is associated on an eni level and if this is a eni we could protect this also through a security group like my VPC uh Gateway endpoint we protected through a policy but here in case of interface endpoint we will protect it by a security group so hopefully this thing is clear and let's see what happens this
won't add any entry into route table I have just selected these two and I would say which Security Group to associate I am using default but probably you would have your own way of doing things policy can still be applied here if they need be no issues at all on that and then you could put some tag and say create an endpoint so this endpoint got created and now it would forward my traffic as soon as it comes for Athena through this network endpoint to service Athena so that I do not have to send traffic
outside this one is your interface endpoint and later if you have more subnets to be added you could should not be a problem at all it has not added any entry into routing table let me quickly go through that route table just to show you and verify that it is not adding any entry into route tables I will go to routes and here only the entry is for routes all right now sometimes people call it that Gateway endpoint are network layers I would say yes they are network layer why or they operated Network layer because
they are operating through the route table entry and Route table is a network layer entity which works on IP addresses whereas your interface endpoint are referred as a application layer service because it would intercept the packet which are going to Athena in the destination and then we would be forwarding that to the required service so you could call it that Gateway endpoint is your network layer service whereas your interface endpoint is a application layer service but it is not official answer right so hopefully this thing is clear and we establish connectivity so let's go to
slides and see how this thing work hopefully you have idea on that both I have to talk one more thing here S3 is now available in this channel too so S3 is accessible through our interface endpoint plus it is accessible through a Gateway endpoint this is a new settings which has been made available let me show that quickly here also so I again go to my endpoints and this time I want to create an endpoint this is going to be talking to a service and let me search Services here as three and see this so
this is my S3 service and S3 has both type of endpoint available for Gateway also and interface also so you decide what works well well for you you may use any of them and it would do the same thing for you so difference between these to end point let's go ahead to a tabular format and by the way you could get a better picture representation of this in this link which I would be having into resource section here are more details on it how it works and here is a pictorial representation of how it is
actually working so this is my region if I am talking to dynamodb and S3 I am using Gateway VPC endpoint which is associated on a VPC level but if I am talking to other services then I am using interface endpoint and they create a network interface within the subnet and these are called my interface endpoint so interface endpoint r at subnet level whereas VPC and Gateway endpoint are at the VPC level that is one more distinction between them so check this picture this is giving you a better idea on how this is actually communicating with
the internal services so differences here both are used for private connectivity but creative endpoint however connected to S3 and dynamodb interface endpoint 100 plus AWS services including Amazon S3 how Gateway endpoint Works Gateway endpoint adds a entry into route table for a prefix list and then your traffic is routed in an interface endpoint an eni or multiple eni is provisioned in the selected subnet which serve as an entry point for traffic destined to the supported service behind the scene AWS is using a service which is called private link so private link is allowing that private
connectivity establishing a link privately from your subnet up to that particular service now one thing you have to be clear here why I am saying Enis here let's say this is my Subnet and I have a issue to machine running here I want this EC to talk to a service like Athena I want it to talk to let's say S3 also let me put it here completely that I am referencing as the interface endpoint and I want it also to talk to Cloud watch so in this particular case what is going to happen we would
have three Enis created one two and three one eni which will be for Athena another eni which will be for S3 and another one which will be for cloud watch so that's why you may have multiple Enis and you are not having one eni for all services every service would provision its own eni which would consume IP addresses in your subnet so be be aware that you would be needing sufficient IP addresses if you are trying to talk to multiple AWS Services okay so these are powered by private link Gateway endpoint is provisioned at VPC
level we talked we saw that and the entry is added to the route table interface endpoint are added at subnet level no entry required in the route table for it no need for making any changes there plus from security perspective Gateway endpoint gives you a VPC endpoint policy interface endpoint give you security groups plus VPC and point policy so you decide on how you want to protect these two services so I hope this thing is clear and you got a better idea on how this endpoint works so they will save you cost they will keep
your performance up and they will give you a better security so please use endpoint for your services it is very common to have questions and exam which will give you a scenario and say that hey I want a private connectivity to the service what I should do should I use the interface endpoint or a Gateway endpoint now if you are confused that if in question they ask you about S3 and they say hey should you use Gateway or should use interface I would say probably these type of confusing questions won't be there but even if
you select Gateway or interface both should be correct answer so I don't see a problem in these type of questions probably it won't be there but just in case it exists interface endpoint I would personally go with now one thing to be aware for exam that a technology got released today or a feature got released today it's not going to show up into your exam next day it takes minimum of six months and I would say more than some time then six months to actually show up a question on the recent Technologies so don't worry
about changes happening in AWS world every day if you are preparing for certification you would still have six month or more time required for those questions to show up into your actual exam to summarize this I have given a service summary card here for private link so read this information because private link is not only for AWS servicer it can help you to get access through third-party services also or if you are a software as a service provider in AWS you could also expose your services through private link so your customer can connect to it
internally rather than sending traffic through public internet so read this information about private link so I hope you are enjoying I'll talk to you into the next section thank you