Giter Site home page Giter Site logo

ec2-windows-codedeploy's Introduction

ec2-windows-codedeploy

Learning how to use CDK to set up an environment to CD legacy .NET apps to Windows EC2 services.

Borrowing heavily from this AWS tutorial we will start to automate the process. There will be some manual setup work, we will look to automate more as we go on.

Behavoiur

Once the deployment has finished we will have 2 EC2 instances that are created using the Base AMI that has IIS and the CodeDeploy agent installed. You will be able to see the IIS welcome page if you hit either of the 2 public EC2 IP addreses, or better yet, the public dns of our Load Balancer.

No application has been installed yet. It's just the infra.

The first install

Our trigger to install a new app will be to upload a zip file specifically called MyWebApp2.zip to the S3 bucket generated by the stack. So let's do that.

Once you upload the file, you will be able to see AWS CodePipeline start - it will invoke CodeDeploy to deploy the app to each server. The semantics are the default one-at-a-time, so you can watch each start up one after the other.

New versions of the app

To release a new version of the app, upload a new MyWebApp2.zip to the bucket again, this will trigger CodePipeline again and both instances will be updated.

Scale event

Since we are using CodeDeploy and AutoScalingGroups, this is handled gracefully. You won't see CodePipeline kicking in, but you will see CodeDeploy take care of applying the latest version of the app to the new server.

Pre Work

Of course, you will want to have an AWS account. There is more to automate, so for the time being I am relying on you to provide the following:

Base AMI

Follow the Master Image directions of the workshop to give us the AMI we will use to build out our EC2 fleet.

Contrary to the tutorial, I am allowing RDP to machines to debug as we are still learning :)

If you have followed the above you would have also have:

  • A VPC (I was just using the default VPC)
  • Security Group
  • Keypair allowing us to RDP into the machine.

Setting up

I will start to externalise this stuff, but for now head into /lib/cdk-infra.ts and fill in your keypair, vpc, machine image and security group.

Bootstrap and run your CDK

You will want to set up your CDK environment - you can see more detail about that referencing CDK Workshop.

cdk bootstrap
cdk synth
cdk deploy

References

CDK Workshop

ec2-windows-codedeploy's People

Contributors

deanbaker avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.