-: In the last section, we finished
up just about everything on the AWS dashboard.
There's one last little thing we have to do
and it's tied to the deployment that we're gonna set
up inside of our travis.yml file.
Remember, at this point, inside of the travis.yml file
we're currently building the production version of all
of our images, and then we push them off to Docker Hub.
Now, I have said, several times,
that after we do all that stuff,
we're going to then, kind of, tap on the shoulder.
Here we go, gonna kind of tap on the shoulder
of Elastic Beanstalk and say, "Hey, it's time
for you to go and pull these new images and deploy them."
So, I'm gonna be honest with you
when I said, "kind of tap on the shoulder",
I made it sound like it was a different deployment process
than what we had done on the previous application.
In reality, it's gonna be no different.
We're going to still deploy the entire application
over to Elastic Beanstalk.
The only difference this time around is that the only file
that we really have to deploy is the,
or send over to Elastic Beanstalk,
is the Dockerrun.aws.json file.
We're gonna send the entire project
over to Elastic Beanstalk, but in reality
this is the only file that we really have to send.
Once Elastic Beanstalk gets this file,
it's going to pull these images
from Docker Hub and take it away from there.
But again, I've been saying like, "Oh yeah,
we're gonna send a little notification."
There's not really a notification.
We're just gonna dump the entire project
over the same way, we did previously.
Now, I've got the Travis file from our previous project.
Remember, this is the single container application
that we just put together
and here's what we did for the Deploy section.
So we had to set up the provider as Elastic Beanstalk,
specified the region, app, environment, blah, blah, blah,
all this different stuff.
And one of the real keys in here
was providing the access key ID
and the secret access key as well.
And these were both set as environment variables
on our Travis CI dashboard.
So, in this section, we're gonna generate
a new AWS access key and secret key
on the IAM dashboard on AWS.
And then we'll assign those as environment variables
to our Travis build.
So, let's get to it.
So, to get started, I'm gonna open my AWS dashboard back up.
I'll go to Services and we will again go to IAM.
And then, on the left hand side, I'll find the User Section
because we're going to create a new user
with deploy access to Elastic Beanstalk.
So I can click on that Add User button, and then
I will use a username of something like, Multidocker.
How about Multidockerdeployer?
That makes sense.
And then we'll give it an Access Type
of Programmatic Access.
And then Permissions.
Again, we're going to attach existing policies directly.
I'll do a search for Elastic, actually, we'll do just
Beanstalk is probably the easier one to search for.
And then, we're just gonna add everything
straight down here.
Just toss it all on.
We could definitely go a little bit
more fine-grained, but for right now,
I just want something that's going to work as it stands.
I'll then do Next Review,
and then we'll do a Create User.
Now, this is gonna show us the user,
the access key ID and the secret access key.
Remember, the secret access key right here
is something that you do not want to share
with the outside world, whatsoever.
And of course, you can try to use my secret access key
but by the time you watch this video
I will have deleted it, because we've gotta be
responsible with those secret access keys.
So now, that we've got the keys right here
we'll open up Travis CI again and set these up
as encrypted variables on the dashboard.
So, I've still got my Travis dashboard open.
As a quick reminder, you can get here
by going to travis-ci.org.
Once over here, you're gonna make sure that you
open up the Multi-docker project.
So make sure that you are not looking at Docker-react.
This is bad.
We're gonna look at Multi-docker.
We'll then go over to Options, Settings,
and then we're going to add
in some new environment variables.
And of course, we can still see the Docker ID
and password that we had previously set up.
So the first variable we will set up is the AWS Access Key.
And then I'll copy over the access key
and paste it in as the value.
Now, like I just said, a moment ago,
"Please triple check the spelling on the key right here."
So AWS Access Key,
Make sure it's got the two C's and two S's in it.
And then, I'll add that thing.
And then, we'll do the same thing for AWS Secret Key.
And, I'll copy the secret key over here,
and paste it in as the value.
And again, please triple check.
Make sure you spelled secret correctly,
especially the word secret.
This is a very easy word, believe it or not, to misspell.
And, we'll click on Add, and that's pretty much it.
Okay, so we've set up our environment variables over here.
So, now, the last thing we need to do is add
on our little deploy script
at the very bottom of the travis.yml file.
So, let's take care of that in the next section.
So, quick break and I'll see you in just a moment.