Flexera logo
Image: Accelerate Code Development with Cloud Application Templates

RightScale Cloud Application Templates (CATs) help you orchestrate, operate, manage, and provision complex application stacks in the cloud regardless of the cloud infrastructure providers you use. CAT files deliver an end-to-end solution for organizations to develop approved applications and add them to their service catalogs for push-button provisioning by a wide range of users with varying levels of expertise with cloud infrastructure.

We recently released the ability to package and “import” CAT code, enabling you to build sophisticated templates that use modular building blocks of components. RightScale customers are using CAT Imports to componentize their applications in order to provide separation of duties, decreased turnaround time for changes, and more straightforward code development and review cycles. The implementation of this feature in the RightScale platform allows for unit testing of component CAT files as well as integration testing of collections of CAT code before publishing production-ready applications to your consumers.

An example of a Cloud Application Template (CAT) that imports multiple code packages.

Use Cases for CAT Imports

1. Centralizing Configuration Information

One of the main use cases for CAT Imports is the centralization of configuration information into CAT packages. As an example, most RightScale users want to leverage a small set of approved images for all their workloads. By centralizing the images into a CAT package, you only need to make the change in one place for all applications to be updated. The same is true for other configuration information, such as clouds, networks, and security groups, to name a few. The information can be centralized into a single CAT package that is easy to update, review, test, and then publish.

2. Reusing Resources Across Applications

Another common use case is the reuse of cloud resources across many applications. For example, you might have a standard database server configuration that is common across many applications. With CAT Imports, you can define most of the attributes and behavior of this server in a CAT package and then import it and override the fields as required for a specific application. This allows for separation of concerns among your different application developers — database designers are responsible for database packages, and security is responsible for network and security group-related packages, to give you two examples. In the end, the final application developer/integrator simply has to bring these different packages together and customize them as needed for his application.

3. Creating Libraries of Utility Functions

Lastly, most users are taking advantage of CAT Imports to create a library of organized Cloud Workflow (CWF) code (Cloud Workflow is the language that can be used to describe the behavior of the application) that can be reused across many applications. For example, many customers are creating a “utilities” package primarily for CWF code that contains some standard utilities that are commonly used across their applications, such as logging functions, error handling definitions, and more. Customers are also leveraging CAT Imports for integration with third-party services by centralizing the HTTP calls for a given service into a package that can be used by integrated applications.

How CAT Imports Work

A CAT file contains two primary pieces of information:

  1. Declarative statements that describe the resources that make up the application.
  2. Cloud Workflow (CWF) code that describes how the application should behave during provisioning, operation, and decommissioning.

With CAT Imports, you can specify a “package” attribute for any CAT file. Doing so makes all of the declarations and code within it available to any other CAT file that imports the package. When using CAT Imports, you must still explicitly define the resources required by the importing CAT  and can override any attributes from the package as needed.

As an example, here’s a basic CAT that declares itself as a “package” and has just one server resource in it:

name "Standard Server"
rs_ca_ver 20160622
package "basic/server"
short_description "A basic server definition"
resource "base_server", type: "rs_cm.server"
  name "Basic Server"
  cloud "EC2 us-east"
  server_template "Base Linux ServerTemplate"
  instance_type "t2.small"

And here’s another simple CAT that imports the above package and uses the resource from it to create two servers, one of which is in a different cloud:

name "Pair of Servers"
rs_ca_ver 20160622
import "basic/server"
short_description "Launches a couple of servers"
resource "aws_server", type: "rs_cm.server"
  like @server.base_server
resource "gce_server", type: "rs_cm.server"
  like @server.base_server
  cloud "Google"
  instance_type "n1-standard-1"

The Bottom Line

As cloud applications leverage a wider number and variety of services to deliver value to users, not only are the application definitions becoming more complex, but they’re also getting larger. With the ability to modularize your application definitions, you can develop templates more quickly, increase collaboration, and implement strong standardization. Together, these benefits in RightScale Cloud Application Templates enable you to you deliver business value more quickly to your end users. Check out additional detailed documentation.