In this video, we are going to develop our SDK application.
So basically we are going to add an Amazon SDK SKU into our Halo CDK stack.
So as you remember that in this diagram we have a double SDK application, which name is Halo CDK and
we have a one stack, Halo, CDK stack.
And now I'm going to create an X construct into our stick in order to deploy using database transformation.
So now we are in the development phase for that reason.
PS Open the Our Halo CD K application, close this terminal and open the Live for the Halo CD case type
secret clause.
Okay, very good.
The CD case Amazon is case support is part of its main library a list CDK has main library.
Which name is the ADA?
Ada CD k live library.
So we don't need to install another library.
We can see there is some import statements in here.
So we are using the main library which includes all of the details.
We don't need to install a separate library.
Okay.
So first of all, let me show you the package JSON dependencies.
But before that, we can just define an Amazon case in this stack using the using the case construct.
Here is an example already in place on our code with commented, we will writing from scratch and you
can see one import statement in here and also we have an example of source in here.
So before that I would like to see package JSON, open the package JSON and make sure that on the dependencies
you have a CDK library.
This is the main library that includes all of the level two constructs which defined.
So this package have almost all the level to construct defined and we can use them into our Stick+ OC
Very good to open the hello CDK TypeScript secret class and you can uncomment the queue part or we can
write it together.
Let me refactor or writing from scratch.
So I would like to write from the beginning with you in order to do that.
I'm creating a new career defining.
Q definition in here is you can say that this is like creating a variable, right?
I'm creating a Q variable in here and basically instantiate with nib.
Q You can see that we have also autocomplete and once I am click these enter the Q clause under the
seed Caleb Edwards case.
You can see the one import statement is automatically added, which is the import.
Q From the a seed Caleb slash a Douglass asks so very good.
This is the level to construct which defined by the seed team.
Which name is.
Q These are predefined constructs, including required configurations, IAM permissions and so on.
You remember the level to construct which is developed by Cdcc team and it is handled lots of predefined
configurations and lots of permission issues they are solving into the Cdcc and Cdcc has lots of level
two constructs that I will show you later how we can see it.
Define for example, HDD Bucket Lambda Functions API gateway is grace and sass advantage and so on.
We will develop all these these kind of level two constructs into our application.
So now it is important to know that this is the defined construct and we will create an instance and
it required some parameters.
If you go to definition of Q, if you right click and go to definition or collective 12, you can see
the constructor in here.
So see that there are three parameter requirements.
The first one is the scope.
Scope basically tests the queue that the stake is in Sprint.
So it is a scope indicating the parent, it is defined within the scope of the stack.
So you can define the construct inside of the construct, creating a higher hierarchical construct tree.
So here and in most cases the scope is using this keyword.
So a meaning that this construct that contains the Q in the state.
So once we are creating a queue, we are placing this cable in here in order to adding to record in
the stack.
Or you can also define hierarchical construct three with pacing the construct in in this place.
Okay, the second parameter is the ID ID is the logical ID of the queue within the CDK application.
This name, plus a hash based generated uniquely identifies name will be assigned by the one deploying
the application.
So that means, for example, I'm giving the name McHugh and also a double is adding McHugh plus hash
generated unique identifier number or keyword that we are going to deploy our application.
We see this unique identifier like wheat or hash based parameter.
The name is generated by the alias OC.
The third parameter is props.
That means properties, a bundle of values that define properties of the Q.
Here we have defined only one property, which is the visibility timeout.
You can go back in here and see the property definition in here.
They are setting the visibility timeout property, but you can see all properties under the Q properties.
Okay.
We basically set only visible the timeout, which enables the visible timeout for the Q.
So all constructs take these same tree elements when you see when you see the any level to construct,
construct.
Every construct has three parameter one creating this construct.
So these are the three arguments, always the same for the old constructs.
So it is easy to stay oriented as you learn about the new ones and as you might expect, you can subclass
any construct to extend it, suite your needs or you just change its default values.
Now it's come back to our main stick+ and now I'm continuing to creating an Amazon case.
So once we run into Q, we basically automatically importing the Q statement from the SDK library,
and now I am going to define these three parameter.
If you open your bracket, you can see the inline explanation I'm going to now giving the scope and
pasting this cable to construct.
By this way, this means that my stick+ under the mistake we are going to create a queue.
So that means if you come here under the stick, I'm going to create a SGS queue.
So in code way we passing this keyword and putting comma and now it's time to my name.
I can basically say that halo cdk.
True.
So once when we are deploying this stick, it is adding some hash numbers and deploying with Disney.
So the last parameter is the props.
You can see the Q props in here.
I'm going to open a curly bracket.
And if you hit the control and space, you can see the available properties about the Q definition.
There are lots of definitions that you can see that as you can see this very powerful that you are using
with any Visual Studio code or any programming language.
You can see the in line explanation.
So for example, I'm using the visibility timeout.
You can see that we can basically set the visible timeout by giving a defining under the Q props.
So basically I'm giving the duration that things if you write the duration, you can see also duration
comes from the CDK based library.
And with duration I would like to get the seconds to 300.
So that means 5 minutes visible to timeout.
That's all.
With this line of code, we are creating the Amazon case under the our CDK.