1
00:00:00,610 --> 00:00:05,170
In this video, we are going to develop our SDK application.

2
00:00:05,620 --> 00:00:12,030
So basically we are going to add an Amazon SDK SKU into our Halo CDK stack.

3
00:00:12,580 --> 00:00:20,470
So as you remember that in this diagram we have a double SDK application, which name is Halo CDK and

4
00:00:20,470 --> 00:00:23,800
we have a one stack, Halo, CDK stack.

5
00:00:23,920 --> 00:00:32,240
And now I'm going to create an X construct into our stick in order to deploy using database transformation.

6
00:00:32,730 --> 00:00:36,520
So now we are in the development phase for that reason.

7
00:00:36,700 --> 00:00:48,130
PS Open the Our Halo CD K application, close this terminal and open the Live for the Halo CD case type

8
00:00:48,130 --> 00:00:49,010
secret clause.

9
00:00:49,600 --> 00:00:50,560
Okay, very good.

10
00:00:50,710 --> 00:00:58,870
The CD case Amazon is case support is part of its main library a list CDK has main library.

11
00:00:58,870 --> 00:01:00,320
Which name is the ADA?

12
00:01:00,340 --> 00:01:02,440
Ada CD k live library.

13
00:01:02,440 --> 00:01:04,840
So we don't need to install another library.

14
00:01:04,870 --> 00:01:07,450
We can see there is some import statements in here.

15
00:01:07,450 --> 00:01:11,980
So we are using the main library which includes all of the details.

16
00:01:12,010 --> 00:01:15,700
We don't need to install a separate library.

17
00:01:16,180 --> 00:01:16,870
Okay.

18
00:01:17,140 --> 00:01:21,910
So first of all, let me show you the package JSON dependencies.

19
00:01:21,910 --> 00:01:28,150
But before that, we can just define an Amazon case in this stack using the using the case construct.

20
00:01:28,300 --> 00:01:35,290
Here is an example already in place on our code with commented, we will writing from scratch and you

21
00:01:35,290 --> 00:01:39,730
can see one import statement in here and also we have an example of source in here.

22
00:01:39,910 --> 00:01:46,600
So before that I would like to see package JSON, open the package JSON and make sure that on the dependencies

23
00:01:46,600 --> 00:01:49,960
you have a CDK library.

24
00:01:49,960 --> 00:01:55,660
This is the main library that includes all of the level two constructs which defined.

25
00:01:55,660 --> 00:02:02,700
So this package have almost all the level to construct defined and we can use them into our Stick+ OC

26
00:02:02,800 --> 00:02:10,570
Very good to open the hello CDK TypeScript secret class and you can uncomment the queue part or we can

27
00:02:10,570 --> 00:02:12,160
write it together.

28
00:02:12,580 --> 00:02:16,360
Let me refactor or writing from scratch.

29
00:02:16,480 --> 00:02:22,510
So I would like to write from the beginning with you in order to do that.

30
00:02:24,650 --> 00:02:27,560
I'm creating a new career defining.

31
00:02:28,780 --> 00:02:35,590
Q definition in here is you can say that this is like creating a variable, right?

32
00:02:35,590 --> 00:02:41,850
I'm creating a Q variable in here and basically instantiate with nib.

33
00:02:41,890 --> 00:02:52,150
Q You can see that we have also autocomplete and once I am click these enter the Q clause under the

34
00:02:52,570 --> 00:02:54,940
seed Caleb Edwards case.

35
00:02:55,510 --> 00:03:01,900
You can see the one import statement is automatically added, which is the import.

36
00:03:01,930 --> 00:03:07,930
Q From the a seed Caleb slash a Douglass asks so very good.

37
00:03:08,110 --> 00:03:13,190
This is the level to construct which defined by the seed team.

38
00:03:13,990 --> 00:03:14,720
Which name is.

39
00:03:14,740 --> 00:03:21,140
Q These are predefined constructs, including required configurations, IAM permissions and so on.

40
00:03:21,160 --> 00:03:27,370
You remember the level to construct which is developed by Cdcc team and it is handled lots of predefined

41
00:03:27,580 --> 00:03:35,170
configurations and lots of permission issues they are solving into the Cdcc and Cdcc has lots of level

42
00:03:35,170 --> 00:03:38,380
two constructs that I will show you later how we can see it.

43
00:03:38,380 --> 00:03:45,460
Define for example, HDD Bucket Lambda Functions API gateway is grace and sass advantage and so on.

44
00:03:45,460 --> 00:03:50,740
We will develop all these these kind of level two constructs into our application.

45
00:03:51,700 --> 00:03:58,300
So now it is important to know that this is the defined construct and we will create an instance and

46
00:03:58,300 --> 00:03:59,970
it required some parameters.

47
00:03:59,980 --> 00:04:06,640
If you go to definition of Q, if you right click and go to definition or collective 12, you can see

48
00:04:06,640 --> 00:04:08,440
the constructor in here.

49
00:04:08,860 --> 00:04:12,250
So see that there are three parameter requirements.

50
00:04:12,310 --> 00:04:13,630
The first one is the scope.

51
00:04:13,810 --> 00:04:17,830
Scope basically tests the queue that the stake is in Sprint.

52
00:04:17,830 --> 00:04:23,380
So it is a scope indicating the parent, it is defined within the scope of the stack.

53
00:04:23,380 --> 00:04:31,570
So you can define the construct inside of the construct, creating a higher hierarchical construct tree.

54
00:04:31,570 --> 00:04:37,120
So here and in most cases the scope is using this keyword.

55
00:04:37,600 --> 00:04:41,860
So a meaning that this construct that contains the Q in the state.

56
00:04:42,190 --> 00:04:50,770
So once we are creating a queue, we are placing this cable in here in order to adding to record in

57
00:04:50,770 --> 00:04:51,610
the stack.

58
00:04:51,610 --> 00:04:58,090
Or you can also define hierarchical construct three with pacing the construct in in this place.

59
00:04:58,540 --> 00:05:06,940
Okay, the second parameter is the ID ID is the logical ID of the queue within the CDK application.

60
00:05:07,090 --> 00:05:14,300
This name, plus a hash based generated uniquely identifies name will be assigned by the one deploying

61
00:05:14,320 --> 00:05:15,160
the application.

62
00:05:15,820 --> 00:05:23,830
So that means, for example, I'm giving the name McHugh and also a double is adding McHugh plus hash

63
00:05:23,860 --> 00:05:30,730
generated unique identifier number or keyword that we are going to deploy our application.

64
00:05:30,730 --> 00:05:35,890
We see this unique identifier like wheat or hash based parameter.

65
00:05:35,890 --> 00:05:39,340
The name is generated by the alias OC.

66
00:05:39,370 --> 00:05:41,980
The third parameter is props.

67
00:05:42,550 --> 00:05:47,400
That means properties, a bundle of values that define properties of the Q.

68
00:05:47,440 --> 00:05:52,080
Here we have defined only one property, which is the visibility timeout.

69
00:05:52,210 --> 00:05:56,170
You can go back in here and see the property definition in here.

70
00:05:56,410 --> 00:06:02,800
They are setting the visibility timeout property, but you can see all properties under the Q properties.

71
00:06:03,430 --> 00:06:03,950
Okay.

72
00:06:04,240 --> 00:06:08,890
We basically set only visible the timeout, which enables the visible timeout for the Q.

73
00:06:09,340 --> 00:06:16,180
So all constructs take these same tree elements when you see when you see the any level to construct,

74
00:06:16,540 --> 00:06:17,380
construct.

75
00:06:18,310 --> 00:06:22,300
Every construct has three parameter one creating this construct.

76
00:06:23,350 --> 00:06:27,940
So these are the three arguments, always the same for the old constructs.

77
00:06:27,940 --> 00:06:35,050
So it is easy to stay oriented as you learn about the new ones and as you might expect, you can subclass

78
00:06:35,050 --> 00:06:40,750
any construct to extend it, suite your needs or you just change its default values.

79
00:06:41,470 --> 00:06:48,160
Now it's come back to our main stick+ and now I'm continuing to creating an Amazon case.

80
00:06:48,160 --> 00:06:55,870
So once we run into Q, we basically automatically importing the Q statement from the SDK library,

81
00:06:56,170 --> 00:07:00,040
and now I am going to define these three parameter.

82
00:07:00,070 --> 00:07:08,950
If you open your bracket, you can see the inline explanation I'm going to now giving the scope and

83
00:07:08,950 --> 00:07:11,170
pasting this cable to construct.

84
00:07:11,170 --> 00:07:17,200
By this way, this means that my stick+ under the mistake we are going to create a queue.

85
00:07:17,470 --> 00:07:22,810
So that means if you come here under the stick, I'm going to create a SGS queue.

86
00:07:22,840 --> 00:07:30,790
So in code way we passing this keyword and putting comma and now it's time to my name.

87
00:07:30,790 --> 00:07:34,770
I can basically say that halo cdk.

88
00:07:38,240 --> 00:07:38,730
True.

89
00:07:39,350 --> 00:07:48,290
So once when we are deploying this stick, it is adding some hash numbers and deploying with Disney.

90
00:07:50,360 --> 00:07:53,990
So the last parameter is the props.

91
00:07:54,020 --> 00:07:56,300
You can see the Q props in here.

92
00:07:56,660 --> 00:07:59,300
I'm going to open a curly bracket.

93
00:07:59,300 --> 00:08:08,360
And if you hit the control and space, you can see the available properties about the Q definition.

94
00:08:08,390 --> 00:08:14,240
There are lots of definitions that you can see that as you can see this very powerful that you are using

95
00:08:14,360 --> 00:08:18,410
with any Visual Studio code or any programming language.

96
00:08:18,440 --> 00:08:20,570
You can see the in line explanation.

97
00:08:20,570 --> 00:08:23,830
So for example, I'm using the visibility timeout.

98
00:08:23,840 --> 00:08:31,430
You can see that we can basically set the visible timeout by giving a defining under the Q props.

99
00:08:31,700 --> 00:08:40,430
So basically I'm giving the duration that things if you write the duration, you can see also duration

100
00:08:40,430 --> 00:08:43,280
comes from the CDK based library.

101
00:08:43,550 --> 00:08:48,910
And with duration I would like to get the seconds to 300.

102
00:08:48,920 --> 00:08:51,530
So that means 5 minutes visible to timeout.

103
00:08:53,750 --> 00:08:54,470
That's all.

104
00:08:54,500 --> 00:08:59,810
With this line of code, we are creating the Amazon case under the our CDK.
