So outputs.
Let's talk about outputs.
And that's actually a very popular exam question so pay attention.
The output section is optional but we can declare optional outputs.
And if we export these outputs we'll be able to import their values into other stacks and by stack I
mean confirmation templates so you can start linking your cloud formation templates.
We can also view the outputs in the areas console or using them as Seelye.
So it allows us to quickly retrieve the value of an outputs it straight from using the the UI in terms
of example.
For example you can have a network cloud formation template and then you would export outputs that would
be for example the VPC I.D. and the subnet I.D. and you would reuse those into other confirmation templates.
And so it enables to do a cross tech collaboration where you let the experts handle their own part.
So the VPC and the subnet and you as an app developer you just reference these values out of the box.
Something as should know though is that if you start using the cloud formation outputs and they start
being referenced from another cloud formation tax stack you can not delete a stack that still has outputs
being referenced somewhere else.
So it's just something to note.
Now if we look at an example of the outputs in this one we are creating a SSD such security group as
part of the templates and so we export that value as an output.
Okay.
And basically other templates will be able to get the value of that security group.
So the syntax is pretty easy.
We have the output section right here and we have the name of the security group and we have a description.
So the SSA actually carried a group for our company.
Here is the value so we provide a reference of the security group where that was created within the
resources and then we have to specify this export block right here.
Okay.
This is an optional block.
If you don't specify it then the value does not get exported and it will not be able to be imported.
So when we specify the export value we can say okay this value this SSL security group I.D. is going
to be exported as the name SSA each security group.
So now how do we import that value.
Well using a cross tech reference and so we'll create a second template that averages that security
group and for this we'll use the F an import value function.
Interesting function and we can't delete again the previous tag until all this time will be deleted.
So if we look at this little snippet of code right here we can see that for the security groups at the
very bottom there is a shorthand syntax for import value and then we reference the exact same name as
before called SSA each security group.
So just a reminder before we exported the value as SSA each security group.
And here we import the value SSA each security group.
So you know um outputs and exports are very very popular question at the exam especially if they start
asking you how do you link cloud formation templates or which you the value from one to another.
So you should know about it.
You should know about the syntax and you should know about the import value function.
So I hope that was helpful.
And we'll see you in the next lecture.