Finally we're going to talk about the conditions and so conditions are used to control the creation
of resources or outputs based on some statements logical statements and the conditions can be whatever
you want them to be.
But the common ones are that maybe you want to say if you're in dive or if you're interested or if you're
in project create or don't create that resource maybe it can be based on the region maybe based on the
perimeter value.
And so each condition can reference another condition private value or mapping so you can compose them.
And so to define them to make it a bit more concrete.
Here is a condition that I've created under the block conditions.
And so we hear we say okay do we want you create the production resources and for this you need to have
the environment type in that maybe you Pam enter this environment type right here.
We need to have the reference.
So the value of this parameter to be equal to prod be our ODA the string prod.
And so here basically this whole thing is going to be true only if the environment is equal to broad.
And so using this broad resources we're able to basically define and condition other resources.
So it's up to you how you want to choose it.
And so the all the function you can use in there are going to be and equals if not or or.
And so these are logical functions and you can compose them as much as you want.
Now how do we use a condition.
Well you can apply it as a set of resources outputs et cetera.
And so if we look at a resource for example my mounts points at the type of it is a it was easy to volume
attachments.
And this only gets created if the condition creates proud resources from before is true.
So that gives you an idea of how conditions are used basically on the same level as the type.
Right here underneath the name of the resource.
So that's it for conditions.
I think they're pretty much advance.
I'm not sure they're asked at the exam but for you it's still good to know about them that the exists
and you can have some a little bit more logic in your in your confirmation templates.
I hope that was helpful.
And I will see you in the next lecture.