So how could we now update our container here?
Let's say in our source code,
I revert all my extra exclamation marks
and I go back to just one exclamation Mark.
Now with the updated code,
run Docker build again
to build that image,
once you did that
make sure you also tag it again
to replace that repository image
with your locally updated image, so to say.
We could have also just used that name right away
when we built the image.
I just like this double image strategy,
but that's my own personal preference.
And then push this updated image to Docker Hub,
so that this latest image is reflected there.
Now the question just is,
how we make AWS ECS aware of this updated image.
It's not going to use it automatically,
and that's a good thing.
It would be kind of bad
if it magically updates behind the scenes.
Instead, we have to tell it
and you can do so by going to your clusters, default
and then there to your tasks
and click on your task definition of the task,
which is running here.
Now choose create new revision
which allows you to create a new task,
but keep all the settings you already have there.
So I just wanna create the same task again,
because then AWS ECS will automatically pull
the updated image.
When you create a new task
and then launch and use service in that task.
AWS will use the latest image version.
So, I'll create a new task revision
based on the same settings as before.
Now, once this task was updated
and you're on this confirmation page,
click on actions, update service,
keep all the settings here as well.
Click on skip to review
and click on update service here.
And this will now really pull in that latest image
and then restart this service in this task.
So if we now view this service, under tasks here
you will see all the tasks
and you'll see this new task revision
which is still provisioning here
which means it's still downloading the images on.
So let's wait for this to finish.
Now it's pending and now it's running
and then click on this task definition
and take this public IP.
And you'll see this application,
this updated application, there now.
Now you might have noticed
that the public IP is a different one than before.
This is true.
AWS will create and assign a new one
for every new task you are launching,
every new task revision you're launching.
But there are ways of actually still connecting a domain
to this running ECS task in general,
independent from the specific IP AWS assigned,
more on that can be found
in the resources attached to this lecture.
But that's now how we started our container
in AWS ECS or with help of AWS ECS,
how we can update it
and how we can now use this managed environment
to run our container in the cloud.