[Music]
hello everybody
my name is latin i'm a senior solutions
architect for amazon web services
i'm part of our partner team i'll be
talking to you today about
deploying.net applications on ec2 uh
possibly the easiest and
most straightforward thing that you can
do the tip of the iceberg
of great and awesome things that you can
do on aws with
uh.net as a.net developer
so before i begin i wanted to uh mention
that we
just uh published a net core chatbot
application
uh um with source code that takes
advantage of amazon lags which
is a service that alexa uses aws lambda
which is our serverless code service and
amazon cognito identity now this awesome
source code
in turn takes advantage of our cdci
options from using code commit or github
code commit being our version of git and
also code build and code deploy code
bill for building the code code deploy
for deploying it
with code pipeline doing the
orchestration of all of this together
and if you go to the to the url at the
middle of your screen
it will take you step by step on how to
deploy and configure this
great stuff the best way
to deploy your source code right now and
the easiest way to do so is by means of
elastic beanstalk
the lasting beast has several benefits
it's fast
uh increases your productivity it's
impossible to outgrow
and it has a complete control of uh
all the resources that you need
what do we mean by fast and simple
basically all you have to do is just
point it to your source code
and elastics beanstalk will do the rest
it will follow the best practices on
hard does it it will take advantage
of our key services like auto scaling
group and uh elastic
load balancer and and it will automate
the entire thing end to end
how does it increase your developer
productivity well
it will provision and operate the entire
infrastructure that you need as a
developer
developer to develop this and and uh
test
as well as deploy the code um it will
manage your entire application stack
and it will allow you to just focus on
writing code
and nothing else it's going to really
kind of
bring it down to the lowest common
denominator like it does with our
serverless
code lambda and so on so
all you have to do just live in your
visual studio
and let the infrastructure be taken care
of by elastic beanstalk
impossible to outgrow it automatically
scales
your application up and down so not only
does it this is going to scale the
application
uh based on the traffic that your
application may get
and as well as your services or api that
you may deploy via
elastic beanstalk but it also scales it
down when you're not using it so not to
waste any of the
money and be as cost effective as
possible
bringing about one of the key
differentiators and reasons
why you decided to move to cloud to
begin with
it's using cloudwatch metrics to trigger
these scaling actions
whether it goes up or down you have all
of the
resources under your control you
you can you can use them to
also track down you know any changes in
your infrastructure
and and choose whichever elements you
want to use and how you want to use them
most of the things are fully automated
you have full configuration management
of your environment and and you know as
such
ops teams know what you're doing they
can easily find out you will know
and everything that is tiresome is fully
automated for you
what are the common use cases websites
which i'm going to show you shortly in a
demo
api back ends mobile back and
asynchronous workers
that you may be using so how does the
environment look like once it's actually
deployed onto ec2
so this is a kind of overall picture
where your users are coming out from the
internet or whether whether they're
coming out
internally from your company into aws
via vpn or direct connect you
you can either take advantage of
internal application load balancer
or external ones uh without the need to
deploy any of the
um you know web components uh into
um into what you know what you would
normally call dmz
or public subnet um ensuring
you know full uh security um
and isolation um and uh you can take
advantage
of any of the other services you can
incorporate into our current
set of devops services as well
such as code pipeline and use it in
favor of
uh services like codeploy if you choose
to
and make it part of a larger cdci
pipeline solution for your organization
enterprise it's
important to note as well that um the
the auto scaling groups that i mentioned
before they power
uh applications of some of our you know
of all of our customers in fact and that
is
itself is a testimony to the industrial
strength
uh of uh the auto scaling service and
uh how it works in conjunction uh with
cloud watch alarms
uh to to address the increased need
for capacity now i'm going to show you a
demo of how to fully configure
elastic beanstalk environment together
with auto scaling and load balancer
and and ec2 instances
and then we i'm going to switch over to
a.net application that i have running in
my visual studio 2017
with aws toolkit and i'm going to show
you how easy it is to
build and one click deploy directly into
aws
via elastic bean stroke hopefully you'll
see how easy
and quick it is so now i'm going to show
you how to use
elastic bean stock with your visual
studio so we're going to start off from
the console
in the console we are going to type in
elastic beanstalk here we're just going
to select it here
or it's under compute once we click on
it
in the top right hand corner there's uh
create new application
uh button which we're going to click and
in there we're going to give it
a name it can be really anything in this
case web application
we can give it some description
and then we can choose next
we have a option between using web
server environment or worker
service environment we do have a web
server web application running in a
visual studio so we're going to go with
a web server environment
and here there's number of
pre-configured options
obviously we're going to go for the net
windows iis option
there's also a whole bunch of things
like php python ruby tomcat
packer and also pre-configured docker
options such as glass fish go and python
so you'll see here that automatically it
actually chose
an environment type for us which is a
load balance environment with auto
scaling which is
exactly what we want this is a best
practice too
we also have an option to specify um
the the application version and the
source for your application version
um in this case we're going to be using
sample application but we could be
specifying our own specific
specifically or uploading it and then
also the deployment
preference which can be rolling or it
can be all at once
and then there's also health check
options and batch sizes
with respect to the percentage
now it goes and bin stock creates
environment variables for us uh just to
be
safe we can actually check the
availability and make sure it's there
uh we can all again give it some
description um
for specifically for my environment that
we've that we're about to create
you can go next and then we have an
option to
create this environment inside of epc or
to create
as well an rds db instance with this
environment so rds is
our database service
that we can use so we can automatically
create this
environment that that already has sql in
it and specify that
our application is using it
so here we're going to use i guess t2
micro
to actually select we're going to use
a key pair of our choice these are
optional things where we can specify
email address
to get notified about any major changes
to our environment
probably an ops team will want that and
then
also application health check url that
is going to be used
and then how the rolling updates will
happen um
whether we want cross zone load
balancing of course we want because you
know if one of the
availability zones goes down we want to
make sure that the application is still
available
um and then we also allow connection
draining
um so we're just going to collect you
know leave everything as it is
um and select to the next um environment
text
we're not going to do this we're not
going to put this on but this is
something you should always put in
because you would really want all of
your um all of your resources
to always be tagged uh for many reasons
from reporting to
ops to its usage with many of the
services
and and discoverability of of the
resources you created
so now we're going to go to the rds
configuration
so here we're going to choose sql server
express in this case it would already
have has pre-created
or rather pre pre-selected instance
class
of dbt to micro allocated storage
um we're going to come up with our own
username and password
and you can choose whether you want it
in multiple availability zones this is
just for the test purposes so we don't
need to do that
um you can set up the retention settings
and so on and the next thing is we can
choose the
uh service role so there's an instance
profile that we already have
available and then the service role that
already exists if you
haven't uh ran through this um
through through the step-by-step process
um and this is your first time you
probably it's probably going to prompt
you to create a new service role
all you have to do is just leave it at
the option that is
that it's in already and click next
once you do that you can review all the
things that you've that you said make
sure that you
everything uh have everything fun and
then you can go ahead
and uh click launch
and um so now you'll have to wait until
uh
the health is changed from great to
green um
it's you can actually view each of the
events on how the
the uh beanstalk is creating your entire
environment
um you can look at uh you know
running version configuration and here
you can see the events
of what is being created how and so on
if there's any errors it will also
display those and so on uh if it feels
like it's stuck
just click click refresh it should be
fine in any case
i haven't had to do that before but it
really depends on the browser
so you should be good to go and
so now you'll have to wait until the
health
is changed from grade to green it's you
can actually view each of the events on
how the
beanstalk is creating your entire
environment um
you can look at you know running version
configuration and here you can see the
events
of what is being created how and so on
if there's any errors it will also
display those and so on if it feels like
it's stuck
just click click refresh it should be
fine in any case
i haven't had to do that before but it
really depends
on the browser so you should be good to
go so now we're going to switch over to
our development environment
which is running which is basically a
windows 10
virtual environment that is running in
workspaces which is our service for
virtual desktop windows environments
and here i have running visual studio
2017
i am also running aws toolkit for visual
studio as part of it and as you can see
under my profile and under a region i
have actually access
to all of the aws services the same
services uh that i had access to
from from my console and i can kind of
right click
and there's uh i can launch instances i
can look at all the instances that are
currently running
all of my all of my emmys and so on the
right hand side you guys are familiar
probably familiar with solution explorer
here you can see my
my.net application mvc
that i've built over here and then i can
choose
once this build to go ahead and publish
it to
aws elastic bean stock
so here i've already created the
test.net
environment so i'm going to choose you
can see that
that now i'm busy launching the web
application one
as well at the same time so we're going
to go with test.net
um so we have a definition for the
project build app pull runtime path
we can also add um key in value for
for for application settings you're
going to go next
i guess we can just accept all the
defaults here
generate the aws deploy configuration
and now we deploy
so if we go back to our toast.net dev
environment
we can see that it's now
in deployment stage it's deploying the
application
and once it's deployed it's going to
switch its health status from gray to
green
and we'll be able to check it out so as
you can see
the full deployment has happened and
we can actually go ahead and click on
the url
of the environment where we deployed it
to you can see we have a pre-created url
here
for elastic beanstalk and you can see
our
asp.net
application has been uh deployed you can
see here my
my colleagues presentation on beanstalk
and a whole bunch of other things
and as a test so this is just a test
page of the dot net application that we
had running over here
so with any new iteration as you're kind
of finishing the coding
you can kind of change whatever you want
to change in the
in the code of your application um
add new things um integrate more aws
services
um and which will actually uh
you know decomplicate a lot of aspects
of building your application
and then you can once again build and
once your application is built and your
build is succeeded
you can well you can go ahead and
redeploy it
just by right clicking and saying deploy
to beanstalk and beanstalk will do
everything for you
it will ensure the health application of
where it's being deployed
it will do connection draining and
blue-green deployments if necessary
and then inform you once your
application is up and running in the new
environment
i hope you enjoyed my demo and my
presentation
i hope you learned how easy it is to
deploy.net applications on ec2
and in aws in general
[Music]