Here and welcome back now into this, we will be discussing about the connectivity features of LAMDA.
Now, whenever you're using a LAMDA function within the production environment, there can be a use
case where the lambda function might want to connect to the resources as part of the Internet, and
it might also want to connect to the resources with that part of the PC.
Now, one of the good features of LAMDA function is that it can connect to the resource board as part
of the BBC network and the Internet.
Now, by default, whenever you create a LAMDA function, that LAMDA function is not configured to allow
you to connect to the VPC so you can by default connect to the Internet, but you would not be able
to connect to the resources which are part of the VPC.
So let's assume that you have a lamda function and it wants to fix certain data from their database,
which is built in the private subnet of the BBC.
So this LAMDA function by default will not be able to fix the data because the connection itself will
not happen.
So if you want to allow your lambda function to connect to the BBC resource, what you can do is you
can associated with the VPC and the appropriate subnet.
So if you look into this Duigan, this lambda function is associated with a default VPC and there are
certain subnets through it.
It is associated with.
So in this way, once you associate Erlinder function within a website, you will then be able to connect
to the resources which are part of that weepies.
So let's do one thing.
Let's quickly look into it so that it becomes much more easier.
So currently this is a lamda dashboard.
Let's go to the function and let's quickly create a new function.
You will use a basic function name, let's call it as copyleft haven function and let's go ahead and
create a functional.
So this is a function that is created.
Now, this function, as we're discussing by default, it will be able to communicate with the Internet.
However, it will not be able to communicate with the resources which are part of the BBC.
So in order for you to associate this function with the BBC, if you go a bit down, you will see that
within the network section you have the subsection associated with the ABC where you can select the
BBC within the region so you can select whichever BBC that you want to associate with, and you then
also select multiple subnets as part of the higher availability.
So along with that, you also need to select the security group associated with the lambda function.
So let me associated with two subnets for high availability.
Once you have done that, you can go ahead and click on C.
Now, if you look at the top, there is an error which has come, it says that your rule does not have
a VPC permission.
So this lambda function is associated with the IBM rule.
So if you see within the execution rule, there is a rule which is associated with the lambda function.
So this lambda function does not really have permission, whatever EPK, because once the lambda function
is associated with the VBC, then there are a lot of things that it might want to do, like creating
a network interface, deleting the network interface and so on.
So all those related permissions should be there associated with the lambda execution rules so that
it can work perfectly.
So now in order to overcome this, what you can do is you can go ahead and create a new IHI and rule.
So let's go to the IBM section will go to rules and you're going to create rule.
This rule would be for the lambda function.
Let's select that and click on next.
Now, within the policies, there are certain Premi policies which are available so you can filter by
BBC.
And there is one specific policy of this Lambda VPC axis execution tool.
So you can go ahead and select this.
Click on next.
We'll do a review, let's call it as Keeping Tabs Lambda Rule and we'll go ahead and create a rule.
Great.
Once you have done that, if you quickly look into the permission associated with this specific Mannerist
policy, you will see that this specific policy allows various things like creating network interface,
describing network interface, deleting network interface and so on.
So these are the three important permissions which Lamela need, specifically when you're associated
with the ABC.
So now once you've created the rule, you can go back to the lambda function.
Let's open up the function.
And if you could be done within the rule, you can make use of the epilepsia rule that we have created
once, then you can go ahead and conceive.
So if everything is perfect, you will get us successfully updated message and no error message, as
we had seen earlier.
So a few important points to remember.
Your first one is that whenever you're launching a lambda function in the specifics of VPC, make sure
that the navigator is a test in case if you need the Internet access to the lambda function.
So by default, whenever you create a lambda function, as you were discussing, so you create a default
lambda function.
So that kind of function will be able to communicate with the Internet without any configuration required.
However, when you create a lambda function and associated with a BBC, then whichever subnet in which
you have launched the lambda function, you will have to make sure that the subnet D.N.A. that so that
the lambda function can use their navigator to connect to the Internet.
Second important point is that the lambda can also connect to the established services like a skew is
the other privately, which is VPC endpoints.
Third important point is that if Lambda function wants to connect to services like schools to perform
certain operations, then appropriate i.e. role will also be needed here.
And therefore the important point that we just looked at that if you're launching a lambda function
in a BBC, then you need to create appropriate time rules so that the lambda function can create or
delete network interfaces within the VPC.
So these are certain important operations at the lambda function should be able to do so.
That's the overview about the connectivity features of Lambda.
I hope this idea has been informative and I look forward to seeing the next video.