1
00:00:00,140 --> 00:00:02,030
Alone will come back still without permission.

2
00:00:02,040 --> 00:00:06,130
Now let's find out what is that story about intrinsic functions.

3
00:00:06,160 --> 00:00:11,670
Inculturation so interesting functions are nothing more than built in functions and there are several

4
00:00:11,670 --> 00:00:14,040
ones that will help you manage your stacks.

5
00:00:14,040 --> 00:00:15,090
Why do I need to use it.

6
00:00:15,090 --> 00:00:21,630
There are some variables or parameters that will not have values until your infrastructure or your stack

7
00:00:21,630 --> 00:00:22,250
is created.

8
00:00:22,290 --> 00:00:24,810
The runtime basically like what.

9
00:00:24,840 --> 00:00:30,660
Let's assume that I need the instance ID for that easy to instance created because I need to pass it

10
00:00:30,660 --> 00:00:37,440
on to another service or another application or two eventually to ACM in order to create a certificate

11
00:00:37,440 --> 00:00:40,860
that includes that piece or that instance ID.

12
00:00:40,860 --> 00:00:42,980
This will not happen until you launch the instance.

13
00:00:43,020 --> 00:00:45,410
So intrinsic functions will help you with that.

14
00:00:45,630 --> 00:00:51,120
So interesting functions use it in your templates when to assign values to properties that are not available

15
00:00:51,150 --> 00:00:52,600
until runtime.

16
00:00:52,620 --> 00:00:59,200
I need to know the availability zone where the instance is launched so I can use or I can enable then

17
00:00:59,230 --> 00:01:04,830
will be to be configured in a public subnet in that it is also the load balancer will be able to run

18
00:01:04,830 --> 00:01:05,490
to it.

19
00:01:05,490 --> 00:01:06,740
That is another example.

20
00:01:06,750 --> 00:01:10,470
So where in my template can I use the Internet functions.

21
00:01:10,470 --> 00:01:15,510
And it goes this is very important so I can use intrinsic functions in what sections of the template

22
00:01:15,570 --> 00:01:22,020
in the resource section in the output section in the meta data attributes or meter reader section.

23
00:01:22,020 --> 00:01:28,440
So there are three sections you can use them and also as we learn later on from the resource attributes

24
00:01:28,470 --> 00:01:34,740
in the update policy attributes resources they have attributes and we'll talk about that later on in

25
00:01:34,740 --> 00:01:37,890
their resource attributes are creating an update policy.

26
00:01:37,890 --> 00:01:45,720
Also you can use intrinsic functions where for locations or parts of your template resources in the

27
00:01:45,720 --> 00:01:49,560
output in the meta data and in update policy attributes.

28
00:01:49,710 --> 00:01:54,190
You can also use intrinsic functions to conditionally create stack resources.

29
00:01:54,210 --> 00:01:56,310
So what are some of importance.

30
00:01:56,310 --> 00:02:01,850
I mean there are plenty and we will go now to a website and I'll show you the full list but get you

31
00:02:01,880 --> 00:02:06,180
to find in my reference or ref get Easy's import value.

32
00:02:06,180 --> 00:02:12,780
These are ones that you may use frequently when you are dealing with cloud formation templates and if

33
00:02:12,780 --> 00:02:18,970
you follow this your L you will get to the interesting function reference the list of intrinsic functions

34
00:02:19,020 --> 00:02:20,220
and what do they do and all that.

35
00:02:20,220 --> 00:02:24,600
Let's now head to their website and I'll show you the full list.

36
00:02:24,750 --> 00:02:25,610
And we'll go through.

37
00:02:25,610 --> 00:02:26,870
What do they do exactly.

38
00:02:26,930 --> 00:02:27,210
OK.

39
00:02:27,220 --> 00:02:32,130
So if you say all I have and in fact you wrote cloud formation is a guide template reference intrinsic

40
00:02:32,130 --> 00:02:33,350
functions reference.

41
00:02:33,360 --> 00:02:35,960
So this is the list of functions that we can have.

42
00:02:35,970 --> 00:02:42,870
Base 64 cyder blocks find the map get up get easies and other functions so let's look at the ones that

43
00:02:42,900 --> 00:02:44,300
are of interest to us.

44
00:02:44,340 --> 00:02:46,560
So let's look at the find the map.

45
00:02:46,560 --> 00:02:47,320
What does it do.

46
00:02:47,460 --> 00:02:53,640
So the finding map function call column finding map returns the value corresponding to two keys in a

47
00:02:53,640 --> 00:02:56,870
two level map that is declared in the mapping section.

48
00:02:57,080 --> 00:02:57,660
OK.

49
00:02:57,960 --> 00:03:00,790
And there is adjacent template and there's the template.

50
00:03:00,900 --> 00:03:02,190
And here we have an example.

51
00:03:02,190 --> 00:03:03,790
So here is the mapping.

52
00:03:03,870 --> 00:03:05,410
It's called a region map.

53
00:03:05,430 --> 00:03:12,050
And then I have the region the type of virtualization that I'm going to use and how many bits.

54
00:03:12,240 --> 00:03:16,520
And then you find the a.m.-I and if it is VMG to then a different might.

55
00:03:16,520 --> 00:03:20,980
So basically this is a lookup table then it has the region as a variable.

56
00:03:21,030 --> 00:03:26,280
It has the type of virtualization as a variable and then you get the value for what you are looking

57
00:03:26,280 --> 00:03:32,870
for which is they might use and here under the resources section I'm going to have in finding maps here

58
00:03:32,870 --> 00:03:39,510
is the function that I'm using the name of that is region map and here's the normal counterpart to that

59
00:03:39,890 --> 00:03:40,450
right.

60
00:03:40,470 --> 00:03:42,060
So let's look at the next one.

61
00:03:42,110 --> 00:03:42,890
Get attributes.

62
00:03:42,900 --> 00:03:44,090
What can I do with that.

63
00:03:44,140 --> 00:03:44,980
Get attribute.

64
00:03:45,030 --> 00:03:50,580
So the function call and call and get attribute intrinsic function returns the value of an attribute

65
00:03:50,580 --> 00:03:55,590
from a resource in the template like what like if you want to get the instance ID if you want to get

66
00:03:55,590 --> 00:03:57,720
the DNS name.

67
00:03:57,720 --> 00:03:59,310
And here's the format.

68
00:03:59,340 --> 00:04:03,160
And if you scroll down you can find an example here.

69
00:04:03,360 --> 00:04:04,800
Function get attribute.

70
00:04:04,800 --> 00:04:05,940
Where does that get at.

71
00:04:05,970 --> 00:04:08,040
What's the name of that attribute.

72
00:04:08,040 --> 00:04:10,370
I'm looking for my email be.

73
00:04:10,380 --> 00:04:13,620
If you go to my Ill be here get daisies in the next one.

74
00:04:13,620 --> 00:04:18,440
So it is easy returns an array that list it is on for a specified region.

75
00:04:18,450 --> 00:04:24,000
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

76
00:04:24,000 --> 00:04:27,530
available there and this will help you avoid too hard code.

77
00:04:27,570 --> 00:04:32,250
The list of everything zones for a specified region to get the parameter What is the list.

78
00:04:32,250 --> 00:04:34,890
What are the owns and act based on that.

79
00:04:34,920 --> 00:04:40,140
And here's an example function get everybody's own import value and then reference these will be the

80
00:04:40,140 --> 00:04:45,300
next to that we look at the function import value returns the value of an output exported by another

81
00:04:45,300 --> 00:04:50,940
stack like what if I have two groups developers and network an application or developer and the network

82
00:04:50,940 --> 00:04:54,260
are going to build the BBC they're going to put this up next day.

83
00:04:54,450 --> 00:05:00,120
I want now for the developers they want to launch an easy to instance but they need to get submit ideas

84
00:05:00,300 --> 00:05:06,920
or submit ID name that was created or the VBC details that was created by the network team.

85
00:05:06,930 --> 00:05:14,720
So now if the output of the stack configured or created by the network team includes these variables

86
00:05:14,730 --> 00:05:21,030
the BBC includes the subnet IDs and all that then these guys in the developers team they can reference

87
00:05:21,030 --> 00:05:29,060
that they can call that using the import value from the network stack output into the easy two instances

88
00:05:29,070 --> 00:05:33,990
or the developers or the application developers stack that template that they are creating.

89
00:05:33,990 --> 00:05:39,210
So if you want to do a cross-reference this is the craftier cross-reference between stacks then import

90
00:05:39,210 --> 00:05:41,900
value is a handy one that you can use.

91
00:05:41,910 --> 00:05:44,600
So here you have export in stack a.

92
00:05:44,670 --> 00:05:46,280
And these are the variables.

93
00:05:46,320 --> 00:05:52,260
And instead be I'm going to import as you can see here function import value and then the reference

94
00:05:52,260 --> 00:05:57,020
for what you're trying to get for the subnet ID from the other stack.

95
00:05:57,060 --> 00:06:03,290
If your important thing that you cannot delete a stack that you are referencing it's one of its outputs.

96
00:06:03,300 --> 00:06:04,500
You cannot do that.

97
00:06:04,560 --> 00:06:08,520
You cannot modify or remove an output value that is referenced by another stack.

98
00:06:08,520 --> 00:06:10,790
You cannot do that as well because you are importing it.

99
00:06:10,800 --> 00:06:16,150
And one important thing is that you cannot create the cross stack reference across regions.

100
00:06:16,200 --> 00:06:21,680
So things to keep in mind just in case if it pops up in one of the scenarios then you have that in mind.

101
00:06:21,700 --> 00:06:27,810
So we look at is reference let's see what difference does intrinsic function that returns the value

102
00:06:27,810 --> 00:06:30,090
of the specified parameter or resource.

103
00:06:30,090 --> 00:06:36,150
Now remember before when I said that when we have resources the resource can also be referenced from

104
00:06:36,300 --> 00:06:37,040
the output.

105
00:06:37,080 --> 00:06:42,060
And when we had the mapping the mapping could have been referenced from the resources then you need

106
00:06:42,060 --> 00:06:49,180
to use that F in order to point to something else to our parameter in a different section of the policy.

107
00:06:49,260 --> 00:06:56,130
And here we have an example then I'm referencing my easy to instance and that will be a part of the

108
00:06:56,130 --> 00:06:59,670
policy where you have my easy instance.

109
00:06:59,670 --> 00:07:02,730
So what will the reference return to you.

110
00:07:02,730 --> 00:07:09,480
It will return the instance ID from the section that included in the resources that included my instance

111
00:07:09,570 --> 00:07:10,510
my easy to instance.

112
00:07:10,540 --> 00:07:16,770
OK let's not talk about resource attributes so in the resources section each resource can have attributes

113
00:07:16,770 --> 00:07:18,840
different attributes so that of course you can.

114
00:07:18,920 --> 00:07:20,760
And we'll talk about them right now.

115
00:07:20,760 --> 00:07:27,620
They are used to further control additional resource relationships and behaviors of resources specified.

116
00:07:28,140 --> 00:07:31,280
And what are examples of that creation policy.

117
00:07:31,320 --> 00:07:33,060
Why would I need to do that.

118
00:07:33,090 --> 00:07:36,070
Why would I need to have a creation policy for that resource.

119
00:07:36,090 --> 00:07:37,390
Let's say you are creating.

120
00:07:37,440 --> 00:07:42,840
And you'll be on I'm not just kidding group and you don't want the auto Skilling group or that be to

121
00:07:42,840 --> 00:07:50,730
launch or to be created before the respective back end easy to instances will be created deletion policy

122
00:07:50,760 --> 00:07:55,140
if you want to retain or create snapshots or resources before they give you the template.

123
00:07:55,140 --> 00:07:56,280
Give me an example.

124
00:07:56,280 --> 00:08:00,990
I have an obvious one in half an hour the instance and I would like to keep the data in the database

125
00:08:01,050 --> 00:08:02,570
and I don't want that to be deleted.

126
00:08:02,580 --> 00:08:08,400
I can have a division policy attached to the resource that I've created for this instance.

127
00:08:08,400 --> 00:08:14,930
When the time comes to delete the stack snapshot it first before deleting or retain the audience instance

128
00:08:15,000 --> 00:08:16,120
don't delete it at all.

129
00:08:16,180 --> 00:08:21,390
That's the three buckets I wanted deleted it on retain it depends on so you can define dependencies

130
00:08:21,390 --> 00:08:26,880
between the source specifies the resource creation is dependent on the creation of another resource.

131
00:08:27,030 --> 00:08:33,150
If you want to add more meta data to your resources and update policy defines how the resource update

132
00:08:33,150 --> 00:08:37,920
should be carried out let's look at the creation policy to take the creation policy and I'll talk about

133
00:08:37,920 --> 00:08:41,520
the deletion policy in the next lecture because they are very important in the future.

134
00:08:41,520 --> 00:08:47,520
Frequently in the cloud for Mission questions in the exam so creation policy you can associate a creation

135
00:08:47,520 --> 00:08:52,500
policy attribute with a resource under the resources section in your template.

136
00:08:52,770 --> 00:08:59,520
Why to prevent its status from reaching create complete until something happened signals or some time

137
00:08:59,760 --> 00:09:00,470
has lapsed.

138
00:09:00,480 --> 00:09:06,240
When will the creation policy be invoked only when clutterer mission is going to create the associated

139
00:09:06,240 --> 00:09:06,660
resource.

140
00:09:06,660 --> 00:09:12,150
Because the creation policies are attached to the resource What are the resources that support creation

141
00:09:12,150 --> 00:09:19,830
policies now all or killing group instances and weight condition so use the creation policy attribute

142
00:09:19,830 --> 00:09:26,100
when you want to wait on the resource configuration actions before creation proceed so you have to hold

143
00:09:26,100 --> 00:09:29,480
everything until that happens and then you can persuade condition.

144
00:09:29,490 --> 00:09:30,340
Very important.

145
00:09:30,360 --> 00:09:35,040
So yes it is a cloud formation resource and the is weight condition.

146
00:09:35,070 --> 00:09:37,250
Use it with creation policy attribute.

147
00:09:37,260 --> 00:09:38,520
You can do the following.

148
00:09:38,520 --> 00:09:43,740
You can coordinate stack resource creation with other configuration actions that are external to the

149
00:09:43,740 --> 00:09:47,110
stack creation drag the status of a configuration process.

150
00:09:47,130 --> 00:09:48,010
Examples.

151
00:09:48,330 --> 00:09:53,280
You can start the creation of another resource after an application configuration is partially complete

152
00:09:53,670 --> 00:10:00,450
or you can send signals during an installation and configuration process to progress which would be

153
00:10:00,450 --> 00:10:05,110
important in finding out what happens especially if you're talking about test and development or in

154
00:10:05,130 --> 00:10:10,740
production such that if something happens you can go and look at the logs and the progress and find

155
00:10:10,740 --> 00:10:17,370
out what what happened and you can use it to instruct a mission to delay the creation of resources until

156
00:10:17,430 --> 00:10:20,880
an application has launched successfully on an easy to instance.

157
00:10:20,880 --> 00:10:21,440
Right.

158
00:10:21,690 --> 00:10:29,550
So that was the creation policy which is an resource attribute configured under a resource in your cloud

159
00:10:29,550 --> 00:10:32,640
formation resources section in your template.

160
00:10:33,050 --> 00:10:38,460
OK let's take a break and I'll come back and talk about an important attribute resources which is the

161
00:10:38,460 --> 00:10:40,100
deletion policy as well.

162
00:10:40,170 --> 00:10:42,540
But in the next lecture after the break I'll see you then.

163
00:10:42,600 --> 00:10:42,900
Thank you.
