‫So let's have a look
‫at these options in the Task definition menu.
‫So let's create a new task definition,
‫and also demo-taskdef.
‫Okay, so as we can see we can have a Container-1
‫it's called in Essential container,
‫and if it stops the whole task stops.
‫But you can define multiple containers in here.
‫Container-2 as well as Container-3.
‫And each of these containers are defined the exact same way.
‫And you can say whether or not each of these containers
‫is an essential container or not.
‫Essential means that if it stops then
‫the whole ECS task is going to stop.
‫Else if it crushes then it's not needed.
‫So you can define multiple containers
‫and the pattern for this could be
‫to have a sidecar container,
‫for example, to gathering logs and metrics.
‫So let's assume we only have one container.
‫Then you need to enter a name for your image.
‫So wordpress, and then image URI wordpress.
‫Then you define the port mapping
‫and you specify on this container,
‫which ports are exposed.
‫For example, wordpress, if it exposes the port 80,
‫then I would set up 80 TCP.
‫We can add more port mappings if you wanted to,
‫if more ports were exposed by wordpress.
‫Next for Environment variables,
‫you can either add them individually within both key value.
‫Or you can add them from a file,
‫and you specify them as an S3 bucket file.
‫And currently, because this UI is new for ECS,
‫then it does not allow you to specify environment variables
‫from the sequence manager
‫or the SSM prime manager store.
‫But you can do it using the older version
‫or the GSM form or CloudFormation.
‫And at some point I'm sure the UI will show a way
‫to take data and to inject variables.
‫Directly from the SSM prime manager store
‫and the secrets manager service.
‫So let's click on next.
‫So of course, I'm going to remove these.
‫Click on next.
‫Then you define the app environment.
‫So whether or not it can be launched
‫on Fargate or on Amazon EC2 instances.
‫So it's a type of launch type for ECS test definition.
‫Then the operating system, how much memory
‫and Ram you're going to need, memory
‫and CPU you're going to need for your containers.
‫And finally, if you want to have a task role.
‫So for example, if you want
‫to create a specific task role
‫that will allow your containers to make API request
‫to the different AWS services.
‫And then you can create your role and specify it here.
‫For storage, this is very important.
‫This is where for example,
‫you would set up a Bind mount, okay.
‫And you would give your volume name,
‫for example, DemoBind.
‫And here you would say how this volume is mounted
‫onto each of your containers.
‫And this will allow your containers
‫to communicate with one another.
‫So I'm going to remove this.
‫And then if you want to have monitoring and logging
‫so either you have a sidecar
‫or you can directly enable monitoring and logging directly
‫from the test definition
‫and you have some predefined log collection mechanism.
‫For example, CloudWatch is defined.
‫We can also send logs
‫to Firehose, Kinesis Stream, OpenSearch
‫or Amazon S3 via a service called FireLens.
‫Okay. You can also enable trace collection
‫to just get tracing data directly from x-ray
‫or metrics collection to send metrics
‫to either CloudWatch Prometheus in two different ways.
‫Okay.
‫Finally, you can tag your ECS test definition
‫if you're ever needed to.
‫Click on next.
‫And then you have seen all the parameters
‫for your test definition
‫and I hope that helps you understand the previous lecture.
‫Okay. That's it for this lecture.
‫I hope you liked it.
‫And I will see you in the next lecture.