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
In this Office 365 training video, instructor Spike Xavier demonstrates how to create users and manage passwords in Office 365. For instructor-led Office 365 training classes, see our course schedulle: Spike Xavier SharePoint Instructor – Interface Technical Training Phoenix, AZ 20347: Enabling and Managing Office 365
One of the coolest new features in Window Server 2012 and Windows Server 2012 R2 is the ability to clone a Domain Controller. In the past, if we had virtualized Domain Controllers and we actually took a snapshot of it and then rolled back to that snapshot, it would break the logon service on that … Continue reading How to clone a Windows Server 2012 or 2012 R2 Domain Controller
How does an investigator hunt down and identify unknown malware? In this recording of our IT Security training webinar on April 21, 2015, Security expert Mike Danseglio (CISSP / CEH) performed several malware investigations on infected computers and identify symptoms, find root cause, and follow the leads to determine what’s happening. He demonstrated his preferred … Continue reading Detailed Forensic Investigation of Malware Infections – April 21, 2015