What's one good thing about running applications in the AWS cloud? You have full control over which types of virtual
machine instances you run and the code you deploy on them. What's one bad thing? You're responsible for configuring and deploying these instances.
When you set up and run just a few sets of VM instances, manual procedures work fine. But once you need to configure multiple instances, it's time to automate the process. This is where OpsWorks comes in.
Automating deployments with OpsWorks
OpsWorks is an automated deployment tool in AWS that allows you to work at a high level of systems abstraction. Rather than manually configuring each detail of every component, OpsWorks runs scripts that perform these actions. OpsWorks uses the open source configuration tool Chef; a wide range of scripts, or "cookbooks" as they're called in Chef, are freely available to help users new to OpsWorks get started without having to custom code.
OpsWorks organizes tasks around a three-tier model that consists of stacks, layers and applications.
- Stacks are the highest level of abstraction and define the overall configuration of your system. Stacks include resources such as servers, databases and load balancers.
- Layers are also used to configure subsystems such as a set of Web servers or a database server. Layers specify a set of resources that are managed as a logical unit, including instances, EBS volumes and elastic IP addresses.
- Applications refer to the software you run on servers. You simply specify where AWS can find the application code and OpsWorks runs the code for you.
OpsWorks limitations and benefits
Amazon OpsWorks is a free tool that helps automate time-consuming tasks, but it's not without issues. While it supports Amazon Linux and Ubuntu operating systems, it doesn't support Microsoft Windows. Additionally, the default limit in OpsWorks is 20 stacks, each running 20 layers and 20 applications. And since instance setups are only done with Chef recipes, you can't depend on user data to configure instances. Advanced users may take issue with this.
One benefit of OpsWorks is that it automatically collects performance data on CPU, memory and system load for AWS CloudWatch, which provides graphical reports on instance performance. It also provides alarms so you can trigger events, such as notifications, when particular events occur or you surpass resource thresholds. Another benefit is that AWS OpsWorks is free of charge; you only pay for the computer, storage and other billable resources used.
Using scripts to manage configurations helps improve deployment consistency and can reduce the risk of errors. OpsWorks allows admins to orchestrate the use of multiple scripts to manage the entire deployment process. This is particularly important when instances are frequently started, run for a period of time and then shut down. When working with multiple deployment environments, such as development, test and production, OpsWorks can help with management.
About the author:
Dan Sullivan holds a Master of Science degree and is an author, systems architect and consultant with more than 20 years of IT experience. He has had engagements in advanced analytics, systems architecture, database design, enterprise security and business intelligence. He has worked in a broad range of industries, including financial services, manufacturing, pharmaceuticals, software development, government, retail and education. Dan has written extensively about topics that range from data warehousing, cloud computing and advanced analytics to security management, collaboration and text mining.