How to use AWS CloudFormation templates to automate solutions inside Amazon AWS
How to use AWS CloudFormation templates to automate solutions inside Amazon AWS
In the AWS Class here at Interface, we actually build fully automated solutions with AWS CloudFormations. Here’s an overview of using AWS templates using CloudFormation.
CloudFormation is basically an “infrastructure-as-code tool” where you can go into a declarative document and define all the resources that you want and feed the document into the CloudFormation service and spin up huge environment relatively easy. AWS CloudFormation is a very powerful service that some of the biggest companies in the world use this service to automate deployments every day.
Here is the actual Amazon AWS Quick Starts page.
There are numerous CloudFormation template options that Amazon Web Services (AWS) builds that allow you to spin services up on the platform. All these templates are free for you to use you just pay for the resources that the templates use when the spin up in the background. These are built by Amazon Web Services and there a great place to start to familiarize yourself and inspiration to start writing your own templates.
For example, this is the architecture for a SharePoint environment running on the AWS platform.
You can see that there is a lot going on. We have a single BPC that is spanning two availability zones. These boxes comprise two different datacenters.
We also have Web Front End Servers, Application Servers, Database Servers, Active Directory Domain Controllers and running in this environment.
Amazon actually created a template for this and you can launch and it will spin up this entire environment. If you’ve ever built an environment like this manually either on premises, with physical hardware or in a virtualized platform such as HyperV or VMware, then you know building something like this manually will take a very long time. It could easily take you over 4-6 hours to build this environment. Now with CloudFormation and Infrastructure Automation is that you can build a template that rolls all if this out for you automatically. You do not need to dedicate a lot of hours setting up you environment.
Next, I’ll show you how to launch this particular template and spin up this particular environment. Again, I’ll show you how build this in more detail in the 4-day AWS class.
I’m on the AWS Quick Start Home Page and I’ll scroll down a bit and there’s an option to “Deploy” the SharePoint Farm from our previous example.
I’ll click Deploy and this will take me into the CloudFormation Console. You can see down at the bottom of the screen it already has the template urls for the JSON Document is already in an S3 Bucket.
S3 is the Object Storage Service for AWS. The template is just a single file available. You can also upload your own file if you wrote your own template then you could put it in your S3 Bucket and deploy from there.
The one we’ve used in this example in an Amazon built solution template. I’ll click Next.
From here I can define all of the settings that I may wan for this environment.
We have the name of the stack which defaults to “SharePoint”.
All of these options here are parameters that exist within the template which allows ways for you to feed in data into the template at runtime so that you can customize the actual experience and output of what is going to happen.
For example, if you wanted to change the IP Address Space you can do that.
You can change the Network Configuration Option.
The template gives us the option to define the CIDR Range for the entire VPC
We can carve up all the subnets with the IP Address Space that we may want to use.
This is where we can customize all of this.
Amazon EC2 Configuration
We can scroll down further and find other customization configuration such as the Key Par Name we want to use for the environment.
I’m currently in the Oregon region I can remote desktop into these server and decrypt the Administrator Password.
We can change the Instance Types.
As you can see, there are a numerous EC2 config parameters because this particular template does a lot of work. Keep in mind is you can put as many parameter as you want and this example is rather complex.
You can keep it simple as well.
In my class, I’ll show how to build these templates and define these parameters and accept input from users as they launch templates in AWS as well.
As we continue to scroll down, you can see we can place password information in.
We can also specify various information such as the ISO Image to use for SharePoint incase it’s not bundled into the image.
You can supply all the information you need to the template configuration and then click “Next”.
This is where the CloudFormation Service will go out and spin up the stack and you will be ready to go.
This example will take a while because there’s so much infrastructure involved.
Simple AWS Build from WordPress Template
Next I’ll show a simple and easy solution with AWS CloudFormation using a simple WordPress template.
In the CloudFormation Console, if you’re on the main page of AWS, you would come into the Management tools of AWS and click CloudFormation.
Then you can click on Create New Stack.
This is where you can upload your own template or you can pick one that AWS has pre-defined for you.
These are simpler than the AWS SharePoint temple that we looked at in the beginning.
For example. We may want to spin up a WordPress Blogsite, there’s a WordPress template that Amazon has already built.
You can select it and when you select Next and will fill out all the information just like before.
You can see that the parameter list is a lot smaller and makes for a much simpler implementation.
I’ll name the stack “WordPress”
Provide an Admin password and password for my database.
I’ll create a database user and a Key Pair Name.
This template is actually going to build an EC2 Instance with a MySQL Database and automatically install WordPress and I’ll be able to use my Amazon EC2 Key Pair to SSH into the instances.
We even have a constraint here at the bottom for SSHLocation that actually limits where we can SSH from to get into the instance.
This leverages Security Group Rules.
I’ll lunch this AWS WordPress Template.
I won’t change anything on this screen; I’ll leave the defaults as-is and click Next.
Finally I’ll click Create.
This launches the Stack and you can see we have status message of “Create in Progress” in the AWS console.
Since this is a smaller solution, it will be done in approximately 5-minutes. The AWS SharePoint instance that we looked at before is much more complex and could take a couple of hours.
This is the capability you have on the AWS Console Platform to actual automate full and entire infrastructure stacks using CloudFormation.
I’m looking forward to seeing you here in class or online with RemoteLive where we explore taking the Amazon CloudFormation Service on AWS.
His instructor-led classed can be attend online with RemoteLive™.
You May Also Like
Mark Jacob, Cisco Instructor, presents an introduction to Cisco Modeling Labs 2.0 or CML2.0, an upgrade to Cisco’s VIRL Personal Edition. Mark demonstrates Terminal Emulator access to console, as well as console access from within the CML2.0 product. Hello, I’m Mark Jacob, a Cisco Instructor and Network Instructor at Interface Technical Training. I’ve been using … Continue reading A Simple Introduction to Cisco CML2
This content is from our CompTIA Network + Video Certification Training Course. Start training today! In this video, CompTIA Network + instructor Rick Trader demonstrates how to use cable testers in network environments. Let’s look at some tools that we can use to test our different cables in our environment. Cable Testers Properly Wired Connectivity … Continue reading Cable Testers and How to Use them in Network Environments
Video transcription Steve Fullmer: In our Windows training courses, we often share information about the Windows 8.1 Mobility Center. Mobility Center was introduced for mobile and laptop devices in Windows 7. It’s present and somewhat enhanced in Windows 8. Since we don’t have mobile devices in our classrooms, I decided to take a little bit … Continue reading Configuring Windows Mobility Center and How to Turn it On and Off