Lesson 3: Infrastructure as Code (IaC)

Because all services offered through the major cloud providers are exposed via APIs then you can start to codify your infrastructure.

To explain this in more detail lets look at the different ways we can build a server in AWS. AWS servers are called “EC2 instances” (ECC stands for Elastic Compute Cloud). Once you have an account you can use your browser to visit a console where you can click on a button to build your server. The form will ask you a bunch of questions and then Amazon will build the virtual server for you.

However Amazon also allow you to build your server from the command line. You can download the AWS SDK or you can use the CLI.  These tools will allow us to write code that can be executed to build whatever we need. There are other tools (such as Ansible and Terraform) that can add a level of abstraction and simplification to this process.

Once all of your infrastructure is built as code things start to change in the way the infrastructure is managed. We can start to introduce all the good practices that developers have been using for years to manage code. Simple things such as versioning, keeping backups of previous versions, extensive in-line commenting to name but a few.

Our code can tell our Cloud Service Provider (CSP) what to build but also tell us what we have built removing the need to continually update a database  that references our complex environments. Infrastructure change becomes easier to manage as we can roll back to a previous version in minutes.

But our code can do even more than this. Our code can include references that allow automatic scaling of services. However that demands an understanding of the subject of elasticity and at this point its probably worth reviewing the 10 principles of a good Cloud strategy.

Contact Page

Leave a message

So today I am delighted to announce that Insperitas can now take your messages despite being hosted as static pages on S3. <Fanfare>

When the contact form is completed and you hit Send then your browser should collect your data and send it to AWS API Gateway. Then AWS Lambda will post that into S3.  If this doesn’t work well for your specific browser please let me know. You can still email  via your normal method to contact@insperitas.com.

Contact Page

 

Some Worthy Credits

I want to take a few minutes to thank the authors and developers whose code I used or whose direction I followed to get this insperitas site to where it is today. I can’t possibly mention every name as I scoured the internet for clues when things went wrong and spent hours on stackoverflow. 🙂

For the contact form:   Thanks to Collins Abonghama  https://www.sitepoint.com/build-your-own-wordpress-contact-form-plugin-in-5-minutes/

For the lambda suggestions along with API Gateway I have to thank David Maple  https://www.codeengine.com/articles/process-form-aws-api-gateway-lambda/

For Form building I followed TGroshon at CodeHabitude https://codehabitude.com/2016/04/05/forms-to-emails-using-aws-lambda-api-gateway/ and also Matt West whose work is posted at https://blog.teamtreehouse.com/create-ajax-contact-form

Also I had some help from my good friend Tim Fuller https://www.linkedin.com/in/tim-fuller-788a2421/ Since I am not a natural developer I needed considerable syntax troubleshooting help.

Of course I also need to thank all the people I have worked on Cloud Solutions with over the course of the past few years at HSBC, FlyBe and  Odeon. There are some great minds out there building some incredible solutions.

There are a number of trainers too at AWS, Google and RedHat who have helped enormously. Having run a number of training courses myself its easy to spot the professionalism.

Contact Page