1
00:00:00,570 --> 00:00:11,460
In this video, you are going to learn a CDK core concepts, which is the EP stakes construct and environments.

2
00:00:13,280 --> 00:00:16,710
So let me start with the IPS in the Seed K project.

3
00:00:16,730 --> 00:00:22,820
Also, you can see the image on the slide and you can visualize in your brain how we can understand

4
00:00:22,820 --> 00:00:24,830
the CDK core concepts.

5
00:00:24,980 --> 00:00:26,930
But I would like to start with the EPP.

6
00:00:27,410 --> 00:00:33,560
The apps are trials that include everything needed to deploy your application to the cloud environment.

7
00:00:34,160 --> 00:00:39,670
IPS are executable programs and used to render and deploy a cloud formation template.

8
00:00:40,300 --> 00:00:43,580
And the second core concept is under the app.

9
00:00:43,600 --> 00:00:44,980
You can see this tech.

10
00:00:45,570 --> 00:00:53,850
So sticks are the unit of the deployment in the cdcc and we are calling this stack all a resource defined

11
00:00:53,850 --> 00:00:57,780
within a scope of a stake, either directly or indirectly.

12
00:00:57,810 --> 00:01:01,170
They are provisioned as a single unit of a stake.

13
00:01:01,940 --> 00:01:07,910
Because they see the case takes are implementing through a cloud formation stakes.

14
00:01:08,180 --> 00:01:14,540
So they had the same limitation as the is it is the cloud formation limitations.

15
00:01:15,110 --> 00:01:21,890
So as you know that a CDK is using a cloud formation on behind of the scene.

16
00:01:21,890 --> 00:01:25,130
So that's why the same limitations is in here.

17
00:01:25,130 --> 00:01:34,220
And SEC definition also performed at the cdcc and cloud formation is the same way you can define any

18
00:01:34,220 --> 00:01:37,580
number of stakes in your cdcc application.

19
00:01:37,820 --> 00:01:44,930
Any instance of the stake construct represent a stake and it can be either defined directly within the

20
00:01:44,930 --> 00:01:52,370
scope of the EP like the my first example showing the previous or indirectly by any construct within

21
00:01:52,370 --> 00:01:53,030
the tree.

22
00:01:53,090 --> 00:01:59,410
You can also see in the image we in the image we have one stick, but you can define a several stack

23
00:01:59,420 --> 00:02:01,130
in the under the application.

24
00:02:01,640 --> 00:02:05,000
So the third common concept is constructs.

25
00:02:06,170 --> 00:02:13,340
Constructs are the basic building block of the seed, shapes a construct, represent a cloud component

26
00:02:13,340 --> 00:02:18,590
and encapsulates everything a cloud formation needs to create the component.

27
00:02:18,950 --> 00:02:28,070
So a construct can represent a single aid resources such as an Amazon S3 bucket, or it can be a higher

28
00:02:28,070 --> 00:02:33,320
level abstraction consisting of multiple aid related resources.

29
00:02:33,920 --> 00:02:36,050
You can also see construct in the image.

30
00:02:36,050 --> 00:02:37,750
We have several construct.

31
00:02:37,760 --> 00:02:43,670
It can be representing one single, a resources or a combination of resources.

32
00:02:44,270 --> 00:02:52,340
Example of such components include a worker queue with its associated compute capacity or sick job with

33
00:02:52,340 --> 00:02:59,030
the monitoring resource and a dashboard so you can define your combination of constructs according to

34
00:02:59,030 --> 00:02:59,930
use cases.

35
00:03:01,700 --> 00:03:09,140
The A.W. CDK includes a collection of constructs called the ADA Construct Library and it containing

36
00:03:09,140 --> 00:03:11,720
constructs for every ADA services.

37
00:03:11,930 --> 00:03:18,500
Construct Hub is a resource to help you discover additional constructs from the ADA Place and third

38
00:03:18,500 --> 00:03:21,230
parties and the open source VDC community.

39
00:03:21,320 --> 00:03:28,250
So we have also construct up that you can check the these prebuilt combined constructs in that place.

40
00:03:28,910 --> 00:03:32,030
And another core concept is the environments.

41
00:03:32,240 --> 00:03:40,520
Each state instance in your ADA SDK application is explicitly or implicitly associated with an environment,

42
00:03:41,120 --> 00:03:47,690
and environment is the target a account and the region into which state is intended to be deployed.

43
00:03:49,190 --> 00:03:55,430
If you don't specify an environment, when you instantiate a stick, the stick is said to be environment

44
00:03:55,430 --> 00:03:56,300
agnostic.

45
00:03:56,600 --> 00:04:03,800
A place cloud formation templates synthesized from such a stick will try to use the term resolution

46
00:04:03,800 --> 00:04:11,150
on the environment related attributes such as stake so we can get it, state that account or stake that

47
00:04:11,150 --> 00:04:14,180
region and take that away zones from the environment.

48
00:04:14,180 --> 00:04:17,510
Related Attributes into the SDK application.

49
00:04:17,900 --> 00:04:24,980
In an environment agnostic stack, any constructed use available to zones will see two of them allowing

50
00:04:24,980 --> 00:04:27,320
to stick or to be deployed in region.

51
00:04:28,250 --> 00:04:34,070
So if you look at the image on the slide, you can see that CDK application can be different languages

52
00:04:34,070 --> 00:04:41,210
inside the app you have syntax or one stick six are included a set of constructs.

53
00:04:41,210 --> 00:04:49,430
The constructs are representing the resources and CDK constructs can depend or complicate each other.

54
00:04:50,480 --> 00:04:57,500
So when CDK deployed the application, this will create a cloud formation template document and this

55
00:04:57,500 --> 00:05:02,750
will send to the cloud formation in order to provision resources on a cloud.

56
00:05:04,770 --> 00:05:06,450
So let's see an example.

57
00:05:06,480 --> 00:05:11,910
Cdcc application, which includes IPS, stakes, constructs and environments.

58
00:05:12,180 --> 00:05:18,720
We call your CDCR application as an app which is represented by the CDCR class.

59
00:05:18,720 --> 00:05:20,040
Which name is app?

60
00:05:20,100 --> 00:05:27,550
You can see the import app statement in the first state and you can see this light on the example code

61
00:05:27,570 --> 00:05:35,070
defines an app with a single state unit that consists a single Amazon S3 bucket with Virgin enabled.

62
00:05:39,130 --> 00:05:44,890
So if you look at the code on the slide, you can see that we are extending this to class and we are

63
00:05:44,890 --> 00:05:47,010
creating our own halo.

64
00:05:47,050 --> 00:05:57,870
CDK Stick+ and in this stick+ we basically creating an S3 bucket and this will be including our LCD

65
00:05:58,210 --> 00:06:04,120
stack and this will be deployed S3 bucket in our cloud environment.

66
00:06:04,240 --> 00:06:12,700
And of course you can see that this class will be starting point is creating a new application and after

67
00:06:12,700 --> 00:06:20,770
creating a new app, we basically paste this app into the Halo CD case class, which is getting this

68
00:06:20,770 --> 00:06:25,720
parameter in the constructor and give the name of the CD case take name.

69
00:06:25,840 --> 00:06:32,950
So by this way, one CD K creating this Halo sidekick class, it comes from the constructor and getting

70
00:06:32,950 --> 00:06:36,670
the application and into that application, creating a new stake.

71
00:06:36,670 --> 00:06:41,680
And in this stack they are creating a state bucket in our target account.

72
00:06:43,090 --> 00:06:47,860
So as you can see, you need a scope within which you define a bucket.

73
00:06:48,340 --> 00:06:55,080
Of course we should define a scope, since resources eventually need to be deployed as part of the cloud

74
00:06:55,090 --> 00:07:01,750
formation stake into an environment which covers a specific account and a region.

75
00:07:01,990 --> 00:07:05,950
So place constructs such as S3 bucket entry.

76
00:07:05,950 --> 00:07:12,820
In here a steel bucket is a construct must be defined within the scope which is stick.

77
00:07:13,060 --> 00:07:21,940
So in this scope stake from here to here, we are a stake of the scope and we can define the construct

78
00:07:21,940 --> 00:07:23,080
between the scope.

79
00:07:24,700 --> 00:07:30,730
Stakes in a CDK application extend to stack based class as shown in the example.

80
00:07:31,390 --> 00:07:39,640
And this is the common pattern when creating a stick within your CDCR app and it extends the state clause.

81
00:07:39,640 --> 00:07:48,940
Define a constructor that accepts scope ID props and invoke the basic class constructor where permitted

82
00:07:48,940 --> 00:07:56,110
with the received scope ID and props as shown in the slide, you can see that every constructor has

83
00:07:56,110 --> 00:07:59,140
three parameters scope, ID and props.

84
00:07:59,170 --> 00:08:05,950
We will see details in the upcoming videos, but it is good to see that how we can define CDCR application

85
00:08:05,950 --> 00:08:11,910
and creating a new edible resources bit using the CDK example code.
