Alone will come back still without permission.
Now let's find out what is that story about intrinsic functions.
Inculturation so interesting functions are nothing more than built in functions and there are several
ones that will help you manage your stacks.
Why do I need to use it.
There are some variables or parameters that will not have values until your infrastructure or your stack
is created.
The runtime basically like what.
Let's assume that I need the instance ID for that easy to instance created because I need to pass it
on to another service or another application or two eventually to ACM in order to create a certificate
that includes that piece or that instance ID.
This will not happen until you launch the instance.
So intrinsic functions will help you with that.
So interesting functions use it in your templates when to assign values to properties that are not available
until runtime.
I need to know the availability zone where the instance is launched so I can use or I can enable then
will be to be configured in a public subnet in that it is also the load balancer will be able to run
to it.
That is another example.
So where in my template can I use the Internet functions.
And it goes this is very important so I can use intrinsic functions in what sections of the template
in the resource section in the output section in the meta data attributes or meter reader section.
So there are three sections you can use them and also as we learn later on from the resource attributes
in the update policy attributes resources they have attributes and we'll talk about that later on in
their resource attributes are creating an update policy.
Also you can use intrinsic functions where for locations or parts of your template resources in the
output in the meta data and in update policy attributes.
You can also use intrinsic functions to conditionally create stack resources.
So what are some of importance.
I mean there are plenty and we will go now to a website and I'll show you the full list but get you
to find in my reference or ref get Easy's import value.
These are ones that you may use frequently when you are dealing with cloud formation templates and if
you follow this your L you will get to the interesting function reference the list of intrinsic functions
and what do they do and all that.
Let's now head to their website and I'll show you the full list.
And we'll go through.
What do they do exactly.
OK.
So if you say all I have and in fact you wrote cloud formation is a guide template reference intrinsic
functions reference.
So this is the list of functions that we can have.
Base 64 cyder blocks find the map get up get easies and other functions so let's look at the ones that
are of interest to us.
So let's look at the find the map.
What does it do.
So the finding map function call column finding map returns the value corresponding to two keys in a
two level map that is declared in the mapping section.
OK.
And there is adjacent template and there's the template.
And here we have an example.
So here is the mapping.
It's called a region map.
And then I have the region the type of virtualization that I'm going to use and how many bits.
And then you find the a.m.-I and if it is VMG to then a different might.
So basically this is a lookup table then it has the region as a variable.
It has the type of virtualization as a variable and then you get the value for what you are looking
for which is they might use and here under the resources section I'm going to have in finding maps here
is the function that I'm using the name of that is region map and here's the normal counterpart to that
right.
So let's look at the next one.
Get attributes.
What can I do with that.
Get attribute.
So the function call and call and get attribute intrinsic function returns the value of an attribute
from a resource in the template like what like if you want to get the instance ID if you want to get
the DNS name.
And here's the format.
And if you scroll down you can find an example here.
Function get attribute.
Where does that get at.
What's the name of that attribute.
I'm looking for my email be.
If you go to my Ill be here get daisies in the next one.
So it is easy returns an array that list it is on for a specified region.
So what you need to search the region and then it will get you a list or an array of what it isn't are
available there and this will help you avoid too hard code.
The list of everything zones for a specified region to get the parameter What is the list.
What are the owns and act based on that.
And here's an example function get everybody's own import value and then reference these will be the
next to that we look at the function import value returns the value of an output exported by another
stack like what if I have two groups developers and network an application or developer and the network
are going to build the BBC they're going to put this up next day.
I want now for the developers they want to launch an easy to instance but they need to get submit ideas
or submit ID name that was created or the VBC details that was created by the network team.
So now if the output of the stack configured or created by the network team includes these variables
the BBC includes the subnet IDs and all that then these guys in the developers team they can reference
that they can call that using the import value from the network stack output into the easy two instances
or the developers or the application developers stack that template that they are creating.
So if you want to do a cross-reference this is the craftier cross-reference between stacks then import
value is a handy one that you can use.
So here you have export in stack a.
And these are the variables.
And instead be I'm going to import as you can see here function import value and then the reference
for what you're trying to get for the subnet ID from the other stack.
If your important thing that you cannot delete a stack that you are referencing it's one of its outputs.
You cannot do that.
You cannot modify or remove an output value that is referenced by another stack.
You cannot do that as well because you are importing it.
And one important thing is that you cannot create the cross stack reference across regions.
So things to keep in mind just in case if it pops up in one of the scenarios then you have that in mind.
So we look at is reference let's see what difference does intrinsic function that returns the value
of the specified parameter or resource.
Now remember before when I said that when we have resources the resource can also be referenced from
the output.
And when we had the mapping the mapping could have been referenced from the resources then you need
to use that F in order to point to something else to our parameter in a different section of the policy.
And here we have an example then I'm referencing my easy to instance and that will be a part of the
policy where you have my easy instance.
So what will the reference return to you.
It will return the instance ID from the section that included in the resources that included my instance
my easy to instance.
OK let's not talk about resource attributes so in the resources section each resource can have attributes
different attributes so that of course you can.
And we'll talk about them right now.
They are used to further control additional resource relationships and behaviors of resources specified.
And what are examples of that creation policy.
Why would I need to do that.
Why would I need to have a creation policy for that resource.
Let's say you are creating.
And you'll be on I'm not just kidding group and you don't want the auto Skilling group or that be to
launch or to be created before the respective back end easy to instances will be created deletion policy
if you want to retain or create snapshots or resources before they give you the template.
Give me an example.
I have an obvious one in half an hour the instance and I would like to keep the data in the database
and I don't want that to be deleted.
I can have a division policy attached to the resource that I've created for this instance.
When the time comes to delete the stack snapshot it first before deleting or retain the audience instance
don't delete it at all.
That's the three buckets I wanted deleted it on retain it depends on so you can define dependencies
between the source specifies the resource creation is dependent on the creation of another resource.
If you want to add more meta data to your resources and update policy defines how the resource update
should be carried out let's look at the creation policy to take the creation policy and I'll talk about
the deletion policy in the next lecture because they are very important in the future.
Frequently in the cloud for Mission questions in the exam so creation policy you can associate a creation
policy attribute with a resource under the resources section in your template.
Why to prevent its status from reaching create complete until something happened signals or some time
has lapsed.
When will the creation policy be invoked only when clutterer mission is going to create the associated
resource.
Because the creation policies are attached to the resource What are the resources that support creation
policies now all or killing group instances and weight condition so use the creation policy attribute
when you want to wait on the resource configuration actions before creation proceed so you have to hold
everything until that happens and then you can persuade condition.
Very important.
So yes it is a cloud formation resource and the is weight condition.
Use it with creation policy attribute.
You can do the following.
You can coordinate stack resource creation with other configuration actions that are external to the
stack creation drag the status of a configuration process.
Examples.
You can start the creation of another resource after an application configuration is partially complete
or you can send signals during an installation and configuration process to progress which would be
important in finding out what happens especially if you're talking about test and development or in
production such that if something happens you can go and look at the logs and the progress and find
out what what happened and you can use it to instruct a mission to delay the creation of resources until
an application has launched successfully on an easy to instance.
Right.
So that was the creation policy which is an resource attribute configured under a resource in your cloud
formation resources section in your template.
OK let's take a break and I'll come back and talk about an important attribute resources which is the
deletion policy as well.
But in the next lecture after the break I'll see you then.
Thank you.